SUPPORT-8883. Исправлена ошибка при работе с CryptoPro KC2
(cherry picked from commit a6aa8f79d4)
# Conflicts:
# src/utils/cryptopro.c
This commit is contained in:
parent
415beb65d0
commit
1e823ea2ec
1 changed files with 5 additions and 4 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue