fips-hash.sh 488 B

123456789101112131415161718192021
  1. #!/bin/bash
  2. if test ! -x ./wolfcrypt/test/testwolfcrypt
  3. then
  4. echo "fips-hash: wolfCrypt test missing"
  5. exit 1
  6. fi
  7. if test ! -s ./wolfcrypt/src/fips_test.c
  8. then
  9. echo "fips-hash: fips_test.c missing"
  10. exit 1
  11. fi
  12. NEWHASH=$(./wolfcrypt/test/testwolfcrypt | sed -n 's/hash = \(.*\)/\1/p')
  13. if test -n "$NEWHASH"
  14. then
  15. cp wolfcrypt/src/fips_test.c wolfcrypt/src/fips_test.c.bak
  16. sed "s/^\".*\";/\"${NEWHASH}\";/" wolfcrypt/src/fips_test.c.bak >wolfcrypt/src/fips_test.c
  17. fi