-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
base: poco-1.8.2
Are you sure you want to change the base?
Conversation
NetSSL_Win/src/Context.cpp
Outdated
{ | ||
// Sanity check for the hash value. | ||
if(_certInfoOrPath.size() % 2) throw CertificateException(Poco::format("Invalid certificate hash %s", _certInfoOrPath)); | ||
|
There was a problem hiding this comment.
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.
NetSSL_Win/src/Context.cpp
Outdated
@@ -23,8 +23,11 @@ | |||
#include "Poco/MemoryStream.h" | |||
#include "Poco/Base64Decoder.h" | |||
#include "Poco/Buffer.h" | |||
#include "Poco/HexBinaryDecoder.h" |
There was a problem hiding this comment.
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++) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possibly use HexBinaryDecoder here?
There was a problem hiding this comment.
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.
Travis CI build failed twice. Based on the logs it seems not to be related to my changes |
Re-triggering the Travis build by closing and reopening. |
Hi @aleks-f, any idea why Travis build is failing? |
@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? |
@haismail this should be redirected to devel branch |
@haismail any interest to have this in 1.13? |
@haismail, please update the PR to be merged to branch devel ASAP to get it merged into release 1.13. |
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.