From 0100b0f3f11fae69b65042a7b88181b58a959086 Mon Sep 17 00:00:00 2001 From: Kai Ji Date: Wed, 31 Aug 2022 23:09:18 +0800 Subject: [PATCH] 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: 75adf1eae44f ("crypto/openssl: update HMAC routine with 3.0 EVP API") Cc: stable@dpdk.org Signed-off-by: Kai Ji Acked-by: Fan Zhang --- drivers/crypto/openssl/rte_openssl_pmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/openssl/rte_openssl_pmd.c b/drivers/crypto/openssl/rte_openssl_pmd.c index 6360caeeb6..3c4ff1ac56 100644 --- a/drivers/crypto/openssl/rte_openssl_pmd.c +++ b/drivers/crypto/openssl/rte_openssl_pmd.c @@ -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);