backported #2773: Fix the issue with incorrect type of store name parameter in CertOpenStore API call into NetSSL_Win

This commit is contained in:
Günter Obiltschnig 2019-08-22 13:05:54 +02:00
parent 8f96473bde
commit 0784665ce8
2 changed files with 2 additions and 2 deletions

View File

@ -167,7 +167,7 @@ void Context::loadCertificate()
if (!_hCertStore)
{
if (_options & OPT_USE_MACHINE_STORE)
_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());
}

View File

@ -366,7 +366,7 @@ void X509Certificate::loadCertificate(const std::string& certName, const std::st
Poco::UnicodeConverter::convert(certStoreName, wcertStore);
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());