mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-01-26 19:22:20 +01:00
22 lines
517 B
Bash
Executable File
22 lines
517 B
Bash
Executable File
#!/bin/sh
|
|
|
|
if test ! -x ./wolfcrypt/test/testwolfcrypt
|
|
then
|
|
echo "fips-hash: wolfCrypt test missing"
|
|
exit 1
|
|
fi
|
|
|
|
if test ! -s ./wolfcrypt/src/fips_test.c
|
|
then
|
|
echo "fips-hash: fips_test.c missing"
|
|
exit 1
|
|
fi
|
|
|
|
OUT=$(./wolfcrypt/test/testwolfcrypt | sed -n 's/hash = \(.*\)/\1/p')
|
|
NEWHASH=$(echo "$OUT" | cut -c1-64)
|
|
if test -n "$NEWHASH"
|
|
then
|
|
cp wolfcrypt/src/fips_test.c wolfcrypt/src/fips_test.c.bak
|
|
sed "s/^\".*\";/\"${NEWHASH}\";/" wolfcrypt/src/fips_test.c.bak >wolfcrypt/src/fips_test.c
|
|
fi
|