From 0784665ce86d240841bd3dbaa5a5b2fe04bdfaba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnter=20Obiltschnig?= Date: Thu, 22 Aug 2019 13:05:54 +0200 Subject: [PATCH] backported #2773: Fix the issue with incorrect type of store name parameter in CertOpenStore API call into NetSSL_Win --- NetSSL_Win/src/Context.cpp | 2 +- NetSSL_Win/src/X509Certificate.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/NetSSL_Win/src/Context.cpp b/NetSSL_Win/src/Context.cpp index c9ff25a63..dcb44d3c9 100644 --- a/NetSSL_Win/src/Context.cpp +++ b/NetSSL_Win/src/Context.cpp @@ -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()); } diff --git a/NetSSL_Win/src/X509Certificate.cpp b/NetSSL_Win/src/X509Certificate.cpp index bb8f5166f..60a99d87d 100644 --- a/NetSSL_Win/src/X509Certificate.cpp +++ b/NetSSL_Win/src/X509Certificate.cpp @@ -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());