From: Dmitry Belyavskiy Date: Sun, 14 Nov 2021 10:46:20 +0000 (+0100) Subject: Properly set expected digest size for mac in provider X-Git-Tag: v3.0.1~41 X-Git-Url: http://wagner.pp.ru/gitweb/?a=commitdiff_plain;h=8efda3214b5592a5267db96cb0d0da2a2c747a69;p=openssl-gost%2Fengine.git Properly set expected digest size for mac in provider --- diff --git a/test_digest.c b/test_digest.c index 9d3019a..b9c4881 100644 --- a/test_digest.c +++ b/test_digest.c @@ -637,7 +637,7 @@ static int do_mac(int iter, EVP_MAC *mac, const char *plaintext, size_t acpkm = (size_t)t->acpkm; size_t acpkm_t = (size_t)t->acpkm_t; - OSSL_PARAM params[] = { OSSL_PARAM_END, OSSL_PARAM_END, OSSL_PARAM_END }; + OSSL_PARAM params[] = { OSSL_PARAM_END, OSSL_PARAM_END, OSSL_PARAM_END, OSSL_PARAM_END }; OSSL_PARAM *p = params; if (acpkm) { *p++ = OSSL_PARAM_construct_size_t("key-mesh", &acpkm); @@ -650,8 +650,10 @@ static int do_mac(int iter, EVP_MAC *mac, const char *plaintext, if (t->outsize) T(EVP_MAC_CTX_get_mac_size(ctx) == t->outsize); size_t outsize; - if (t->truncate) + if (t->truncate) { outsize = t->truncate; + *p++ = OSSL_PARAM_construct_size_t("size", &outsize); + } else outsize = EVP_MAC_CTX_get_mac_size(ctx);