From 8efda3214b5592a5267db96cb0d0da2a2c747a69 Mon Sep 17 00:00:00 2001 From: Dmitry Belyavskiy Date: Sun, 14 Nov 2021 11:46:20 +0100 Subject: [PATCH] Properly set expected digest size for mac in provider --- test_digest.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test_digest.c b/test_digest.c index 9d3019a9c..b9c48810a 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);