From 7284061361e32d6f4d6308bf41d751601d101ba2 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 17 Mar 2020 23:06:05 +0000 Subject: windows: suppress UI in all CryptAcquireContext() calls MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- lib/curl_ntlm_core.c | 2 +- lib/md4.c | 2 +- lib/md5.c | 4 ++-- lib/sha256.c | 4 ++-- lib/vtls/schannel.c | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) (limited to 'lib') 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 */ diff --git a/lib/md4.c b/lib/md4.c index 38f1b2bc9..4dab6af7a 100644 --- a/lib/md4.c +++ b/lib/md4.c @@ -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); } } diff --git a/lib/md5.c b/lib/md5.c index 3f601b3a4..766158786 100644 --- a/lib/md5.c +++ b/lib/md5.c @@ -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 { -- cgit v1.2.3