[dpdk-dev] [PATCH 8/8] examples/fips_validation: fix plain text overwrite

michaelsh at marvell.com michaelsh at marvell.com
Thu Sep 19 14:12:32 CEST 2019


From: Michael Shamis <michaelsh at marvell.com>

fix erroneous overwrite of PLAINTEXT-line after [DECRYPT] tag

Signed-off-by: Michael Shamis <michaelsh at marvell.com>
---
 examples/fips_validation/fips_validation.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/examples/fips_validation/fips_validation.c b/examples/fips_validation/fips_validation.c
index 4dde482e5..3ab7f8508 100644
--- a/examples/fips_validation/fips_validation.c
+++ b/examples/fips_validation/fips_validation.c
@@ -400,10 +400,13 @@ fips_test_parse_one_case(void)
 	}
 
 	if (is_interim) {
-		for (i = 0; i < info.nb_vec_lines; i++)
-			fprintf(info.fp_wr, "%s\n", info.vec[i]);
-		fprintf(info.fp_wr, "\n");
-		return 1;
+		if (!(strstr(info.vec[0], "DECRYPT") &&
+			  info.nb_vec_lines > 1)) {
+			for (i = 0; i < info.nb_vec_lines; i++)
+				fprintf(info.fp_wr, "%s\n", info.vec[i]);
+			fprintf(info.fp_wr, "\n");
+			return 1;
+		}
 	}
 
 	for (i = 0; i < info.nb_vec_lines; i++) {
-- 
2.23.0



More information about the dev mailing list