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
;;
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."