diff options
author | Viktor Szakats <commit@vsz.me> | 2020-03-17 23:06:05 +0000 |
---|---|---|
committer | Viktor Szakats <commit@vsz.me> | 2020-03-17 23:08:02 +0000 |
commit | 7284061361e32d6f4d6308bf41d751601d101ba2 (patch) | |
tree | 3525264e37d45147347f11ba918a484e85960b35 | |
parent | ab9dc5ae2a86e42bb087986587e68cefdf76531d (diff) |
windows: suppress UI in all CryptAcquireContext() calls
Ref: https://docs.microsoft.com/windows/win32/api/wincrypt/nf-wincrypt-cryptacquirecontexta#parameters
Reviewed-by: Marc Hörsken
Closes https://github.com/curl/curl/pull/5088
-rw-r--r-- | lib/curl_ntlm_core.c | 2 | ||||
-rw-r--r-- | lib/md4.c | 2 | ||||
-rw-r--r-- | lib/md5.c | 4 | ||||
-rw-r--r-- | lib/sha256.c | 4 | ||||
-rw-r--r-- | lib/vtls/schannel.c | 2 | ||||
-rw-r--r-- | src/tool_metalink.c | 12 |
6 files changed, 13 insertions, 13 deletions
diff --git a/lib/curl_ntlm_core.c b/lib/curl_ntlm_core.c index f9b823b4f..32e29a933 100644 --- a/lib/curl_ntlm_core.c +++ b/lib/curl_ntlm_core.c @@ -342,7 +342,7 @@ static bool encrypt_des(const unsigned char *in, unsigned char *out, /* Acquire the crypto provider */ if(!CryptAcquireContext(&hprov, NULL, NULL, PROV_RSA_FULL, - CRYPT_VERIFYCONTEXT)) + CRYPT_VERIFYCONTEXT | CRYPT_SILENT)) return FALSE; /* Setup the key blob structure */ @@ -146,7 +146,7 @@ static void MD4_Init(MD4_CTX *ctx) ctx->hHash = 0; if(CryptAcquireContext(&ctx->hCryptProv, NULL, NULL, PROV_RSA_FULL, - CRYPT_VERIFYCONTEXT)) { + CRYPT_VERIFYCONTEXT | CRYPT_SILENT)) { CryptCreateHash(ctx->hCryptProv, CALG_MD4, 0, 0, &ctx->hHash); } } @@ -186,8 +186,8 @@ typedef struct { static void MD5_Init(MD5_CTX *ctx) { - if(CryptAcquireContext(&ctx->hCryptProv, NULL, NULL, - PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) { + if(CryptAcquireContext(&ctx->hCryptProv, NULL, NULL, PROV_RSA_FULL, + CRYPT_VERIFYCONTEXT | CRYPT_SILENT)) { CryptCreateHash(ctx->hCryptProv, CALG_MD5, 0, 0, &ctx->hHash); } } diff --git a/lib/sha256.c b/lib/sha256.c index 352d577e8..00d98ce46 100644 --- a/lib/sha256.c +++ b/lib/sha256.c @@ -207,8 +207,8 @@ typedef struct { static void SHA256_Init(SHA256_CTX *ctx) { - if(CryptAcquireContext(&ctx->hCryptProv, NULL, NULL, - PROV_RSA_AES, CRYPT_VERIFYCONTEXT)) { + if(CryptAcquireContext(&ctx->hCryptProv, NULL, NULL, PROV_RSA_AES, + CRYPT_VERIFYCONTEXT | CRYPT_SILENT)) { CryptCreateHash(ctx->hCryptProv, CALG_SHA_256, 0, 0, &ctx->hHash); } } diff --git a/lib/vtls/schannel.c b/lib/vtls/schannel.c index f665ee340..3b9aef47c 100644 --- a/lib/vtls/schannel.c +++ b/lib/vtls/schannel.c @@ -2203,7 +2203,7 @@ static void Curl_schannel_checksum(const unsigned char *input, memset(checksum, 0, checksumlen); if(!CryptAcquireContext(&hProv, NULL, NULL, provType, - CRYPT_VERIFYCONTEXT)) + CRYPT_VERIFYCONTEXT | CRYPT_SILENT)) return; /* failed */ do { diff --git a/src/tool_metalink.c b/src/tool_metalink.c index f87f686f1..e8629353f 100644 --- a/src/tool_metalink.c +++ b/src/tool_metalink.c @@ -336,8 +336,8 @@ static void win32_crypto_final(struct win32_crypto_hash *ctx, static int MD5_Init(MD5_CTX *ctx) { - if(CryptAcquireContext(&ctx->hCryptProv, NULL, NULL, - PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) { + if(CryptAcquireContext(&ctx->hCryptProv, NULL, NULL, PROV_RSA_FULL, + CRYPT_VERIFYCONTEXT | CRYPT_SILENT)) { CryptCreateHash(ctx->hCryptProv, CALG_MD5, 0, 0, &ctx->hHash); } return 1; @@ -357,8 +357,8 @@ static void MD5_Final(unsigned char digest[16], MD5_CTX *ctx) static int SHA1_Init(SHA_CTX *ctx) { - if(CryptAcquireContext(&ctx->hCryptProv, NULL, NULL, - PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) { + if(CryptAcquireContext(&ctx->hCryptProv, NULL, NULL, PROV_RSA_FULL, + CRYPT_VERIFYCONTEXT | CRYPT_SILENT)) { CryptCreateHash(ctx->hCryptProv, CALG_SHA1, 0, 0, &ctx->hHash); } return 1; @@ -378,8 +378,8 @@ static void SHA1_Final(unsigned char digest[20], SHA_CTX *ctx) static int SHA256_Init(SHA256_CTX *ctx) { - if(CryptAcquireContext(&ctx->hCryptProv, NULL, NULL, - PROV_RSA_AES, CRYPT_VERIFYCONTEXT)) { + if(CryptAcquireContext(&ctx->hCryptProv, NULL, NULL, PROV_RSA_AES, + CRYPT_VERIFYCONTEXT | CRYPT_SILENT)) { CryptCreateHash(ctx->hCryptProv, CALG_SHA_256, 0, 0, &ctx->hHash); } return 1; |