Update the fips-check script to pull the sources from GitHub rather than

from a directory on a local machine.
This commit is contained in:
John Safranek
2020-10-22 18:16:32 -07:00
committed by Daniel Pouzzner
parent df859d30f3
commit a5032e8087

View File

@ -267,13 +267,17 @@ solaris)
MAKE=gmake MAKE=gmake
;; ;;
linuxv3) linuxv3)
FIPS_REPO='/Users/john/src/fips' FIPS_REPO="git@github.com:ejohnstown/fips.git"
CRYPT_REPO='/Users/john/src/wolfssl/FIPS-3' FIPS_VERSION="fipsv3"
CRYPT_INC_PATH='wolfssl/wolfcrypt' CRYPT_REPO="git@github.com:ejohnstown/wolfssl.git"
CRYPT_SRC_PATH='wolfcrypt/src' CRYPT_VERSION="fipsv3"
FIPS_SRCS+=( wolfcrypt_first.c wolfcrypt_last.c ) 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_INCS=( fips.h )
FIPS_OPTION='v4' FIPS_OPTION="v4"
;; ;;
*) *)
Usage Usage
@ -314,7 +318,7 @@ then
cp "old-tree/$CRYPT_SRC_PATH/random.c" $CRYPT_SRC_PATH cp "old-tree/$CRYPT_SRC_PATH/random.c" $CRYPT_SRC_PATH
cp "old-tree/$CRYPT_INC_PATH/random.h" $CRYPT_INC_PATH cp "old-tree/$CRYPT_INC_PATH/random.h" $CRYPT_INC_PATH
fi fi
elif [ "x$FIPS_OPTION" == "xv2" ] || [ "x$FIPS_OPTION" == "xrand" ] elif [ "x$FIPS_OPTION" == "xv2" ] || [ "x$FIPS_OPTION" == "xrand" ] || [ "x$FIPS_OPTION" == "xv4" ]
then then
$GIT branch --no-track "my$CRYPT_VERSION" $CRYPT_VERSION $GIT branch --no-track "my$CRYPT_VERSION" $CRYPT_VERSION
# Checkout the fips versions of the wolfCrypt files from the repo. # 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" $GIT checkout "my$CRYPT_VERSION" -- "$CRYPT_SRC_PATH/$MOD.c" "$CRYPT_INC_PATH/$MOD.h"
done 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. # 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" ] elif [ "x$FIPS_OPTION" == "xready" ]
then then
echo "Don't need to copy anything in particular for FIPS Ready." 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 else
echo "fips-check: Invalid FIPS option." echo "fips-check: Invalid FIPS option."
exit 1 exit 1
@ -344,12 +345,6 @@ then
echo "fips-check: Couldn't checkout the FIPS repository for FIPS Ready." echo "fips-check: Couldn't checkout the FIPS repository for FIPS Ready."
exit 1 exit 1
fi 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 else
if ! $GIT clone --depth 1 -b $FIPS_VERSION $FIPS_REPO fips; then if ! $GIT clone --depth 1 -b $FIPS_VERSION $FIPS_REPO fips; then
echo "fips-check: Couldn't checkout the FIPS repository." echo "fips-check: Couldn't checkout the FIPS repository."