fips-hash.sh 401 B

1234567891011121314151617181920
  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. sed -i.bak "s/^\".*\";/\"${NEWHASH}\";/" wolfcrypt/src/fips_test.c
  16. fi