mirror of
https://github.com/moparisthebest/curl
synced 2025-01-11 05:58:01 -05:00
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
This commit is contained in:
parent
ab9dc5ae2a
commit
7284061361
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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 {
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user