patch 'test/crypto: skip plain text compare for null cipher' has been queued to stable release 20.11.4

Xueming Li xuemingl at nvidia.com
Sun Nov 28 15:53:35 CET 2021


Hi,

FYI, your patch has been queued to stable release 20.11.4

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/30/21. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/steevenlee/dpdk

This queued commit can be viewed at:
https://github.com/steevenlee/dpdk/commit/139df4588581128bc94f26439c56aa5ddb681d96

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 139df4588581128bc94f26439c56aa5ddb681d96 Mon Sep 17 00:00:00 2001
From: Anoob Joseph <anoobj at marvell.com>
Date: Wed, 10 Nov 2021 18:34:08 +0530
Subject: [PATCH] test/crypto: skip plain text compare for null cipher
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit 9fc69835feb33d0e155076163ecc2f5479cf1bc2 ]

NULL cipher is used for validating auth only cases. With NULL cipher,
validating plain text should not be done as the PMD is only expected
to update auth data.

Fixes: e847fc512817 ("test/crypto: add encrypted digest case for AES-CTR-CMAC")

Signed-off-by: Anoob Joseph <anoobj at marvell.com>
Acked-by: Ciara Power <ciara.power at intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch at intel.com>
---
 app/test/test_cryptodev.c | 63 ++++++++++++++++++++++-----------------
 1 file changed, 35 insertions(+), 28 deletions(-)

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index 4772eea30c..7270730145 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -6951,27 +6951,30 @@ test_mixed_auth_cipher(const struct mixed_cipher_auth_test_data *tdata,
 				tdata->digest_enc.len);
 	}
 
-	/* Validate obuf */
-	if (verify) {
-		TEST_ASSERT_BUFFERS_ARE_EQUAL_BIT(
-				plaintext,
-				tdata->plaintext.data,
-				tdata->plaintext.len_bits >> 3,
-				"Plaintext data not as expected");
-	} else {
-		TEST_ASSERT_BUFFERS_ARE_EQUAL_BIT(
-				ciphertext,
-				tdata->ciphertext.data,
-				tdata->validDataLen.len_bits,
-				"Ciphertext data not as expected");
-
+	if (!verify) {
 		TEST_ASSERT_BUFFERS_ARE_EQUAL(
 				ut_params->digest,
 				tdata->digest_enc.data,
-				DIGEST_BYTE_LENGTH_SNOW3G_UIA2,
+				tdata->digest_enc.len,
 				"Generated auth tag not as expected");
 	}
 
+	if (tdata->cipher_algo != RTE_CRYPTO_CIPHER_NULL) {
+		if (verify) {
+			TEST_ASSERT_BUFFERS_ARE_EQUAL_BIT(
+					plaintext,
+					tdata->plaintext.data,
+					tdata->plaintext.len_bits >> 3,
+					"Plaintext data not as expected");
+		} else {
+			TEST_ASSERT_BUFFERS_ARE_EQUAL_BIT(
+					ciphertext,
+					tdata->ciphertext.data,
+					tdata->validDataLen.len_bits,
+					"Ciphertext data not as expected");
+		}
+	}
+
 	TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS,
 			"crypto op processing failed");
 
@@ -7168,19 +7171,7 @@ test_mixed_auth_cipher_sgl(const struct mixed_cipher_auth_test_data *tdata,
 				tdata->digest_enc.data, tdata->digest_enc.len);
 	}
 
-	/* Validate obuf */
-	if (verify) {
-		TEST_ASSERT_BUFFERS_ARE_EQUAL_BIT(
-				plaintext,
-				tdata->plaintext.data,
-				tdata->plaintext.len_bits >> 3,
-				"Plaintext data not as expected");
-	} else {
-		TEST_ASSERT_BUFFERS_ARE_EQUAL_BIT(
-				ciphertext,
-				tdata->ciphertext.data,
-				tdata->validDataLen.len_bits,
-				"Ciphertext data not as expected");
+	if (!verify) {
 		TEST_ASSERT_BUFFERS_ARE_EQUAL(
 				digest,
 				tdata->digest_enc.data,
@@ -7188,6 +7179,22 @@ test_mixed_auth_cipher_sgl(const struct mixed_cipher_auth_test_data *tdata,
 				"Generated auth tag not as expected");
 	}
 
+	if (tdata->cipher_algo != RTE_CRYPTO_CIPHER_NULL) {
+		if (verify) {
+			TEST_ASSERT_BUFFERS_ARE_EQUAL_BIT(
+					plaintext,
+					tdata->plaintext.data,
+					tdata->plaintext.len_bits >> 3,
+					"Plaintext data not as expected");
+		} else {
+			TEST_ASSERT_BUFFERS_ARE_EQUAL_BIT(
+					ciphertext,
+					tdata->ciphertext.data,
+					tdata->validDataLen.len_bits,
+					"Ciphertext data not as expected");
+		}
+	}
+
 	TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS,
 			"crypto op processing failed");
 
-- 
2.34.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-11-28 22:41:04.990522663 +0800
+++ 0031-test-crypto-skip-plain-text-compare-for-null-cipher.patch	2021-11-28 22:41:03.253542187 +0800
@@ -1 +1 @@
-From 9fc69835feb33d0e155076163ecc2f5479cf1bc2 Mon Sep 17 00:00:00 2001
+From 139df4588581128bc94f26439c56aa5ddb681d96 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 9fc69835feb33d0e155076163ecc2f5479cf1bc2 ]
@@ -11 +13,0 @@
-Cc: stable at dpdk.org
@@ -21 +23 @@
-index 52457596e2..1b68d7c43b 100644
+index 4772eea30c..7270730145 100644
@@ -24 +26 @@
-@@ -7484,27 +7484,30 @@ test_mixed_auth_cipher(const struct mixed_cipher_auth_test_data *tdata,
+@@ -6951,27 +6951,30 @@ test_mixed_auth_cipher(const struct mixed_cipher_auth_test_data *tdata,
@@ -70 +72 @@
-@@ -7701,19 +7704,7 @@ test_mixed_auth_cipher_sgl(const struct mixed_cipher_auth_test_data *tdata,
+@@ -7168,19 +7171,7 @@ test_mixed_auth_cipher_sgl(const struct mixed_cipher_auth_test_data *tdata,
@@ -91 +93 @@
-@@ -7721,6 +7712,22 @@ test_mixed_auth_cipher_sgl(const struct mixed_cipher_auth_test_data *tdata,
+@@ -7188,6 +7179,22 @@ test_mixed_auth_cipher_sgl(const struct mixed_cipher_auth_test_data *tdata,


More information about the stable mailing list