SUPPORT-8941. Добавлено получение названия и типа провайдера из конфигурационного файла (подпись)

This commit is contained in:
alashkova 2025-02-24 15:43:55 +03:00
parent 9f0a9efa11
commit 2517eb1a34
11 changed files with 49 additions and 12 deletions

View file

@ -809,15 +809,16 @@ exit:
}
int
cryptopro_gen_random(unsigned char* data, size_t len)
cryptopro_gen_random(const cryptopro_context_t *ctx, unsigned char* data, size_t len)
{
HCRYPTPROV hCryptProv = 0;
LOG_TRACE("cryptopro_gen_random enter");
if (!cp_function_list.CryptAcquireContext(&hCryptProv, NULL, NULL, PROV_GOST_2012_256,
if (!cp_function_list.CryptAcquireContext(&hCryptProv, NULL, ctx->provider, ctx->prov_type,
CRYPT_VERIFYCONTEXT)) {
LOG_ERROR("CryptAcquireContext() failed");
LOG_ERROR("CryptAcquireContext() failed. provider: '%s', prov_type: %u",
ctx->provider, ctx->prov_type);
goto error;
}