From: Michael Shamis <michae...@marvell.com>

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

Signed-off-by: Michael Shamis <michae...@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 fcc0c985d..4d0f240b8 100644
--- a/examples/fips_validation/fips_validation.c
+++ b/examples/fips_validation/fips_validation.c
@@ -401,10 +401,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

Reply via email to