Skip to content

Commit

Permalink
Properly set expected digest size for mac in provider
Browse files Browse the repository at this point in the history
  • Loading branch information
beldmit committed Nov 14, 2021
1 parent df3ead2 commit 8efda32
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test_digest.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);

Expand Down

0 comments on commit 8efda32

Please sign in to comment.