Commit fef8823d authored by Steve Lhomme's avatar Steve Lhomme Committed by Hugo Beauzée-Luyssen

contrib: gnutls: map CertOpenSystemStore() to CertOpenStore() only for Universal apps

the use of CERT_STORE_PROV_SYSTEM_A and TEXT() was probably wrong too
Signed-off-by: Hugo Beauzée-Luyssen's avatarHugo Beauzée-Luyssen <hugo@beauzee.fr>
parent dd2b9934
--- gnutls/lib/system.c.orig2 2016-04-05 11:14:43.364389441 +0200 --- gnutls/lib/system.c 2016-05-18 09:28:09.902830600 +0200
+++ gnutls/lib/system.c 2016-04-05 11:20:18.535618044 +0200 +++ gnutls/lib/system.c.winstore 2016-05-18 13:06:32.408396400 +0200
@@ -429,9 +429,11 @@ @@ -34,6 +34,17 @@
gnutls_datum_t data; #ifdef _WIN32
# include <windows.h>
if (i == 0) # include <wincrypt.h>
- store = CertOpenSystemStore(0, "ROOT"); +# include <winapifamily.h>
+ store = CertOpenStore(CERT_STORE_PROV_SYSTEM_A, X509_ASN_ENCODING, 0, +# if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
+ CERT_SYSTEM_STORE_CURRENT_USER, TEXT("ROOT")); +# if defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x0A00 /* Univeral Winstore */
else +# undef CertOpenSystemStore
- store = CertOpenSystemStore(0, "CA"); +HCERTSTORE CertOpenSystemStore( HCRYPTPROV_LEGACY hprov, LPCSTR szSubsystemProtocol )
+ store = CertOpenStore(CERT_STORE_PROV_SYSTEM_A, X509_ASN_ENCODING, 0, +{
+ CERT_SYSTEM_STORE_CURRENT_USER, TEXT("CA")); + return CertOpenStore( CERT_STORE_PROV_SYSTEM_A, X509_ASN_ENCODING, 0,
+ CERT_SYSTEM_STORE_CURRENT_USER, szSubsystemProtocol );
if (store == NULL) +}
return GNUTLS_E_FILE_ERROR; +# endif /* _WIN32_WINNT */
+# endif /* WINAPI_FAMILY */
# if defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR) && __MINGW32_MAJOR_VERSION <= 3 && __MINGW32_MINOR_VERSION <= 20
typedef PCCRL_CONTEXT WINAPI(*Type_CertEnumCRLsInStore) (HCERTSTORE
hCertStore,
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment