Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions fips-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,19 @@ Usage() {
cat <<usageText
Usage: $0 [flavor] [keep] [nomakecheck] [nodoconfigure] [noautogen]
Flavor is one of:
linuxv2 (FIPSv2, use for Win10)
fipsv2-OE-ready (ready FIPSv2)
linuxv2 (FIPSv2, use for Win10)
fipsv2-OE-ready (ready FIPSv2)
solaris
netbsd-selftest
marvell-linux-selftest
linuxv5 (current FIPS 140-3)
fips-ready (ready FIPS 140-3)
fips-dev (dev FIPS 140-3)
linuxv5 (current FIPS 140-3 [v5.2.1])
linuxv5-RC12 (current FIPS 140-3 [v5.2.0.1])
fips-ready (ready FIPS 140-3)
fips-dev (dev FIPS 140-3)
wolfrand
wolfentropy
v6.0.0
v6.0.0 (pending FIPS 140-3 [v6.0.0])

keep: (default off) retains the temp dir $TEST_DIR for inspection.
nomakecheck: (default off) don't run make check
nodoconfigure: (default off) don't run configure
Expand Down Expand Up @@ -670,10 +672,12 @@ if [ "$DOCONFIGURE" = "yes" ]; then
fi

if [ -s wolfcrypt/src/fips_test.c ]; then
NEWHASH=$(./wolfcrypt/test/testwolfcrypt | sed -n 's/hash = \(.*\)/\1/p')
OUT=$(./wolfcrypt/test/testwolfcrypt | sed -n 's/hash = \(.*\)/\1/p')
NEWHASH=$(echo "$OUT" | cut -c1-64)
if [ -n "$NEWHASH" ]; then
cp wolfcrypt/src/fips_test.c wolfcrypt/src/fips_test.c.bak
sed "s/^\".*\";/\"${NEWHASH}\";/" wolfcrypt/src/fips_test.c.bak >wolfcrypt/src/fips_test.c
sed "s/^\".*\";/\"${NEWHASH}\";/" wolfcrypt/src/fips_test.c.bak > \
wolfcrypt/src/fips_test.c
make clean
fi
fi
Expand Down
3 changes: 2 additions & 1 deletion fips-hash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ then
exit 1
fi

NEWHASH=$(./wolfcrypt/test/testwolfcrypt | sed -n 's/hash = \(.*\)/\1/p')
OUT=$(./wolfcrypt/test/testwolfcrypt | sed -n 's/hash = \(.*\)/\1/p')
NEWHASH=$(echo "$OUT" | cut -c1-64)
if test -n "$NEWHASH"
then
cp wolfcrypt/src/fips_test.c wolfcrypt/src/fips_test.c.bak
Expand Down
4 changes: 4 additions & 0 deletions src/internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -13204,6 +13204,10 @@ int CheckHostName(DecodedCert* dCert, const char *domainName,
int checkCN;
int ret = WC_NO_ERR_TRACE(DOMAIN_NAME_MISMATCH);

if (dCert == NULL) {
return BAD_FUNC_ARG;
}

if (CheckForAltNames(dCert, domainName, (word32)domainNameLen,
&checkCN, flags, isIP) != 1) {
ret = DOMAIN_NAME_MISMATCH;
Expand Down