mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-28 11:31:53 +01:00
#2834: Wrong cancelation of the fix: incorrect type of store name parameter in CertOpenStore API call into NetSSL_Win. Release 1.10.0
This commit is contained in:
@@ -381,13 +381,13 @@ void* X509Certificate::nid2oid(NID nid)
|
||||
|
||||
void X509Certificate::loadCertificate(const std::string& certName, const std::string& certStoreName, bool useMachineStore)
|
||||
{
|
||||
std::wstring wcertStore;
|
||||
Poco::UnicodeConverter::convert(certStoreName, wcertStore);
|
||||
std::wstring wcertStoreName;
|
||||
Poco::UnicodeConverter::convert(certStoreName, wcertStoreName);
|
||||
HCERTSTORE hCertStore;
|
||||
if (useMachineStore)
|
||||
hCertStore = CertOpenStore(CERT_STORE_PROV_SYSTEM, 0, 0, CERT_SYSTEM_STORE_LOCAL_MACHINE, certStoreName.c_str());
|
||||
hCertStore = CertOpenStore(CERT_STORE_PROV_SYSTEM, 0, 0, CERT_SYSTEM_STORE_LOCAL_MACHINE, wcertStoreName.c_str());
|
||||
else
|
||||
hCertStore = CertOpenSystemStoreW(0, wcertStore.c_str());
|
||||
hCertStore = CertOpenSystemStoreW(0, wcertStoreName.c_str());
|
||||
|
||||
if (!hCertStore) throw CertificateException("Failed to open certificate store", certStoreName, GetLastError());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user