DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev v1] crypto/openssl: fix of dstlen passed in HMAC
@ 2022-07-11 17:08 Kai Ji
  2022-07-19  9:49 ` Zhang, Roy Fan
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Kai Ji @ 2022-07-11 17:08 UTC (permalink / raw)
  To: dev; +Cc: gakhil, Kai Ji

This fix of dstlen passed in OpenSSL 3.0 lib EVP MAC final routine.

Fixes: 75adf1eae44f ("crypto/openssl: update HMAC routine with 3.0 EVP API")

Signed-off-by: Kai Ji <kai.ji@intel.com>
---
 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 e01dacc98d..5658b9db66 100644
--- a/drivers/crypto/openssl/rte_openssl_pmd.c
+++ b/drivers/crypto/openssl/rte_openssl_pmd.c
@@ -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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [dpdk-dev v1] crypto/openssl: fix of dstlen passed in HMAC
  2022-07-11 17:08 [dpdk-dev v1] crypto/openssl: fix of dstlen passed in HMAC Kai Ji
@ 2022-07-19  9:49 ` Zhang, Roy Fan
  2022-08-26  8:55 ` [EXT] " Akhil Goyal
  2022-08-31 15:09 ` [dpdk-dev v2] crypto/openssl: fix HMAC output length Kai Ji
  2 siblings, 0 replies; 5+ messages in thread
From: Zhang, Roy Fan @ 2022-07-19  9:49 UTC (permalink / raw)
  To: Ji, Kai, dev; +Cc: gakhil, Ji, Kai

> -----Original Message-----
> From: Kai Ji <kai.ji@intel.com>
> Sent: Monday, July 11, 2022 6:08 PM
> To: dev@dpdk.org
> Cc: gakhil@marvell.com; Ji, Kai <kai.ji@intel.com>
> Subject: [dpdk-dev v1] crypto/openssl: fix of dstlen passed in HMAC
> 
> This fix of dstlen passed in OpenSSL 3.0 lib EVP MAC final routine.
> 
> Fixes: 75adf1eae44f ("crypto/openssl: update HMAC routine with 3.0 EVP
> API")
> 
> Signed-off-by: Kai Ji <kai.ji@intel.com>
> ---
>  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 e01dacc98d..5658b9db66 100644
> --- a/drivers/crypto/openssl/rte_openssl_pmd.c
> +++ b/drivers/crypto/openssl/rte_openssl_pmd.c
> @@ -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
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [EXT] [dpdk-dev v1] crypto/openssl: fix of dstlen passed in HMAC
  2022-07-11 17:08 [dpdk-dev v1] crypto/openssl: fix of dstlen passed in HMAC Kai Ji
  2022-07-19  9:49 ` Zhang, Roy Fan
@ 2022-08-26  8:55 ` Akhil Goyal
  2022-08-31 15:09 ` [dpdk-dev v2] crypto/openssl: fix HMAC output length Kai Ji
  2 siblings, 0 replies; 5+ messages in thread
From: Akhil Goyal @ 2022-08-26  8:55 UTC (permalink / raw)
  To: Kai Ji, dev

> Subject: [EXT] [dpdk-dev v1] crypto/openssl: fix of dstlen passed in HMAC
> 
Title can be reworded
Crypto/openssl: fix HMAC output length

> 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.

> 
> Fixes: 75adf1eae44f ("crypto/openssl: update HMAC routine with 3.0 EVP API")
> 
> Signed-off-by: Kai Ji <kai.ji@intel.com>
> ---
>  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 e01dacc98d..5658b9db66 100644
> --- a/drivers/crypto/openssl/rte_openssl_pmd.c
> +++ b/drivers/crypto/openssl/rte_openssl_pmd.c
> @@ -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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [dpdk-dev v2] crypto/openssl: fix HMAC output length
  2022-07-11 17:08 [dpdk-dev v1] crypto/openssl: fix of dstlen passed in HMAC Kai Ji
  2022-07-19  9:49 ` Zhang, Roy Fan
  2022-08-26  8:55 ` [EXT] " Akhil Goyal
@ 2022-08-31 15:09 ` Kai Ji
  2022-09-22 16:07   ` [EXT] " Akhil Goyal
  2 siblings, 1 reply; 5+ messages in thread
From: Kai Ji @ 2022-08-31 15:09 UTC (permalink / raw)
  To: dev; +Cc: gakhil, Kai Ji

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")

Signed-off-by: Kai Ji <kai.ji@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
---
 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 392b546a63..a078038651 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);
-- 
2.17.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [EXT] [dpdk-dev v2] crypto/openssl: fix HMAC output length
  2022-08-31 15:09 ` [dpdk-dev v2] crypto/openssl: fix HMAC output length Kai Ji
@ 2022-09-22 16:07   ` Akhil Goyal
  0 siblings, 0 replies; 5+ messages in thread
From: Akhil Goyal @ 2022-09-22 16:07 UTC (permalink / raw)
  To: Kai Ji, dev; +Cc: stable

> 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 <kai.ji@intel.com>
> Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Applied to dpdk-next-crypto

Thanks.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-09-22 16:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-11 17:08 [dpdk-dev v1] crypto/openssl: fix of dstlen passed in HMAC Kai Ji
2022-07-19  9:49 ` Zhang, Roy Fan
2022-08-26  8:55 ` [EXT] " Akhil Goyal
2022-08-31 15:09 ` [dpdk-dev v2] crypto/openssl: fix HMAC output length Kai Ji
2022-09-22 16:07   ` [EXT] " Akhil Goyal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).