patch 'examples/fips_validation: fix AES-XTS sequence number' has been queued to stable release 22.11.2

Xueming Li xuemingl at nvidia.com
Sun Apr 9 17:23:34 CEST 2023


Hi,

FYI, your patch has been queued to stable release 22.11.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/11/23. 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://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/903f4ee07da15770a9185c900a21b883b1ddae96

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 903f4ee07da15770a9185c900a21b883b1ddae96 Mon Sep 17 00:00:00 2001
From: Gowrishankar Muthukrishnan <gmuthukrishn at marvell.com>
Date: Tue, 28 Feb 2023 22:58:55 +0530
Subject: [PATCH] examples/fips_validation: fix AES-XTS sequence number
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit 6e27b74b0e324fb966c8d10d1006b68089c2a806 ]

Fix AES XTS test to read sequence number correctly.

Fixes: f8e431ed8f6 ("examples/fips_validation: add parsing for AES-XTS")

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn at marvell.com>
Acked-by: Brian Dooley <brian.dooley at intel.com>
---
 examples/fips_validation/fips_validation_xts.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/examples/fips_validation/fips_validation_xts.c b/examples/fips_validation/fips_validation_xts.c
index 531e3c688e..530df78ab4 100644
--- a/examples/fips_validation/fips_validation_xts.c
+++ b/examples/fips_validation/fips_validation_xts.c
@@ -34,6 +34,7 @@
 #define DATAUNITLEN_JSON_STR	"dataUnitLen"
 #define PAYLOADLEN_JSON_STR	"payloadLen"
 #define TWEAKVALUE_JSON_STR	"tweakValue"
+#define SEQNUMBER_JSON_STR	"sequenceNumber"
 #define PT_JSON_STR	"pt"
 #define CT_JSON_STR	"ct"
 
@@ -95,14 +96,17 @@ parser_xts_read_keylen(const char *key, char *src, struct fips_val *val)
 static int
 parser_xts_read_tweakval(const char *key, char *src, struct fips_val *val)
 {
+	char num_str[4] = {0};
 	int ret;
 
-	if (info.interim_info.xts_data.tweak_mode == XTS_TWEAK_MODE_HEX)
+	if (info.interim_info.xts_data.tweak_mode == XTS_TWEAK_MODE_HEX) {
 		ret = parse_uint8_hex_str(key, src, val);
-	else if (info.interim_info.xts_data.tweak_mode == XTS_TWEAK_MODE_NUMBER)
-		ret = parser_read_uint32_bit_val(key, src, val);
-	else
+	} else if (info.interim_info.xts_data.tweak_mode == XTS_TWEAK_MODE_NUMBER) {
+		snprintf(num_str, RTE_DIM(num_str), "%x", atoi(src));
+		ret = parse_uint8_hex_str(key, num_str, val);
+	} else {
 		ret = -1;
+	}
 
 	return ret;
 }
@@ -122,6 +126,7 @@ struct fips_test_callback xts_interim_json_vectors[] = {
 struct fips_test_callback xts_enc_json_vectors[] = {
 		{KEY_JSON_STR, parse_uint8_known_len_hex_str, &vec.cipher_auth.key},
 		{TWEAKVALUE_JSON_STR, parser_xts_read_tweakval, &vec.iv},
+		{SEQNUMBER_JSON_STR, parser_xts_read_tweakval, &vec.iv},
 		{PT_JSON_STR, parse_uint8_hex_str, &vec.pt},
 		{NULL, NULL, NULL} /**< end pointer */
 };
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-04-09 21:45:39.484726000 +0800
+++ 0026-examples-fips_validation-fix-AES-XTS-sequence-number.patch	2023-04-09 21:45:38.609042200 +0800
@@ -1 +1 @@
-From 6e27b74b0e324fb966c8d10d1006b68089c2a806 Mon Sep 17 00:00:00 2001
+From 903f4ee07da15770a9185c900a21b883b1ddae96 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 6e27b74b0e324fb966c8d10d1006b68089c2a806 ]
@@ -9 +11,0 @@
-Cc: stable at dpdk.org


More information about the stable mailing list