examples/fips_validation: parse block error fix
PATCH 1/1 examples/fips_validation: parse block error fix
When parsing request files check for file type. This fix will remove dependence on command line parameter for using libjansson
--- examples/fips_validation/fips_validation.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-)
examples/fips_validation/fips_validation.c +10 -12
@@ -638,10 +638,11 @@ parse_uint8_hex_str(const char *key, char *src, struct fips_val *val)/* * Offset not applicable in case of JSON test vectors. */ -RTE_SET_USED (key); -#else - src +=strlen (key); +if (info.file_type ==FIPS_TYPE_JSON ) { +RTE_SET_USED (key); + } else#endif + src +=strlen (key); len =strlen (src) /2 ;
@@ -669,18 +670,16 @@ parse_uint8_hex_str(const char *key, char *src, struct fips_val *val)return 0 ; } -#ifdef USE_JANSSON int parser_read_uint32_val (const char *key,char *src,struct fips_val *val) { -RTE_SET_USED (key); +#ifdef USE_JANSSON +if (info.file_type ==FIPS_TYPE_JSON ) { +RTE_SET_USED (key); -return parser_read_uint32 (&val->len, src); -} -#else -int -parser_read_uint32_val (const char *key,char *src,struct fips_val *val) -{ +return parser_read_uint32 (&val->len, src); + } +# endif char *data = src +strlen (key);size_t data_len =strlen (data);int ret;
@@ -701,7 +700,6 @@ parser_read_uint32_val(const char *key, char *src, struct fips_val *val)return ret; } -#endif int parser_read_uint32_bit_val (const char *key,char *src,struct fips_val *val)
Signature · 1 line
2.25.1
Hi Brian,
Quoted 10 lines
-----Original Message-----
From: Brian Dooley <[email protected]>
Sent: Monday 24 October 2022 11:37
To: Dooley, Brian <[email protected]>
Cc: [email protected]; [email protected]; [email protected]
Subject: [PATCH v1] examples/fips_validation: parse block error fixWhen parsing request files check for file type. This fix will remove dependence on command line parameter for using libjansson
Quoted 7 lines
Fixes 0f42f3d6034c ("examples/fips_validation: share callback with multiplekeys")
Signed-off-by Brian Dooley <[email protected]>--- examples/fips_validation/fips_validation.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-)
Thanks.
Quoted 78 lines
-----Original Message-----
From: Brian Dooley <[email protected]>
Sent: Monday, October 24, 2022 4:07 PM
To: Brian Dooley <[email protected]>
Cc: [email protected]; Gowrishankar Muthukrishnan <[email protected]>; Akhil Goyal <[email protected]>
Subject: [EXT] [PATCH v1] examples/fips_validation: parse block error fixExternal Email
----------------------------------------------------------------------
When parsing request files check for file type. This fix will remove dependence on command line parameter for using libjanssonFixes 0f42f3d6034c ("examples/fips_validation: share callback with multiplekeys")
Signed-off-by Brian Dooley <[email protected]>--- examples/fips_validation/fips_validation.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-)examples/fips_validation/fips_validation.c +10
-11@@ -638,10 +638,11 @@ parse_uint8_hex_str(const char *key, char *src, struct fips_val *val)/* * Offset not applicable in case of JSON test vectors. */ -RTE_SET_USED (key ); -#else - src +=strlen (key); +if (info.file_type ==FIPS_TYPE_JSON ) { +RTE_SET_USED (key); + } else#endif + src +=strlen (key); len =strlen (src) /2 ;@@ -669,18 +670,16 @@ parse_uint8_hex_str(const char *key, char *src, struct fips_val *val)return 0 ; } -#ifdef USE_JANSSON int parser_read_uint32_val (const char *key,char *src,struct fips_val *val) { -RTE_SET_USED (key); +#ifdef USE_JANSSON +if (info.file_type ==FIPS_TYPE_JSON ) { +RTE_SET_USED (key); -return parser_read_uint32 (&val->len, src); -} -#else -int -parser_read_uint32_val(const char *key, char *src, struct fips_val *val) -{ +return parser_read_uint32 (&val->len, src); + } +# endif char *data = src +strlen (key);size_t data_len =strlen (data);int ret;@@ -701,7 +700,6 @@ parser_read_uint32_val(const char *key, char *src, struct fips_val *val)return ret; } -#endif int
parser_read_uint32_bit_val(const char *key, char *src, struct fips_val *val)
--
2.25.1
Akhil Goyal
AppliedQuoted 10 lines
Quoted 8 lines
When parsing request files check for file type. This fix will remove dependence on command line parameter for using libjansson
Fixes 0f42f3d6034c ("examples/fips_validation: share callback with multiplekeys")
Signed-off-by Brian Dooley <[email protected]>---
Applied to dpdk-next-crypto
Thanks.