diff --git a/fips-check.sh b/fips-check.sh index 6b09aad13..f0ec0626e 100755 --- a/fips-check.sh +++ b/fips-check.sh @@ -220,28 +220,25 @@ netos-7.6) CRYPT_VERSION=$NETOS_7_6_CRYPT_VERSION CRYPT_REPO=$NETOS_7_6_CRYPT_REPO ;; -fips-ready) +fips-v3-ready) FIPS_REPO="git@github.com:wolfssl/fips.git" - CRYPT_REPO="git@github.com:wolfssl/wolfssl.git" + FIPS_VERSION="v4.1.1" CRYPT_INC_PATH=wolfssl/wolfcrypt CRYPT_SRC_PATH=wolfcrypt/src FIPS_SRCS+=( wolfcrypt_first.c wolfcrypt_last.c ) FIPS_INCS=( fips.h ) - FIPS_OPTION=ready + FIPS_OPTION=v3-ready ;; - -# note, "linuxv5" is temporarily an alias for "linuxv5-ready", while PR #4359 is in flight: - -linuxv5-ready|linuxv5) +fips-ready|fips-v5-ready|linuxv5-ready) FIPS_REPO="git@github.com:wolfSSL/fips.git" - FIPS_VERSION="douzzer-linuxkm-fips-140-3" - CRYPT_REPO="git@github.com:wolfssl/wolfssl.git" + FIPS_VERSION="master" CRYPT_INC_PATH=wolfssl/wolfcrypt CRYPT_SRC_PATH=wolfcrypt/src FIPS_SRCS+=( wolfcrypt_first.c wolfcrypt_last.c ) FIPS_INCS=( fips.h ) FIPS_OPTION=v5-ready ;; + stm32l4-v2) FIPS_VERSION=$STM32L4_V2_FIPS_VERSION FIPS_REPO=$STM32L4_V2_FIPS_REPO @@ -296,6 +293,24 @@ linuxv5-RC8) COPY_DIRECT=( wolfcrypt/src/aes_asm.S wolfcrypt/src/aes_asm.asm wolfcrypt/src/sha256_asm.S wolfcrypt/src/sha512_asm.S ) ;; + +# temporary values during transition +linuxv5|linuxv5-RC9) + FIPS_REPO="git@github.com:wolfSSL/fips.git" + FIPS_VERSION="master" + CRYPT_REPO="git@github.com:douzzer/wolfssl.git" + CRYPT_VERSION="fipsv3-rebased" + CRYPT_INC_PATH="wolfssl/wolfcrypt" + CRYPT_SRC_PATH="wolfcrypt/src" + WC_MODS=( aes sha sha256 sha512 rsa hmac random cmac dh ecc sha3 kdf ) + RNG_VERSION="fipsv3-rebased" + FIPS_SRCS=( fips.c fips_test.c wolfcrypt_first.c wolfcrypt_last.c ) + FIPS_INCS=( fips.h ) + FIPS_OPTION="v5-RC9" + COPY_DIRECT=( wolfcrypt/src/aes_asm.S wolfcrypt/src/aes_asm.asm + wolfcrypt/src/sha256_asm.S wolfcrypt/src/sha512_asm.S ) + ;; + *) Usage exit 1 @@ -308,8 +323,9 @@ fi pushd $TEST_DIR || exit 2 -if [ "x$FIPS_OPTION" == "xv1" ]; -then +case "$FIPS_OPTION" in + +v1) # make a clone of the last FIPS release tag if ! $GIT clone --depth 1 -b $CRYPT_VERSION $CRYPT_REPO old-tree; then echo "fips-check: Couldn't checkout the FIPS release." @@ -335,8 +351,10 @@ then cp "old-tree/$CRYPT_SRC_PATH/random.c" $CRYPT_SRC_PATH cp "old-tree/$CRYPT_INC_PATH/random.h" $CRYPT_INC_PATH fi -elif [ "x$FIPS_OPTION" == "xv2" ] || [ "x$FIPS_OPTION" == "xrand" ] || [ "x$FIPS_OPTION" == "xv5-RC8" ] -then + ;; + + +v2|rand|v5-RC8|v5-RC9) $GIT branch --no-track "my$CRYPT_VERSION" $CRYPT_VERSION || exit $? # Checkout the fips versions of the wolfCrypt files from the repo. for MOD in "${WC_MODS[@]}" @@ -352,13 +370,17 @@ then $GIT branch --no-track "myrng$RNG_VERSION" $RNG_VERSION || exit $? # Checkout the fips versions of the wolfCrypt files from the repo. $GIT checkout "myrng$RNG_VERSION" -- "$CRYPT_SRC_PATH/random.c" "$CRYPT_INC_PATH/random.h" || exit $? -elif [ "x$FIPS_OPTION" == "xready" ] || [ "x$FIPS_OPTION" == "xv5-ready" ] -then + ;; + +*ready*) echo "Don't need to copy anything in particular for FIPS Ready." -else + ;; + +*) echo "fips-check: Invalid FIPS option \"${FIPS_OPTION}\"." exit 1 -fi + ;; +esac # clone the FIPS repository if [ "x$FIPS_OPTION" = "xready" ]