[v1,10/10] examples/fips_validation: add extra space in JSON buffer

Message ID 311e28cd27874f1d75c36b5825425e6f84889d64.1675693844.git.gmuthukrishn@marvell.com (mailing list archive)
State Changes Requested, archived
Delegated to: akhil goyal
Headers
Series fips_validation application improvements |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/github-robot: build fail github build: failed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/Intel-compilation fail Compilation issues
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-abi-testing warning Testing issues
ci/iol-aarch64-compile-testing fail Testing issues
ci/iol-testing warning Testing issues
ci/iol-x86_64-unit-testing success Testing PASS

Commit Message

Gowrishankar Muthukrishnan Feb. 6, 2023, 2:46 p.m. UTC
  Current test buffer to copy input data of maximum possible length
did not account NULL character, due to which a last input character
is always ignored and it causes tests like RSA SIGVER for modulo
of 4096 bits to fail. This patch fixes it.

Fixes: 0b65d54f3a4 ("examples/fips_validation: fix JSON buffer size")

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
---
 examples/fips_validation/fips_validation.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Brian Dooley Feb. 27, 2023, 9:27 a.m. UTC | #1
Hi Gowrishankar,

> -----Original Message-----
> From: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
> Sent: Monday 6 February 2023 14:46
> To: dev@dpdk.org
> Cc: Anoob Joseph <anoobj@marvell.com>; jerinj@marvell.com; Akhil Goyal
> <gakhil@marvell.com>; Dooley, Brian <brian.dooley@intel.com>; Gowrishankar
> Muthukrishnan <gmuthukrishn@marvell.com>
> Subject: [v1, 10/10] examples/fips_validation: add extra space in JSON buffer
> 
> Current test buffer to copy input data of maximum possible length did not
> account NULL character, due to which a last input character is always ignored
> and it causes tests like RSA SIGVER for modulo of 4096 bits to fail. This patch
> fixes it.
> 
> Fixes: 0b65d54f3a4 ("examples/fips_validation: fix JSON buffer size")
> 
> Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
> ---
>  examples/fips_validation/fips_validation.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/examples/fips_validation/fips_validation.h
> b/examples/fips_validation/fips_validation.h
> index c4988053c1..abc1d64742 100644
> --- a/examples/fips_validation/fips_validation.h
> +++ b/examples/fips_validation/fips_validation.h
> @@ -247,7 +247,7 @@ struct ecdsa_interim_data {
>   * Esp, in asym op, modulo bits decide char buffer size.
>   * max = (modulo / 4)
>   */
> -#define FIPS_TEST_JSON_BUF_LEN (4096 / 4)
> +#define FIPS_TEST_JSON_BUF_LEN ((4096 / 4) + 1)
> 
>  struct fips_test_json_info {
>  	/* Information used for reading from json */
> --
> 2.25.1

Acked-by: Brian Dooley <brian.dooley@intel.com>
  

Patch

diff --git a/examples/fips_validation/fips_validation.h b/examples/fips_validation/fips_validation.h
index c4988053c1..abc1d64742 100644
--- a/examples/fips_validation/fips_validation.h
+++ b/examples/fips_validation/fips_validation.h
@@ -247,7 +247,7 @@  struct ecdsa_interim_data {
  * Esp, in asym op, modulo bits decide char buffer size.
  * max = (modulo / 4)
  */
-#define FIPS_TEST_JSON_BUF_LEN (4096 / 4)
+#define FIPS_TEST_JSON_BUF_LEN ((4096 / 4) + 1)
 
 struct fips_test_json_info {
 	/* Information used for reading from json */