Skip to content

Commit 7c08d65

Browse files
author
Andras Fekete
committed
Add FIPS testing
1 parent 1025597 commit 7c08d65

1 file changed

Lines changed: 27 additions & 17 deletions

File tree

scripts/test-sanity.sh

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,28 +21,38 @@ function doTestCmd() {
2121
echo "<<<<<<"
2222
}
2323

24-
doTestCmd init_wolfprov
24+
function runSpotCheck() {
25+
SPOTCHECK_ARGS=$1
26+
rm -rf ${WOLFSSL_INSTALL_DIR} ${WOLFPROV_INSTALL_DIR}
27+
doTestCmd "$1 init_wolfprov"
2528

26-
SET_POST=$( set )
27-
echo "New variables set:"
28-
diff <(echo "$SET_PRE") <(echo "$SET_POST") | grep "="
29+
SET_POST=$( set )
30+
echo "New variables set:"
31+
diff <(echo "$SET_PRE") <(echo "$SET_POST") | grep "="
2932

30-
doTestCmd "${OPENSSL_INSTALL_DIR}/bin/openssl list -providers --verbose | grep 'Providers:' -A 10"
33+
doTestCmd "${OPENSSL_INSTALL_DIR}/bin/openssl list -providers --verbose | grep 'Providers:' -A 10"
3134

32-
if [ $(${OPENSSL_INSTALL_DIR}/bin/openssl list -providers --verbose | grep libwolfprov | wc -l) = 0 ]; then
33-
echo "Not using wolfProvider for some reason"
34-
exit 2
35-
fi
35+
if [ $(${OPENSSL_INSTALL_DIR}/bin/openssl list -providers --verbose | grep libwolfprov | wc -l) = 0 ]; then
36+
echo "Not using wolfProvider for some reason"
37+
exit 2
38+
fi
39+
40+
if [ $(${OPENSSL_INSTALL_DIR}/bin/openssl list -providers --verbose | grep OpenSSL | wc -l) -ne 0 ]; then
41+
echo "OpenSSL provider is also enabled"
42+
exit 2
43+
fi
3644

37-
if [ $(${OPENSSL_INSTALL_DIR}/bin/openssl list -providers --verbose | grep OpenSSL | wc -l) -ne 0 ]; then
38-
echo "OpenSSL provider is also enabled"
39-
exit 2
40-
fi
45+
doTestCmd "${OPENSSL_INSTALL_DIR}/bin/openssl s_client -CApath /etc/ssl/certs -connect github.com:443 </dev/null"
46+
doTestCmd "curl https://github.com/wolfSSL/wolfProvider -o test.html"
47+
48+
doTestCmd "${OPENSSL_INSTALL_DIR}/bin/openssl s_client -CApath /etc/ssl/certs -connect tcp.support:443 </dev/null"
49+
doTestCmd "curl https://tls.support -vv --tlsv1.3 --tls-max 1.3 -o test.html"
50+
}
4151

42-
doTestCmd "${OPENSSL_INSTALL_DIR}/bin/openssl s_client -CApath /etc/ssl/certs -connect github.com:443 </dev/null"
43-
doTestCmd "curl https://github.com/wolfSSL/wolfProvider -o test.html"
52+
echo "Now testing standard version"
53+
runSpotCheck ""
4454

45-
doTestCmd "${OPENSSL_INSTALL_DIR}/bin/openssl s_client -CApath /etc/ssl/certs -connect tcp.support:443 </dev/null"
46-
doTestCmd "curl https://tls.support -vv --tlsv1.3 --tls-max 1.3 -o test.html"
55+
echo "Now testing FIPS version"
56+
runSpotCheck "WOLFSSL_ISFIPS=1"
4757

4858
exit $?

0 commit comments

Comments
 (0)