summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Beauzée-Luyssen <hugo@beauzee.fr>2018-12-04 15:18:36 +0100
committerHugo Beauzée-Luyssen <hugo@beauzee.fr>2018-12-19 09:46:01 +0100
commit7799eb1a092bc8ac2a4674ec31c4d7308e4b695a (patch)
tree72f78f1efb267c1a6f0a34d86db98932e3e1073f
parent362a0c30b79ccede7e5bc3a7747c3e7f1d30889a (diff)
downloadgnutls-7799eb1a092bc8ac2a4674ec31c4d7308e4b695a.tar.gz
keys-win: Disable private key import on windows store
Windows store drastically limits the available functions. In this case, at least CryptSetProvParam and the NCrypt* functions can't be used Signed-off-by: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
-rw-r--r--lib/system/keys-win.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/system/keys-win.c b/lib/system/keys-win.c
index 16d6f9f951..ab4f6aaa0d 100644
--- a/lib/system/keys-win.c
+++ b/lib/system/keys-win.c
@@ -43,6 +43,7 @@
#include <wincrypt.h>
#include <winbase.h>
+#include <winapifamily.h>
#define DYN_NCRYPT
@@ -612,6 +613,9 @@ static int cng_info(gnutls_privkey_t key, unsigned int flags, void *userdata)
-*/
int _gnutls_privkey_import_system_url(gnutls_privkey_t pkey, const char *url)
{
+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
+ return gnutls_assert_val(GNUTLS_E_UNIMPLEMENTED_FEATURE);
+#else
uint8_t id[MAX_WID_SIZE];
HCERTSTORE store = NULL;
size_t id_size;
@@ -861,6 +865,7 @@ int _gnutls_privkey_import_system_url(gnutls_privkey_t pkey, const char *url)
CertCloseStore(store, 0);
return ret;
+#endif
}
int _gnutls_x509_crt_import_system_url(gnutls_x509_crt_t crt, const char *url)