diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2018-12-20 19:40:48 +0000 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2018-12-20 19:40:48 +0000 |
commit | 5d03564cccd2c10c41252ea468d4a098bd08e9c1 (patch) | |
tree | 26b5f12d844d1df0ecc4a2a606885391bdd30dbf /lib | |
parent | 435437ad94723612deb1e238379d457b2456d83f (diff) | |
parent | ac34af7160c866b7e2354d2d197e63af48e479d8 (diff) | |
download | gnutls-5d03564cccd2c10c41252ea468d4a098bd08e9c1.tar.gz |
Merge branch 'use_CertOpenStore' into 'master'
win32: Use CertOpenStore instead of CertOpenSystemStore
See merge request gnutls/gnutls!839
Diffstat (limited to 'lib')
-rw-r--r-- | lib/system/certs.c | 4 | ||||
-rw-r--r-- | lib/system/keys-win.c | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/system/certs.c b/lib/system/certs.c index 53eb561d00..f9090f1e74 100644 --- a/lib/system/certs.c +++ b/lib/system/certs.c @@ -161,9 +161,9 @@ int add_system_trust(gnutls_x509_trust_list_t list, unsigned int tl_flags, gnutls_datum_t data; if (i == 0) - store = CertOpenSystemStore(0, "ROOT"); + store = CertOpenStore(CERT_STORE_PROV_SYSTEM, 0, 0, CERT_SYSTEM_STORE_CURRENT_USER , L"ROOT"); else - store = CertOpenSystemStore(0, "CA"); + store = CertOpenStore(CERT_STORE_PROV_SYSTEM, 0, 0, CERT_SYSTEM_STORE_CURRENT_USER, L"CA"); if (store == NULL) return GNUTLS_E_FILE_ERROR; diff --git a/lib/system/keys-win.c b/lib/system/keys-win.c index ab4f6aaa0d..c189a5d8fd 100644 --- a/lib/system/keys-win.c +++ b/lib/system/keys-win.c @@ -651,7 +651,7 @@ int _gnutls_privkey_import_system_url(gnutls_privkey_t pkey, const char *url) blob.cbData = id_size; blob.pbData = id; - store = CertOpenSystemStore(0, "MY"); + store = CertOpenStore(CERT_STORE_PROV_SYSTEM, 0, 0, CERT_SYSTEM_STORE_CURRENT_USER, L"MY"); if (store == NULL) { gnutls_assert(); ret = GNUTLS_E_FILE_ERROR; @@ -889,7 +889,7 @@ int _gnutls_x509_crt_import_system_url(gnutls_x509_crt_t crt, const char *url) blob.cbData = id_size; blob.pbData = id; - store = CertOpenSystemStore(0, "MY"); + store = CertOpenStore(CERT_STORE_PROV_SYSTEM, 0, 0, CERT_SYSTEM_STORE_CURRENT_USER, L"MY"); if (store == NULL) { gnutls_assert(); ret = GNUTLS_E_FILE_ERROR; @@ -1137,7 +1137,7 @@ gnutls_system_key_iter_get_info(gnutls_system_key_iter_t * iter, if (*iter == NULL) return gnutls_assert_val(GNUTLS_E_MEMORY_ERROR); - (*iter)->store = CertOpenSystemStore(0, "MY"); + (*iter)->store = CertOpenStore(CERT_STORE_PROV_SYSTEM, 0, 0, CERT_SYSTEM_STORE_CURRENT_USER, L"MY"); if ((*iter)->store == NULL) { gnutls_free(*iter); *iter = NULL; @@ -1210,7 +1210,7 @@ int gnutls_system_key_delete(const char *cert_url, const char *key_url) blob.cbData = id_size; blob.pbData = id; - store = CertOpenSystemStore(0, "MY"); + store = CertOpenStore(CERT_STORE_PROV_SYSTEM, 0, 0, CERT_SYSTEM_STORE_CURRENT_USER, L"MY"); if (store != NULL) { do { cert = CertFindCertificateInStore(store, |