fips-check.sh: exit (fatal error) if git fails.

This commit is contained in:
Daniel Pouzzner
2021-10-13 18:11:31 -05:00
parent f1d43f6891
commit a3435ca062

View File

@ -325,29 +325,29 @@ then
[ "x$PLATFORM" != "xnetos-7.6" ]; [ "x$PLATFORM" != "xnetos-7.6" ];
then then
pushd old-tree || exit 2 pushd old-tree || exit 2
$GIT fetch origin $RNG_VERSION $GIT fetch origin $RNG_VERSION || exit $?
$GIT checkout FETCH_HEAD $GIT checkout FETCH_HEAD || exit $?
popd || exit 2 popd || exit 2
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" ] || [ "x$FIPS_OPTION" == "xv5-RC8" ] elif [ "x$FIPS_OPTION" == "xv2" ] || [ "x$FIPS_OPTION" == "xrand" ] || [ "x$FIPS_OPTION" == "xv5-RC8" ]
then then
$GIT branch --no-track "my$CRYPT_VERSION" $CRYPT_VERSION $GIT branch --no-track "my$CRYPT_VERSION" $CRYPT_VERSION || exit $?
# Checkout the fips versions of the wolfCrypt files from the repo. # Checkout the fips versions of the wolfCrypt files from the repo.
for MOD in "${WC_MODS[@]}" for MOD in "${WC_MODS[@]}"
do do
$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" || exit $?
done done
for MOD in "${COPY_DIRECT[@]}" for MOD in "${COPY_DIRECT[@]}"
do do
$GIT checkout "my$CRYPT_VERSION" -- "$MOD" $GIT checkout "my$CRYPT_VERSION" -- "$MOD" || exit $?
done done
$GIT branch --no-track "myrng$RNG_VERSION" $RNG_VERSION $GIT branch --no-track "myrng$RNG_VERSION" $RNG_VERSION || exit $?
# Checkout the fips versions of the wolfCrypt files from the repo. # 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" $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" ] elif [ "x$FIPS_OPTION" == "xready" ] || [ "x$FIPS_OPTION" == "xv5-ready" ]
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."