[dpdk-stable] patch 'examples/fips_validation: fix parsing of TDES vectors' has been queued to stable release 19.11.4

luca.boccassi at gmail.com luca.boccassi at gmail.com
Fri Jul 24 13:59:48 CEST 2020


Hi,

FYI, your patch has been queued to stable release 19.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 07/26/20. 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.

Thanks.

Luca Boccassi

---
>From 215e6ceee6a33978b52b1a4d5cf1c4bd12d3389f Mon Sep 17 00:00:00 2001
From: Ayuj Verma <ayverma at marvell.com>
Date: Thu, 11 Jun 2020 19:14:16 +0530
Subject: [PATCH] examples/fips_validation: fix parsing of TDES vectors

[ upstream commit 32440cdf2af9ad38fd32a533f51a32da92345007 ]

Processing of test vector for COUNT = 0 is getting skipped, as
some of the NIST TDES files doesn't have an empty line after
[ENCRYPT]/[DECRYPT] and thus treated as an interim block.

Parse function now identifies such blocks, separates out interim
and test vector data, and then parses each with their respective
callbacks.

Fixes: 3d0fad56b74a ("examples/fips_validation: add crypto FIPS application")

Signed-off-by: Archana Muniganti <marchana at marvell.com>
Signed-off-by: Ayuj Verma <ayverma at marvell.com>
---
 examples/fips_validation/fips_validation.c | 21 +++++++++++++++------
 examples/fips_validation/fips_validation.h |  1 +
 2 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/examples/fips_validation/fips_validation.c b/examples/fips_validation/fips_validation.c
