mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-01 03:34:39 +02:00
Standardize script style
This commit is contained in:
@@ -265,8 +265,7 @@ esac
|
|||||||
function checkout_files() {
|
function checkout_files() {
|
||||||
local name
|
local name
|
||||||
local tag
|
local tag
|
||||||
for file_entry in "$@"
|
for file_entry in "$@"; do
|
||||||
do
|
|
||||||
name=${file_entry%%:*}
|
name=${file_entry%%:*}
|
||||||
tag=${file_entry#*:}
|
tag=${file_entry#*:}
|
||||||
if ! $GIT rev-parse -q --verify "my$tag" >/dev/null
|
if ! $GIT rev-parse -q --verify "my$tag" >/dev/null
|
||||||
@@ -286,14 +285,12 @@ function copy_fips_files() {
|
|||||||
local bname
|
local bname
|
||||||
local dname
|
local dname
|
||||||
local tag
|
local tag
|
||||||
for file_entry in "$@"
|
for file_entry in "$@"; do
|
||||||
do
|
|
||||||
name=${file_entry%%:*}
|
name=${file_entry%%:*}
|
||||||
tag=${file_entry#*:}
|
tag=${file_entry#*:}
|
||||||
bname=$(basename "$name")
|
bname=$(basename "$name")
|
||||||
dname=$(dirname "$name")
|
dname=$(dirname "$name")
|
||||||
if ! $GIT rev-parse -q --verify "my$tag" >/dev/null
|
if ! $GIT rev-parse -q --verify "my$tag" >/dev/null; then
|
||||||
then
|
|
||||||
$GIT branch --no-track "my$tag" "$tag" || exit $?
|
$GIT branch --no-track "my$tag" "$tag" || exit $?
|
||||||
fi
|
fi
|
||||||
$GIT checkout "my$tag" -- "$bname" || exit $?
|
$GIT checkout "my$tag" -- "$bname" || exit $?
|
||||||
@@ -308,8 +305,7 @@ fi
|
|||||||
|
|
||||||
pushd "$TEST_DIR" || exit 2
|
pushd "$TEST_DIR" || exit 2
|
||||||
|
|
||||||
if ! $GIT clone "$FIPS_REPO" fips
|
if ! $GIT clone "$FIPS_REPO" fips; then
|
||||||
then
|
|
||||||
echo "fips-check: Couldn't check out FIPS repository."
|
echo "fips-check: Couldn't check out FIPS repository."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@@ -325,8 +321,7 @@ popd || exit 2
|
|||||||
# Since OE additions can still be processed for cert3389 we will call 140-2
|
# Since OE additions can still be processed for cert3389 we will call 140-2
|
||||||
# ready "fipsv2-OE-ready" indicating it is ready to use for an OE addition but
|
# ready "fipsv2-OE-ready" indicating it is ready to use for an OE addition but
|
||||||
# would not be good for a new certification effort with the latest files.
|
# would not be good for a new certification effort with the latest files.
|
||||||
if [ "$FLAVOR" = 'fipsv2-OE-ready' ] && [ -s wolfcrypt/src/fips.c ]
|
if [ "$FLAVOR" = 'fipsv2-OE-ready' ] && [ -s wolfcrypt/src/fips.c ]; then
|
||||||
then
|
|
||||||
cp wolfcrypt/src/fips.c wolfcrypt/src/fips.c.bak
|
cp wolfcrypt/src/fips.c wolfcrypt/src/fips.c.bak
|
||||||
sed "s/v4.0.0-alpha/fipsv2-OE-ready/" wolfcrypt/src/fips.c.bak >wolfcrypt/src/fips.c
|
sed "s/v4.0.0-alpha/fipsv2-OE-ready/" wolfcrypt/src/fips.c.bak >wolfcrypt/src/fips.c
|
||||||
fi
|
fi
|
||||||
@@ -346,14 +341,12 @@ cavp-selftest-v2)
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if ! $MAKE
|
if ! $MAKE; then
|
||||||
then
|
|
||||||
echo 'fips-check: Make failed. Debris left for analysis.'
|
echo 'fips-check: Make failed. Debris left for analysis.'
|
||||||
exit 3
|
exit 3
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -s wolfcrypt/src/fips_test.c ]
|
if [ -s wolfcrypt/src/fips_test.c ]; then
|
||||||
then
|
|
||||||
NEWHASH=$(./wolfcrypt/test/testwolfcrypt | sed -n 's/hash = \(.*\)/\1/p')
|
NEWHASH=$(./wolfcrypt/test/testwolfcrypt | sed -n 's/hash = \(.*\)/\1/p')
|
||||||
if [ -n "$NEWHASH" ]; then
|
if [ -n "$NEWHASH" ]; then
|
||||||
cp wolfcrypt/src/fips_test.c wolfcrypt/src/fips_test.c.bak
|
cp wolfcrypt/src/fips_test.c wolfcrypt/src/fips_test.c.bak
|
||||||
@@ -371,7 +364,6 @@ fi
|
|||||||
|
|
||||||
# Clean up
|
# Clean up
|
||||||
popd || exit 2
|
popd || exit 2
|
||||||
if [ "$KEEP" = 'no' ];
|
if [ "$KEEP" = 'no' ]; then
|
||||||
then
|
|
||||||
rm -rf "$TEST_DIR"
|
rm -rf "$TEST_DIR"
|
||||||
fi
|
fi
|
||||||
|
Reference in New Issue
Block a user