Skip to content

Commit 3e93c5e

Browse files
committed
FIPS Check Script with Explicit Versioning
1. Move the command line updatable variables to the beginning of the script. 2. Reorder the OE names in the usage list. 3. Add the missing asm files. 4. Correct the regex for the fipsv2-OE-ready version name.
1 parent 6724a3d commit 3e93c5e

1 file changed

Lines changed: 16 additions & 15 deletions

File tree

fips-check.sh

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,36 +9,35 @@
99
# This should check out all the approved flavors. The command line
1010
# option selects the flavor. The keep option keeps the output
1111
# directory.
12-
#
13-
# Some variables may be overridden on the command line.
12+
13+
# These variables may be overridden on the command line.
14+
MAKE="${MAKE:-make}"
15+
GIT="${GIT:-git -c advice.detachedHead=false}"
16+
TEST_DIR="${TEST_DIR:-XXX-fips-test}"
17+
FLAVOR="${FLAVOR:-linux}"
18+
KEEP="${KEEP:-no}"
19+
FIPS_REPO="${FIPS_REPO:-git@github.com:wolfssl/fips.git}"
1420

1521
Usage() {
1622
cat <<usageText
1723
Usage: $0 [flavor] [keep]
1824
Flavor is one of:
19-
netbsd-selftest
20-
marvell-linux-selftest
2125
linuxv2 (FIPSv2, use for Win10)
22-
wolfrand
26+
fipsv2-OE-ready (ready FIPSv2)
2327
solaris
28+
netbsd-selftest
29+
marvell-linux-selftest
2430
linuxv5 (current FIPS 140-3)
2531
fips-ready (ready FIPS 140-3)
2632
fips-dev (dev FIPS 140-3)
27-
Keep (default off) retains the XXX-fips-test temp dir for inspection.
33+
wolfrand
34+
Keep (default off) retains the temp dir $TEST_DIR for inspection.
2835
2936
Example:
3037
$0 windows keep
3138
usageText
3239
}
3340

34-
# These variables may be overridden on the command line.
35-
MAKE="${MAKE:-make}"
36-
GIT="${GIT:-git -c advice.detachedHead=false}"
37-
TEST_DIR="${TEST_DIR:-XXX-fips-test}"
38-
FLAVOR="${FLAVOR:-linux}"
39-
KEEP="${KEEP:-no}"
40-
FIPS_REPO="${FIPS_REPO:-git@github.com:wolfssl/fips.git}"
41-
4241
while [ "$1" ]; do
4342
if [ "$1" = 'keep' ]; then KEEP='yes'; else FLAVOR="$1"; fi
4443
shift
@@ -56,6 +55,7 @@ linuxv2|fipsv2-OE-ready|solaris)
5655
)
5756
WOLFCRYPT_FILES=(
5857
'wolfcrypt/src/aes.c:WCv4-stable'
58+
'wolfcrypt/src/aes_asm.asm:WCv4-stable'
5959
'wolfcrypt/src/aes_asm.S:WCv4-stable'
6060
'wolfcrypt/src/cmac.c:WCv4-stable'
6161
'wolfcrypt/src/des3.c:WCv4-stable'
@@ -148,6 +148,7 @@ linuxv5)
148148
)
149149
WOLFCRYPT_FILES=(
150150
'wolfcrypt/src/aes.c:WCv5.0-RC12'
151+
'wolfcrypt/src/aes_asm.asm:WCv5.0-RC12'
151152
'wolfcrypt/src/aes_asm.S:WCv5.0-RC12'
152153
'wolfcrypt/src/aes_gcm_asm.S:WCv5.0-RC12'
153154
'wolfcrypt/src/cmac.c:WCv5.0-RC12'
@@ -282,7 +283,7 @@ copy_fips_files "${FIPS_FILES[@]}"
282283
if [ "$FLAVOR" = 'fipsv2-OE-ready' ] && [ -s wolfcrypt/src/fips.c ]
283284
then
284285
cp wolfcrypt/src/fips.c wolfcrypt/src/fips.c.bak
285-
sed "s/^v4.0.0-alpha/fipsv2-OE-ready/" wolfcrypt/src/fips.c.bak >wolfcrypt/src/fips.c
286+
sed "s/v4.0.0-alpha/fipsv2-OE-ready/" wolfcrypt/src/fips.c.bak >wolfcrypt/src/fips.c
286287
fi
287288

288289
# run the make test

0 commit comments

Comments
 (0)