SUPPORT-8883. Исправлена ошибка при работе с CryptoPro KC2

(cherry picked from commit a6aa8f79d4)

# Conflicts:
#	src/utils/cryptopro.c
This commit is contained in:
Наиля Алашкова 2025-01-24 12:12:48 +03:00
parent 415beb65d0
commit 1e823ea2ec

View file

@ -76,7 +76,8 @@ cryptopro_sign(const cryptopro_context_t *ctx, const str_t *data, /*out*/ str_t
error:
str_t_clear(&signed_data);
str_t_clear(&sign_reversed);
LOG_ERROR("cryptopro_sign exit with error");
LOG_ERROR("cryptopro_sign exit with error (sign_cert_thumbprint = '%.*s')",
(int) ctx->cert_thumbprint->len, ctx->cert_thumbprint->data);
return -1;
}
@ -253,7 +254,7 @@ sign_hash_data(const cryptopro_context_t *ctx, const str_t *data, /*out*/ str_t
}
if (!cp_function_list.CryptAcquireCertificatePrivateKey(
pSignerCert,
pSignerCert,
CRYPT_ACQUIRE_SILENT_FLAG,
NULL,
&hCryptProv,
@ -587,8 +588,8 @@ cryptopro_verify(const str_t* cert_thumbprint, const str_t* alg, const str_t* da
goto exit;
}
if (!cp_function_list.CryptAcquireContext(&hCryptProv, NULL, CP_KC1_GR3410_2001_PROV,
PROV_GOST_2001_DH, CRYPT_VERIFYCONTEXT)) {
if (!cp_function_list.CryptAcquireContext(&hCryptProv, NULL, NULL, PROV_GOST_2012_256,
CRYPT_VERIFYCONTEXT)) {
LOG_ERROR("CryptAcquireContext() failed");
goto exit;
}