index b79a095ac..bffc682de 100644
--- a/examples/fips_validation/fips_validation.c
+++ b/examples/fips_validation/fips_validation.c
@@ -334,11 +334,13 @@ int
 fips_test_parse_one_case(void)
 {
 	uint32_t i, j = 0;
-	uint32_t is_interim = 0;
+	uint32_t is_interim;
+	uint32_t interim_cnt = 0;
 	int ret;
 
 	if (info.interim_callbacks) {
 		for (i = 0; i < info.nb_vec_lines; i++) {
+			is_interim = 0;
 			for (j = 0; info.interim_callbacks[j].key != NULL; j++)
 				if (strstr(info.vec[i],
 					info.interim_callbacks[j].key)) {
@@ -351,17 +353,24 @@ fips_test_parse_one_case(void)
 					if (ret < 0)
 						return ret;
 				}
+
+			if (is_interim)
+				interim_cnt += 1;
 		}
 	}
 
-	if (is_interim) {
-		for (i = 0; i < info.nb_vec_lines; i++)
+	info.vec_start_off = interim_cnt;
+
+	if (interim_cnt) {
+		for (i = 0; i < interim_cnt; i++)
 			fprintf(info.fp_wr, "%s\n", info.vec[i]);
 		fprintf(info.fp_wr, "\n");
-		return 1;
+
+		if (info.nb_vec_lines == interim_cnt)
+			return 1;
 	}
 
-	for (i = 0; i < info.nb_vec_lines; i++) {
+	for (i = info.vec_start_off; i < info.nb_vec_lines; i++) {
 		for (j = 0; info.callbacks[j].key != NULL; j++)
 			if (strstr(info.vec[i], info.callbacks[j].key)) {
 				ret = info.callbacks[j].cb(
@@ -381,7 +390,7 @@ fips_test_write_one_case(void)
 {
 	uint32_t i;
 
-	for (i = 0; i < info.nb_vec_lines; i++)
+	for (i = info.vec_start_off; i < info.nb_vec_lines; i++)
 		fprintf(info.fp_wr, "%s\n", info.vec[i]);
 }
 
diff --git a/examples/fips_validation/fips_validation.h b/examples/fips_validation/fips_validation.h
index d487fb005..d51736529 100644
--- a/examples/fips_validation/fips_validation.h
+++ b/examples/fips_validation/fips_validation.h
@@ -160,6 +160,7 @@ struct fips_test_interim_info {
 	enum fips_test_algorithms algo;
 	char *one_line_text;
 	char *vec[MAX_LINE_PER_VECTOR];
+	uint32_t vec_start_off;
 	uint32_t nb_vec_lines;
 	char device_name[MAX_STRING_SIZE];
 	char file_name[MAX_STRING_SIZE];
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:54.360281944 +0100
+++ 0150-examples-fips_validation-fix-parsing-of-TDES-vectors.patch	2020-07-24 12:53:48.511010633 +0100
@@ -1,8 +1,10 @@
-From 32440cdf2af9ad38fd32a533f51a32da92345007 Mon Sep 17 00:00:00 2001
+From 215e6ceee6a33978b52b1a4d5cf1c4bd12d3389f Mon Sep 17 00:00:00 2001
 From: Ayuj Verma <ayverma at marvell.com>
 Date: Thu, 11 Jun 2020 19:14:16 +0530
 Subject: [PATCH] examples/fips_validation: fix parsing of TDES vectors
 
+[ upstream commit 32440cdf2af9ad38fd32a533f51a32da92345007 ]
+
 Processing of test vector for COUNT = 0 is getting skipped, as
 some of the NIST TDES files doesn't have an empty line after
 [ENCRYPT]/[DECRYPT] and thus treated as an interim block.
@@ -12,7 +14,6 @@
 callbacks.
 
 Fixes: 3d0fad56b74a ("examples/fips_validation: add crypto FIPS application")
-Cc: stable at dpdk.org
 
 Signed-off-by: Archana Muniganti <marchana at marvell.com>
 Signed-off-by: Ayuj Verma <ayverma at marvell.com>
@@ -22,10 +23,10 @@
  2 files changed, 16 insertions(+), 6 deletions(-)
 
 diff --git a/examples/fips_validation/fips_validation.c b/examples/fips_validation/fips_validation.c
-index a34e34d25..3aaec20fb 100644
+index b79a095ac..bffc682de 100644
 --- a/examples/fips_validation/fips_validation.c
 +++ b/examples/fips_validation/fips_validation.c
-@@ -340,11 +340,13 @@ int
+@@ -334,11 +334,13 @@ int
  fips_test_parse_one_case(void)
  {
  	uint32_t i, j = 0;
@@ -40,7 +41,7 @@
  			for (j = 0; info.interim_callbacks[j].key != NULL; j++)
  				if (strstr(info.vec[i],
  					info.interim_callbacks[j].key)) {
-@@ -357,17 +359,24 @@ fips_test_parse_one_case(void)
+@@ -351,17 +353,24 @@ fips_test_parse_one_case(void)
  					if (ret < 0)
  						return ret;
  				}
@@ -69,7 +70,7 @@
  		for (j = 0; info.callbacks[j].key != NULL; j++)
  			if (strstr(info.vec[i], info.callbacks[j].key)) {
  				ret = info.callbacks[j].cb(
-@@ -387,7 +396,7 @@ fips_test_write_one_case(void)
+@@ -381,7 +390,7 @@ fips_test_write_one_case(void)
  {
  	uint32_t i;
  
@@ -79,10 +80,10 @@
  }
  
 diff --git a/examples/fips_validation/fips_validation.h b/examples/fips_validation/fips_validation.h
-index 5aee955c1..75fa555fa 100644
+index d487fb005..d51736529 100644
 --- a/examples/fips_validation/fips_validation.h
 +++ b/examples/fips_validation/fips_validation.h
-@@ -161,6 +161,7 @@ struct fips_test_interim_info {
+@@ -160,6 +160,7 @@ struct fips_test_interim_info {
  	enum fips_test_algorithms algo;
  	char *one_line_text;
  	char *vec[MAX_LINE_PER_VECTOR];


More information about the stable mailing list