Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find certificate from Windows store using its thumbprint #2123

Open
wants to merge 2 commits into
base: poco-1.8.2
Choose a base branch
from

Conversation

haismail
Copy link

Trying to find a certificate using certificateName turned out to be really difficult. It's always giving Failed to find certificate error, so I added the possibility to search a certificate using its SHA1 hash.

@aleks-f aleks-f added this to the Release 1.8.2 milestone Jan 30, 2018
{
// Sanity check for the hash value.
if(_certInfoOrPath.size() % 2) throw CertificateException(Poco::format("Invalid certificate hash %s", _certInfoOrPath));

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The length of _certInfoOrPath should be checked here as well to prevent a potential buffer overrun later on.

@@ -23,8 +23,11 @@
#include "Poco/MemoryStream.h"
#include "Poco/Base64Decoder.h"
#include "Poco/Buffer.h"
#include "Poco/HexBinaryDecoder.h"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HexBinaryDecoder is included but not used.

int bufferSize = 0;
int byte = 0;
std::string szHex;
for(int counter = 0; counter < _certInfoOrPath.size() / 2; counter++)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibly use HexBinaryDecoder here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to use it, but for some reason it's not working as I expected.

@haismail haismail closed this Feb 5, 2018
@haismail haismail reopened this Feb 5, 2018
@haismail
Copy link
Author

haismail commented Feb 5, 2018

Travis CI build failed twice. Based on the logs it seems not to be related to my changes make: *** [PDF-libexec] Error 2

@haismail
Copy link
Author

haismail commented Feb 6, 2018

Re-triggering the Travis build by closing and reopening.

@haismail haismail closed this Feb 6, 2018
@haismail haismail reopened this Feb 6, 2018
@haismail
Copy link
Author

haismail commented Feb 6, 2018

Hi @aleks-f, any idea why Travis build is failing?

@aleks-f
Copy link
Member

aleks-f commented Feb 7, 2018

@haismail depends, often it times out or misses some dependency download. In any case, travis does not matter for this pull, since it is windows-only.

@zosrothko can we get rid of the PDF build in 1.8.2 travis as well?

@obiltschnig obiltschnig modified the milestones: Release 1.8.2, Release 1.9.0 Feb 17, 2018
@aleks-f
Copy link
Member

aleks-f commented May 30, 2022

@haismail this should be redirected to devel branch

@aleks-f
Copy link
Member

aleks-f commented Mar 20, 2023

@haismail any interest to have this in 1.13?

@matejk matejk self-assigned this Dec 15, 2023
@matejk
Copy link
Contributor

matejk commented Dec 15, 2023

@haismail, please update the PR to be merged to branch devel ASAP to get it merged into release 1.13.

@aleks-f aleks-f removed this from the Release 1.13.0 milestone Dec 21, 2023
@aleks-f aleks-f added this to the Release 1.13.1 milestone Dec 21, 2023
@aleks-f aleks-f modified the milestones: Release 1.13.1, Unspecified Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants