crypto/openssl: fix of dstlen passed in HMAC
PATCH 1/1 crypto/openssl: fix of dstlen passed in HMAC
This fix of dstlen passed in OpenSSL 3.0 lib EVP MAC final routine.
--- drivers/crypto/openssl/rte_openssl_pmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/crypto/openssl/rte_openssl_pmd.c +1 -1
@@ -1395,7 +1395,7 @@ process_openssl_auth_hmac(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);
Signature · 1 line
2.17.1
Quoted 31 lines
-----Original Message-----
From: Kai Ji <[email protected]>
Sent: Monday, July 11, 2022 6:08 PM
To: [email protected]
Cc: [email protected]; Ji, Kai <[email protected]>
Subject: [dpdk-dev v1]crypto/openssl: fix of dstlen passed in HMACThis fix of dstlen passed in OpenSSL 3.0 lib EVP MAC final routine.
Fixes 75adf1eae44f ("crypto/openssl: update HMAC routine with 3.0 EVPAPI")
Signed-off-by Kai Ji <[email protected]>--- drivers/crypto/openssl/rte_openssl_pmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/crypto/openssl/rte_openssl_pmd.c +1
-1@@ -1395,7 +1395,7 @@ process_openssl_auth_hmac(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;
Quoted 3 lines
EVP_MAC_CTX_free(ctx);
--
2.17.1
Quoted 2 lines
Subject: [EXT] [dpdk-dev v1]
crypto/openssl: fix of dstlen passed in HMAC
Title can be reworded
Crypto/openssl: fix HMAC output length
Quoted 1 line
This fix of dstlen passed in OpenSSL 3.0 lib EVP MAC final routine.
Please reword the description to explain what is not correct and what is done to fix it.
Quoted 25 lines
Fixes 75adf1eae44f ("crypto/openssl: update HMAC routine with 3.0 EVP API")Signed-off-by Kai Ji <[email protected]>--- drivers/crypto/openssl/rte_openssl_pmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/crypto/openssl/rte_openssl_pmd.c +1
-1@@ -1395,7 +1395,7 @@ process_openssl_auth_hmac(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);
--
2.17.1
PATCH v2 1/1 crypto/openssl: fix HMAC output length
In reply to Kai JiThis patch sets the max length of dst in OpenSSL 3.0 lib EVP MAC final routine to ensure enough space for the result.
--- drivers/crypto/openssl/rte_openssl_pmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/crypto/openssl/rte_openssl_pmd.c +1 -1
@@ -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);
Signature · 1 line
2.17.1
Akhil Goyal
AppliedRE: [EXT] [dpdk-dev v2] crypto/openssl: fix HMAC output length
Quoted 4 lines
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")
Quoted 3 lines
Signed-off-by Kai Ji <[email protected]>Acked-by Fan Zhang <[email protected]>
Applied to dpdk-next-crypto
Thanks.