patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH] test/crypto: fix output buffer length
@ 2021-11-12  7:53 Gagandeep Singh
  2021-11-16  7:26 ` [EXT] " Akhil Goyal
  0 siblings, 1 reply; 2+ messages in thread
From: Gagandeep Singh @ 2021-11-12  7:53 UTC (permalink / raw)
  To: gakhil, dev; +Cc: Gagandeep Singh, stable

Input buffer length is getting appended with
padding length when the test case is encrypted
digest, but output buffer length is appended
with padding length for all the cases.

This patch fixes the output buffer length
by appending the padding length only when the
test case is of encrypted digest type.

Fixes: 6356c28642a6 ("test/crypto: add cases for block cipher encrypted digest")
Cc: stable@dpdk.org

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
---
 app/test/test_cryptodev_blockcipher.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/app/test/test_cryptodev_blockcipher.c b/app/test/test_cryptodev_blockcipher.c
index 3cdb2c96e8..5688a45377 100644
--- a/app/test/test_cryptodev_blockcipher.c
+++ b/app/test/test_cryptodev_blockcipher.c
@@ -266,7 +266,10 @@ test_blockcipher_one_case(const struct blockcipher_test_case *t,
 		}
 		memset(obuf->buf_addr, dst_pattern, obuf->buf_len);
 
-		buf_p = rte_pktmbuf_append(obuf, buf_len + pad_len);
+		if (t->op_mask & BLOCKCIPHER_TEST_OP_DIGEST_ENCRYPTED)
+			buf_p = rte_pktmbuf_append(obuf, buf_len + pad_len);
+		else
+			buf_p = rte_pktmbuf_append(obuf, buf_len);
 		if (!buf_p) {
 			snprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN, "line %u "
 				"FAILED: %s", __LINE__,
-- 
2.25.1


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

* RE: [EXT] [PATCH] test/crypto: fix output buffer length
  2021-11-12  7:53 [PATCH] test/crypto: fix output buffer length Gagandeep Singh
@ 2021-11-16  7:26 ` Akhil Goyal
  0 siblings, 0 replies; 2+ messages in thread
From: Akhil Goyal @ 2021-11-16  7:26 UTC (permalink / raw)
  To: Gagandeep Singh, dev; +Cc: stable

> Input buffer length is getting appended with
> padding length when the test case is encrypted
> digest, but output buffer length is appended
> with padding length for all the cases.
> 
> This patch fixes the output buffer length
> by appending the padding length only when the
> test case is of encrypted digest type.
> 
> Fixes: 6356c28642a6 ("test/crypto: add cases for block cipher encrypted
> digest")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>

Applied to dpdk-next-crypto
Thanks.

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

end of thread, other threads:[~2021-11-16  7:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-12  7:53 [PATCH] test/crypto: fix output buffer length Gagandeep Singh
2021-11-16  7:26 ` [EXT] " Akhil Goyal

patches for DPDK stable branches

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ http://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git