From 7e26bc06c5fe86f4dee26810eddf3a945cc7d7cf Mon Sep 17 00:00:00 2001 From: Lealem Amedie Date: Fri, 21 Nov 2025 11:14:53 -0700 Subject: [PATCH] Use only the first 64 bytes of hash output in fips-hash.sh --- fips-check.sh | 20 ++++++++++++-------- fips-hash.sh | 3 ++- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/fips-check.sh b/fips-check.sh index ae57c9e00..e92e973d6 100755 --- a/fips-check.sh +++ b/fips-check.sh @@ -31,17 +31,19 @@ Usage() { cat <wolfcrypt/src/fips_test.c + sed "s/^\".*\";/\"${NEWHASH}\";/" wolfcrypt/src/fips_test.c.bak > \ + wolfcrypt/src/fips_test.c make clean fi fi diff --git a/fips-hash.sh b/fips-hash.sh index 7ae25eeeb..b5c57a82e 100755 --- a/fips-hash.sh +++ b/fips-hash.sh @@ -12,7 +12,8 @@ then exit 1 fi -NEWHASH=$(./wolfcrypt/test/testwolfcrypt | sed -n 's/hash = \(.*\)/\1/p') +OUT=$(./wolfcrypt/test/testwolfcrypt | sed -n 's/hash = \(.*\)/\1/p') +NEWHASH="${OUT:0:64}" if test -n "$NEWHASH" then cp wolfcrypt/src/fips_test.c wolfcrypt/src/fips_test.c.bak