crypto/openssl: fix HMAC output length

This patch sets the max length of dst in OpenSSL 3.0 lib EVP MAC final
routine to ensure enough space for the result.

Fixes: 75adf1eae4 ("crypto/openssl: update HMAC routine with 3.0 EVP API")
Cc: stable@dpdk.org

Signed-off-by: Kai Ji <kai.ji@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
This commit is contained in:
Kai Ji 2022-08-31 23:09:18 +08:00 committed by Akhil Goyal
parent 6c55e2c3e6
commit 0100b0f3f1

View File

@ -1447,7 +1447,7 @@ process_openssl_auth_mac(struct rte_mbuf *mbuf_src, uint8_t *dst, int offset,
}
process_auth_final:
if (EVP_MAC_final(ctx, dst, &dstlen, sizeof(dst)) != 1)
if (EVP_MAC_final(ctx, dst, &dstlen, DIGEST_LENGTH_MAX) != 1)
goto process_auth_err;
EVP_MAC_CTX_free(ctx);