From a5032e808747a6876b278cbed2b469cc716f15be Mon Sep 17 00:00:00 2001 From: John Safranek Date: Thu, 22 Oct 2020 18:16:32 -0700 Subject: [PATCH] Update the fips-check script to pull the sources from GitHub rather than from a directory on a local machine. --- fips-check.sh | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/fips-check.sh b/fips-check.sh index 26fdb08de..cf77129df 100755 --- a/fips-check.sh +++ b/fips-check.sh @@ -267,13 +267,17 @@ solaris) MAKE=gmake ;; linuxv3) - FIPS_REPO='/Users/john/src/fips' - CRYPT_REPO='/Users/john/src/wolfssl/FIPS-3' - CRYPT_INC_PATH='wolfssl/wolfcrypt' - CRYPT_SRC_PATH='wolfcrypt/src' - FIPS_SRCS+=( wolfcrypt_first.c wolfcrypt_last.c ) + FIPS_REPO="git@github.com:ejohnstown/fips.git" + FIPS_VERSION="fipsv3" + CRYPT_REPO="git@github.com:ejohnstown/wolfssl.git" + CRYPT_VERSION="fipsv3" + CRYPT_INC_PATH="wolfssl/wolfcrypt" + CRYPT_SRC_PATH="wolfcrypt/src" + WC_MODS=( aes sha sha256 sha512 rsa hmac random cmac dh ecc sha3 ) + RNG_VERSION="fipsv3" + FIPS_SRCS=( fips.c fips_test.c wolfcrypt_first.c wolfcrypt_last.c ) FIPS_INCS=( fips.h ) - FIPS_OPTION='v4' + FIPS_OPTION="v4" ;; *) Usage @@ -314,7 +318,7 @@ 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" ] +elif [ "x$FIPS_OPTION" == "xv2" ] || [ "x$FIPS_OPTION" == "xrand" ] || [ "x$FIPS_OPTION" == "xv4" ] then $GIT branch --no-track "my$CRYPT_VERSION" $CRYPT_VERSION # Checkout the fips versions of the wolfCrypt files from the repo. @@ -323,15 +327,12 @@ then $GIT checkout "my$CRYPT_VERSION" -- "$CRYPT_SRC_PATH/$MOD.c" "$CRYPT_INC_PATH/$MOD.h" done - $GIT branch --no-track "my$RNG_VERSION" $RNG_VERSION + $GIT branch --no-track "myrng$RNG_VERSION" $RNG_VERSION # Checkout the fips versions of the wolfCrypt files from the repo. - $GIT checkout "my$RNG_VERSION" -- "$CRYPT_SRC_PATH/random.c" "$CRYPT_INC_PATH/random.h" + $GIT checkout "myrng$RNG_VERSION" -- "$CRYPT_SRC_PATH/random.c" "$CRYPT_INC_PATH/random.h" elif [ "x$FIPS_OPTION" == "xready" ] then echo "Don't need to copy anything in particular for FIPS Ready." -elif [ "x$FIPS_OPTION" == "xv4" ] -then - echo "Don't need to copy anything in particular for FIPS 140-3, yet." else echo "fips-check: Invalid FIPS option." exit 1 @@ -344,12 +345,6 @@ then echo "fips-check: Couldn't checkout the FIPS repository for FIPS Ready." exit 1 fi -elif test "x$FIPS_OPTION" = "xv4" -then - if ! $GIT clone $FIPS_REPO fips; then - echo "fips-check: Couldn't checkout the FIPS repository FIPS 140-3." - exit 1 - fi else if ! $GIT clone --depth 1 -b $FIPS_VERSION $FIPS_REPO fips; then echo "fips-check: Couldn't checkout the FIPS repository."