[1/3] examples/fips_validation: fix TDES interim callback

Message ID 1591883057-11008-1-git-send-email-marchana@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers
Series [1/3] examples/fips_validation: fix TDES interim callback |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-nxp-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS
ci/Intel-compilation success Compilation OK

Commit Message

Archana Muniganti June 11, 2020, 1:44 p.m. UTC
  Fix missing callback registration and the incorrect
callback definition for interim NK_STR. The callback
should compare input key against the interim.

Fixes: 527cbf3d5ee3 ("examples/fips_validation: support TDES parsing")

Signed-off-by: Archana Muniganti <marchana@marvell.com>
---
 examples/fips_validation/fips_validation_tdes.c | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)
  

Comments

Akhil Goyal July 2, 2020, 6:53 p.m. UTC | #1
Hi Marko/Fan,

Could you please review this series?

> Subject: [PATCH 1/3] examples/fips_validation: fix TDES interim callback
> 
> Fix missing callback registration and the incorrect
> callback definition for interim NK_STR. The callback
> should compare input key against the interim.
> 
> Fixes: 527cbf3d5ee3 ("examples/fips_validation: support TDES parsing")
> 
> Signed-off-by: Archana Muniganti <marchana@marvell.com>

-Akhil
  
Thomas Monjalon July 12, 2020, 11:39 p.m. UTC | #2
02/07/2020 20:53, Akhil Goyal:
> Hi Marko/Fan,
> 
> Could you please review this series?

What happens? Nobody to review this?

> > Subject: [PATCH 1/3] examples/fips_validation: fix TDES interim callback
> > 
> > Fix missing callback registration and the incorrect
> > callback definition for interim NK_STR. The callback
> > should compare input key against the interim.
> > 
> > Fixes: 527cbf3d5ee3 ("examples/fips_validation: support TDES parsing")
> > 
> > Signed-off-by: Archana Muniganti <marchana@marvell.com>
  
Akhil Goyal July 15, 2020, 8 p.m. UTC | #3
> 02/07/2020 20:53, Akhil Goyal:
> > Hi Marko/Fan,
> >
> > Could you please review this series?
> 
> What happens? Nobody to review this?
> 
> > > Subject: [PATCH 1/3] examples/fips_validation: fix TDES interim callback
> > >
> > > Fix missing callback registration and the incorrect
> > > callback definition for interim NK_STR. The callback
> > > should compare input key against the interim.
> > >
> > > Fixes: 527cbf3d5ee3 ("examples/fips_validation: support TDES parsing")
> > >
> > > Signed-off-by: Archana Muniganti <marchana@marvell.com>
> 
> 
Cc: stable@dpdk.org added in all the commit messages of this patchset.

I believe Marvell people can take over the maintenance of this app.
Intel does not look interested maintaining this app.

Applied to dpdk-next-crypto without review, as it is pending for review for more than 5 weeks.

Thanks.
  

Patch

diff --git a/examples/fips_validation/fips_validation_tdes.c b/examples/fips_validation/fips_validation_tdes.c
index 84dd288..a1ddd57 100644
--- a/examples/fips_validation/fips_validation_tdes.c
+++ b/examples/fips_validation/fips_validation_tdes.c
@@ -59,9 +59,7 @@  struct {
 parse_tdes_uint8_hex_str(const char *key, char *src, struct fips_val *val);
 
 static int
-parse_tdes_interim(const char *key,
-		__rte_unused char *text,
-		struct fips_val *val);
+parse_tdes_interim(const char *key, char *text, struct fips_val *val);
 
 struct fips_test_callback tdes_tests_vectors[] = {
 		{KEYS_STR, parse_tdes_uint8_hex_str, &vec.cipher_auth.key},
@@ -77,6 +75,7 @@  struct fips_test_callback tdes_tests_vectors[] = {
 struct fips_test_callback tdes_tests_interim_vectors[] = {
 		{ENC_STR, parse_tdes_interim, NULL},
 		{DEC_STR, parse_tdes_interim, NULL},
+		{NK_STR, parse_tdes_interim, NULL},
 		{NULL, NULL, NULL} /**< end pointer */
 };
 
@@ -94,21 +93,23 @@  struct fips_test_callback tdes_writeback_callbacks[] = {
 };
 
 static int
-parse_tdes_interim(const char *key,
-		__rte_unused char *text,
+parse_tdes_interim(const char *key, char *text,
 		__rte_unused struct fips_val *val)
 {
 	if (strstr(key, ENC_STR))
 		info.op = FIPS_TEST_ENC_AUTH_GEN;
 	else if (strstr(key, DEC_STR))
 		info.op = FIPS_TEST_DEC_AUTH_VERIF;
-	else if (strstr(NK_STR, "NumKeys = 1"))
-		info.interim_info.tdes_data.nb_keys = 1;
-	else if (strstr(NK_STR, "NumKeys = 2"))
-		info.interim_info.tdes_data.nb_keys = 2;
-	else if (strstr(NK_STR, "NumKeys = 3"))
-		info.interim_info.tdes_data.nb_keys = 3;
-	else
+	else if (strstr(key, NK_STR)) {
+		if (strcmp(text, "NumKeys = 1") == 0)
+			info.interim_info.tdes_data.nb_keys = 1;
+		else if (strcmp(text, "NumKeys = 2") == 0)
+			info.interim_info.tdes_data.nb_keys = 2;
+		else if (strcmp(text, "NumKeys = 3") == 0)
+			info.interim_info.tdes_data.nb_keys = 3;
+		else
+			return -EINVAL;
+	} else
 		return -EINVAL;
 
 	return 0;