[1/8] examples/fips_validation: separation between HMAC-SHA and SHA
Checks
Commit Message
From: Michael Shamis <michaelsh@marvell.com>
Fix: SHA initialization will not be called in case of HAMC-SHA
Signed-off-by: Michael Shamis <michaelsh@marvell.com>
---
examples/fips_validation/fips_validation.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
@@ -145,11 +145,13 @@ fips_test_parse_header(void)
if (ret < 0)
return 0;
} else if (strstr(info.vec[i], "SHA-")) {
- algo_parsed = 1;
- info.algo = FIPS_TEST_ALGO_SHA;
- ret = parse_test_sha_init();
- if (ret < 0)
- return ret;
+ if (info.algo != FIPS_TEST_ALGO_HMAC) {
+ algo_parsed = 1;
+ info.algo = FIPS_TEST_ALGO_SHA;
+ ret = parse_test_sha_init();
+ if (ret < 0)
+ return ret;
+ }
}
}