DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] test/crypto: fix the bug of wrong debug messages
@ 2022-07-26  3:38 Sunyang Wu
  2022-08-28  8:58 ` [EXT] " Akhil Goyal
  0 siblings, 1 reply; 3+ messages in thread
From: Sunyang Wu @ 2022-07-26  3:38 UTC (permalink / raw)
  To: dev; +Cc: gakhil, roy.fan.zhang, stable

When the queue_ops_rsa_enc_dec function is called, the plaintext will
be printed twice instead of both plaintext and ciphertext. When the
create_aead_operation function is called, the contents of iv and aad
will be printed incorrectly. This patch fixes the issues above.

Fixes: 77a217a19bb7 ("test/crypto: add AES-CCM tests")
       5ae36995f10f ("test/crypto: move RSA enqueue/
	                  dequeue into functions")
Cc: stable@dpdk.org

Signed-off-by: Sunyang Wu <sunyang.wu@jaguarmicro.com>
Reviewed-by: Joey Xing <joey.xing@jaguarmicro.com>
Reviewed-by: Qingmin Liu <qingmin.liu@jaguarmicro.com>
Reviewed-by: Lei Cai <lei.cai@jaguarmicro.com>
---
 app/test/test_cryptodev.c      | 4 ++--
 app/test/test_cryptodev_asym.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index 69a0301de0..54ce306b42 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -8287,7 +8287,7 @@ create_aead_operation(enum rte_crypto_aead_operation op,
 				rte_pktmbuf_iova(ut_params->ibuf);
 		/* Copy AAD 18 bytes after the AAD pointer, according to the API */
 		memcpy(sym_op->aead.aad.data + 18, tdata->aad.data, tdata->aad.len);
-		debug_hexdump(stdout, "aad:", sym_op->aead.aad.data,
+		debug_hexdump(stdout, "aad:", sym_op->aead.aad.data + 18,
 			tdata->aad.len);
 
 		/* Append IV at the end of the crypto operation*/
@@ -8296,7 +8296,7 @@ create_aead_operation(enum rte_crypto_aead_operation op,
 
 		/* Copy IV 1 byte after the IV pointer, according to the API */
 		rte_memcpy(iv_ptr + 1, tdata->iv.data, tdata->iv.len);
-		debug_hexdump(stdout, "iv:", iv_ptr,
+		debug_hexdump(stdout, "iv:", iv_ptr + 1,
 			tdata->iv.len);
 	} else {
 		aad_pad_len = RTE_ALIGN_CEIL(tdata->aad.len, 16);
diff --git a/app/test/test_cryptodev_asym.c b/app/test/test_cryptodev_asym.c
index fc1a727472..9da54530e5 100644
--- a/app/test/test_cryptodev_asym.c
+++ b/app/test/test_cryptodev_asym.c
@@ -208,8 +208,8 @@ queue_ops_rsa_enc_dec(void *sess)
 		status = TEST_FAILED;
 		goto error_exit;
 	}
-	debug_hexdump(stdout, "encrypted message", asym_op->rsa.message.data,
-		      asym_op->rsa.message.length);
+	debug_hexdump(stdout, "encrypted message", asym_op->rsa.cipher.data,
+		      asym_op->rsa.cipher.length);
 
 	/* Use the resulted output as decryption Input vector*/
 	asym_op = result_op->asym;
-- 
2.19.0.rc0.windows.1


^ permalink raw reply	[flat|nested] 3+ messages in thread
* RE: [EXT] [PATCH] test/crypto: fix the bug of wrong debug messages
@ 2022-09-01  8:02 Sunyang Wu
  0 siblings, 0 replies; 3+ messages in thread
From: Sunyang Wu @ 2022-09-01  8:02 UTC (permalink / raw)
  To: Akhil Goyal, dev; +Cc: roy.fan.zhang, stable

Thank you for your reference! 
I hope this email finds you well!

Best wishes,
Sunyang

-----Original Message-----
From: Akhil Goyal <gakhil@marvell.com> 
Sent: Sunday, August 28, 16:58 PM
To: Sunyang Wu <sunyang.wu@jaguarmicro.com>; dev@dpdk.org
Cc: roy.fan.zhang@intel.com; stable@dpdk.org
Subject: RE: [EXT] [PATCH] test/crypto: fix the bug of wrong debug messages

> When the queue_ops_rsa_enc_dec function is called, the plaintext will 
> be printed twice instead of both plaintext and ciphertext. When the 
> create_aead_operation function is called, the contents of iv and aad 
> will be printed incorrectly. This patch fixes the issues above.
> 
> Fixes: 77a217a19bb7 ("test/crypto: add AES-CCM tests")
>        5ae36995f10f ("test/crypto: move RSA enqueue/
> 	                  dequeue into functions")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Sunyang Wu <sunyang.wu@jaguarmicro.com>
> Reviewed-by: Joey Xing <joey.xing@jaguarmicro.com>
> Reviewed-by: Qingmin Liu <qingmin.liu@jaguarmicro.com>
> Reviewed-by: Lei Cai <lei.cai@jaguarmicro.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>

Applied to dpdk-next-crypto

Thanks.

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

end of thread, other threads:[~2022-09-01  8:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-26  3:38 [PATCH] test/crypto: fix the bug of wrong debug messages Sunyang Wu
2022-08-28  8:58 ` [EXT] " Akhil Goyal
2022-09-01  8:02 Sunyang Wu

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