#!/bin/bash # fips-check.sh # This script checks the current revision of the code against the # previous release of the FIPS code. While wolfSSL and wolfCrypt # may be advancing, they must work correctly with the last tested # copy of our FIPS approved code. # # This should check out all the approved versions. The command line # option selects the version. # # $ ./fips-check [version] [keep] # # - version: linux (default), ios, android, windows, freertos, linux-ecc, netbsd-selftest, linuxv2, fips-ready, stm32l4-v2 # # - keep: (default off) XXX-fips-test temp dir around for inspection # Usage() { cat <$CRYPT_SRC_PATH/fips_test.c make clean fi fi if ! $MAKE test; then echo "fips-check: Test failed. Debris left for analysis." exit 3 fi if [ ${#FIPS_CONFLICTS[@]} -ne 0 ]; then echo "Due to the way this package is compiled by the customer duplicate" echo "source file names are an issue, renaming:" for FNAME in "${FIPS_CONFLICTS[@]}" do echo "wolfcrypt/src/$FNAME.c to wolfcrypt/src/wc_$FNAME.c" mv "./wolfcrypt/src/$FNAME.c" "./wolfcrypt/src/wc_$FNAME.c" done echo "Confirming files were renamed..." ls -la ./wolfcrypt/src/wc_*.c fi # Clean up popd || exit 2 if [ "x$KEEP" == "xno" ]; then rm -rf $TEST_DIR fi