From 1e823ea2eca9f1a4e05a2f4e723e327baaddbfa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9D=D0=B0=D0=B8=D0=BB=D1=8F=20=D0=90=D0=BB=D0=B0=D1=88?= =?UTF-8?q?=D0=BA=D0=BE=D0=B2=D0=B0?= Date: Fri, 24 Jan 2025 12:12:48 +0300 Subject: [PATCH] =?UTF-8?q?SUPPORT-8883.=20=D0=98=D1=81=D0=BF=D1=80=D0=B0?= =?UTF-8?q?=D0=B2=D0=BB=D0=B5=D0=BD=D0=B0=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA?= =?UTF-8?q?=D0=B0=20=D0=BF=D1=80=D0=B8=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=B5=20=D1=81=20CryptoPro=20KC2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit a6aa8f79d4887dba5e79835327c36aad98b7a1d4) # Conflicts: # src/utils/cryptopro.c --- src/utils/cryptopro.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/utils/cryptopro.c b/src/utils/cryptopro.c index 5c3c82b..e56af6a 100644 --- a/src/utils/cryptopro.c +++ b/src/utils/cryptopro.c @@ -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; }