Skip to contentSkip to conversation

examples/fips_validation: fix digest length in AES GCM

PATCH Applied Samina Arshad 4 participants 4 messages Jun 28, 2023 – Jul 4, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 examples/fips_validation: fix digest length in AES GCM

For AES GCM non JSON decrypt test cases the digest length is being set incorrectly.The digest length is not being cleared after test cases, causing an issue when running tests individually without the --path-is-folder flag. This fix adds the digest length correctly to the decrypt cases and clears the digest length after each test file.

Fixes 4aaad2995e13 ("examples/fips_validation: support GCM parsing")
---
 examples/fips_validation/main.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
examples/fips_validation/main.c +3 -2
index 4237224d9d..6518c959c4 100644
@@ -834,7 +834,7 @@ prepare_aead_op(void)
 			RTE_LOG(ERR, USER1, "Not enough memory\n");
 			return -ENOMEM;
 		}
-		env.digest_len = vec.cipher_auth.digest.len;
+		env.digest_len = vec.aead.digest.len;
 
 		sym->aead.data.length = vec.pt.len;
 		sym->aead.digest.data = env.digest;
@@ -843,7 +843,7 @@ prepare_aead_op(void)
 		ret = prepare_data_mbufs(&vec.ct);
 		if (ret < 0)
 			return ret;
-
+		env.digest_len = vec.aead.digest.len;
 		sym->aead.data.length = vec.ct.len;
 		sym->aead.digest.data = vec.aead.digest.val;
 		sym->aead.digest.phys_addr = rte_malloc_virt2iova(
@@ -2618,6 +2618,7 @@ fips_test_one_file(void)
 	if (env.digest) {
 		rte_free(env.digest);
 		env.digest = NULL;
+		env.digest_len = 0;
 	}
 	rte_pktmbuf_free(env.mbuf);
 
Signature · 1 line
2.25.1
Acked-by on v1 1/1
#1 lore raw

Hey Samina,

Quoted 54 lines

-----Original Message-----
From: Arshad, Samina <[email protected]>
Sent: Wednesday, June 28, 2023 3:39 PM
To: Dooley, Brian <[email protected]>; Gowrishankar Muthukrishnan <[email protected]>
Cc: [email protected]; [email protected]; Arshad, Samina <[email protected]>; Kovacevic, Marko <[email protected]>
Subject: [PATCH v1] examples/fips_validation: fix digest length in AES GCM

For AES GCM non JSON decrypt test cases the digest length is being set incorrectly.The digest length is not being cleared after test cases, causing an issue when running tests individually without the --path-is-folder flag. This fix adds the digest length correctly to the decrypt cases and clears the digest length after each test file.

Fixes 4aaad2995e13 ("examples/fips_validation: support GCM parsing")
---
 examples/fips_validation/main.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
(quoted diff) +0 -0

b/examples/fips_validation/main.c index 4237224d9d..6518c959c4 100644

examples/fips_validation/main.c +2 -2
@@ -834,7 +834,7 @@ prepare_aead_op(void)
 			RTE_LOG(ERR, USER1, "Not enough memory\n");
 			return -ENOMEM;
 		}
-		env.digest_len = vec.cipher_auth.digest.len;
+		env.digest_len = vec.aead.digest.len;
 
 		sym->aead.data.length = vec.pt.len;
 		sym->aead.digest.data = env.digest;
@@ -843,7 +843,7 @@ prepare_aead_op(void)
 		ret = prepare_data_mbufs(&vec.ct);
 		if (ret < 0)
 			return ret;
-
+		env.digest_len = vec.aead.digest.len;
 		sym->aead.data.length = vec.ct.len;
 		sym->aead.digest.data = vec.aead.digest.val;
 		sym->aead.digest.phys_addr = rte_malloc_virt2iova( @@ -

2618,6 +2618,7 @@ fips_test_one_file(void)

examples/fips_validation/main.c +1 -1
 	if (env.digest) {
 		rte_free(env.digest);
 		env.digest = NULL;
+		env.digest_len = 0;
 	}
 	rte_pktmbuf_free(env.mbuf);
 
--
Quoted 1 line

2.25.1