Skip to contentSkip to conversation

examples/fips_validation: fix test output for AES GMAC decrypt

PATCH In review Gowrishankar Muthukrishnan 2 participants 2 messages Oct 17, 2022 – Oct 18, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 examples/fips_validation: fix test output for AES GMAC decrypt

AES GMAC decrypt test should output only whether test passed or failed.

---
 examples/fips_validation/fips_validation_gcm.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
examples/fips_validation/fips_validation_gcm.c +8 -3
index 1b141501f0..a80d8b3e4d 100644
@@ -330,11 +330,16 @@ parse_test_gcm_json_writeback(struct fips_val *val)
 				json_object_set_new(json_info.json_write_case, PT_JSON_STR,
 					json_string(info.one_line_text));
 			} else {
-				json_object_set_new(json_info.json_write_case, PT_JSON_STR,
-					json_string(""));
+				json_object_set_new(json_info.json_write_case, "testPassed",
+					json_true());
 			}
 		} else {
-			json_object_set_new(json_info.json_write_case, "testPassed", json_false());
+			if (!info.interim_info.gcm_data.is_gmac)
+				json_object_set_new(json_info.json_write_case, PT_JSON_STR,
+					json_string(""));
+			else
+				json_object_set_new(json_info.json_write_case, "testPassed",
+					json_false());
 		}
 	}
 
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw

Hi Gowrishankar,

Quoted 17 lines

-----Original Message-----
From: Gowrishankar Muthukrishnan <[email protected]>
Sent: Monday, October 17, 2022 9:16 AM
To: [email protected]
Cc: Anoob Joseph <[email protected]>; Dooley, Brian <[email protected]>; Akhil Goyal <[email protected]>; [email protected]; Gowrishankar Muthukrishnan <[email protected]>
Subject: [v1] examples/fips_validation: fix test output for AES GMAC decrypt

AES GMAC decrypt test should output only whether test passed or failed.

---
 examples/fips_validation/fips_validation_gcm.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

<snip>