diff --git a/.github/workflows/simple.yml b/.github/workflows/simple.yml
index 8530c90b..e54c78df 100644
--- a/.github/workflows/simple.yml
+++ b/.github/workflows/simple.yml
@@ -50,7 +50,7 @@ jobs:
- name: Run simple tests
run: |
- ./scripts/cmd_test/do-cmd-tests.sh ${{ matrix.force_fail }}
+ ${{ matrix.force_fail }} ./scripts/cmd_test/do-cmd-tests.sh
- name: Print test logs
if: always()
diff --git a/scripts/cmd_test/aes-cmd-test.sh b/scripts/cmd_test/aes-cmd-test.sh
index d9da1b12..c651642b 100755
--- a/scripts/cmd_test/aes-cmd-test.sh
+++ b/scripts/cmd_test/aes-cmd-test.sh
@@ -33,19 +33,19 @@ source "${UTILS_DIR}/utils-openssl.sh"
source "${UTILS_DIR}/utils-wolfssl.sh"
source "${UTILS_DIR}/utils-wolfprovider.sh"
-# Initialize the environment
+# Initialize wolfProvider
init_wolfprov
# Fail flags
FAIL=0
-FORCE_FAIL=0
FORCE_FAIL_PASSED=0
-# Check for force fail parameter
-if [ "$1" = "WOLFPROV_FORCE_FAIL=1" ]; then
- export WOLFPROV_FORCE_FAIL=1
- FORCE_FAIL=1
- echo -e "\nForce fail mode enabled for AES tests"
+# Check environment variables directly
+if [ "${WOLFPROV_FORCE_FAIL}" = "1" ]; then
+ echo "Force fail mode enabled for AES tests"
+fi
+if [ "${WOLFSSL_ISFIPS}" = "1" ]; then
+ echo "FIPS mode enabled for AES tests"
fi
# Verify wolfProvider is properly loaded
@@ -71,7 +71,7 @@ echo "This is test data for AES encryption testing." > test.txt
# Helper function to handle force fail checks
check_force_fail() {
- if [ $FORCE_FAIL -eq 1 ]; then
+ if [ "${WOLFPROV_FORCE_FAIL}" = "1" ]; then
echo "[PASS] Test passed when force fail was enabled"
FORCE_FAIL_PASSED=1
fi
@@ -80,7 +80,12 @@ check_force_fail() {
# Arrays for test configurations
KEY_SIZES=("128" "192" "256")
# Only include modes supported by wolfProvider
-MODES=("ecb" "cbc" "ctr" "cfb")
+if [ "${WOLFSSL_ISFIPS}" = "1" ]; then
+ MODES=("ecb" "cbc" "ctr")
+ echo "FIPS mode detected - excluding CFB mode"
+else
+ MODES=("ecb" "cbc" "ctr" "cfb")
+fi
echo "=== Running AES Algorithm Comparisons ==="
@@ -90,11 +95,14 @@ for key_size in "${KEY_SIZES[@]}"; do
echo -e "\n=== Testing AES-${key_size}-${mode} ==="
# Generate random key and IV
- key=$($OPENSSL_BIN rand -hex $((key_size/8)))
+ key=$($OPENSSL_BIN rand -hex $((key_size/8)) 2>/dev/null | tail -n 1 | tr -d '\n')
iv=""
if [ "$mode" != "ecb" ]; then
- iv="-iv $($OPENSSL_BIN rand -hex 16)"
+ iv_value=$($OPENSSL_BIN rand -hex 16 2>/dev/null | tail -n 1 | tr -d '\n')
+ iv="-iv $iv_value"
fi
+ echo "DEBUG: Key='$key' (length: ${#key})"
+ echo "DEBUG: IV='$iv'"
# Output files
enc_file="aes_outputs/aes${key_size}_${mode}.enc"
@@ -104,14 +112,14 @@ for key_size in "${KEY_SIZES[@]}"; do
echo "Interop testing (encrypt with default, decrypt with wolfProvider):"
# Encryption with OpenSSL default provider
- if ! $OPENSSL_BIN enc -aes-${key_size}-${mode} -K $key $iv -provider default \
+ if ! $OPENSSL_BIN enc -aes-${key_size}-${mode} -K "$key" $iv -provider default \
-in test.txt -out "$enc_file" -p; then
echo "[FAIL] Interop AES-${key_size}-${mode}: OpenSSL encrypt failed"
FAIL=1
fi
# Decryption with wolfProvider
- if ! $OPENSSL_BIN enc -aes-${key_size}-${mode} -K $key $iv -provider-path $WOLFPROV_PATH -provider libwolfprov \
+ if ! $OPENSSL_BIN enc -aes-${key_size}-${mode} -K "$key" $iv -provider-path "$WOLFPROV_PATH" -provider libwolfprov \
-in "$enc_file" -out "$dec_file" -d -p; then
echo "[FAIL] Interop AES-${key_size}-${mode}: wolfProvider decrypt failed"
FAIL=1
@@ -133,14 +141,14 @@ for key_size in "${KEY_SIZES[@]}"; do
echo "Interop testing (encrypt with wolfProvider, decrypt with default):"
# Encryption with wolfProvider
- if ! $OPENSSL_BIN enc -aes-${key_size}-${mode} -K $key $iv -provider-path $WOLFPROV_PATH -provider libwolfprov \
+ if ! $OPENSSL_BIN enc -aes-${key_size}-${mode} -K "$key" $iv -provider-path "$WOLFPROV_PATH" -provider libwolfprov \
-in test.txt -out "$enc_file" -p; then
echo "[FAIL] Interop AES-${key_size}-${mode}: wolfProvider encrypt failed"
FAIL=1
fi
# Decryption with OpenSSL default provider
- if ! $OPENSSL_BIN enc -aes-${key_size}-${mode} -K $key $iv -provider default \
+ if ! $OPENSSL_BIN enc -aes-${key_size}-${mode} -K "$key" $iv -provider default \
-in "$enc_file" -out "$dec_file" -d -p; then
echo "[FAIL] Interop AES-${key_size}-${mode}: OpenSSL decrypt failed"
FAIL=1
@@ -160,7 +168,7 @@ for key_size in "${KEY_SIZES[@]}"; do
done
done
-if [ $FORCE_FAIL -eq 1 ]; then
+if [ "${WOLFPROV_FORCE_FAIL}" = "1" ]; then
if [ $FORCE_FAIL_PASSED -eq 1 ]; then
echo -e "\n=== AES Tests Failed With Force Fail Enabled ==="
echo "ERROR: Some tests passed when they should have failed"
diff --git a/scripts/cmd_test/do-cmd-tests.sh b/scripts/cmd_test/do-cmd-tests.sh
index 96886203..1a397826 100755
--- a/scripts/cmd_test/do-cmd-tests.sh
+++ b/scripts/cmd_test/do-cmd-tests.sh
@@ -21,9 +21,11 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
# Get the force fail parameter
-FORCE_FAIL=0
-if [ "$1" = "WOLFPROV_FORCE_FAIL=1" ]; then
- FORCE_FAIL=1
+if [ "${WOLFPROV_FORCE_FAIL}" = "1" ]; then
+ echo "Force fail mode enabled for all tests"
+fi
+if [ "${WOLFSSL_ISFIPS}" = "1" ]; then
+ echo "FIPS mode enabled for all tests"
fi
# Get the directory where this script is located
@@ -57,30 +59,46 @@ echo "Using wolfSSL version: ${WOLFSSL_TAG}"
# Run the hash comparison test
echo -e "\n=== Running Hash Comparison Test ==="
-"${REPO_ROOT}/scripts/cmd_test/hash-cmd-test.sh" "$1"
+"${REPO_ROOT}/scripts/cmd_test/hash-cmd-test.sh"
HASH_RESULT=$?
# Run the AES comparison test
echo -e "\n=== Running AES Comparison Test ==="
-"${REPO_ROOT}/scripts/cmd_test/aes-cmd-test.sh" "$1"
+"${REPO_ROOT}/scripts/cmd_test/aes-cmd-test.sh"
AES_RESULT=$?
# Run the RSA key generation test
echo -e "\n=== Running RSA Key Generation Test ==="
-"${REPO_ROOT}/scripts/cmd_test/rsa-cmd-test.sh" "$1"
+"${REPO_ROOT}/scripts/cmd_test/rsa-cmd-test.sh"
RSA_RESULT=$?
# Run the ECC key generation test
echo -e "\n=== Running ECC Key Generation Test ==="
-"${REPO_ROOT}/scripts/cmd_test/ecc-cmd-test.sh" "$1"
+"${REPO_ROOT}/scripts/cmd_test/ecc-cmd-test.sh"
ECC_RESULT=$?
# Check results
if [ $HASH_RESULT -eq 0 ] && [ $AES_RESULT -eq 0 ] && [ $RSA_RESULT -eq 0 ] && [ $ECC_RESULT -eq 0 ]; then
- echo -e "\n=== All Command-Line Tests Passed $1 ==="
+ echo -e "\n=== All Command-Line Tests Passed ==="
+ if [ "${WOLFPROV_FORCE_FAIL}" = "1" ]; then
+ echo "Force fail mode was enabled"
+ fi
+ if [ "${WOLFSSL_ISFIPS}" = "1" ]; then
+ echo "FIPS mode was enabled"
+ fi
+ echo "Hash Test Result: $HASH_RESULT (0=success)"
+ echo "AES Test Result: $AES_RESULT (0=success)"
+ echo "RSA Test Result: $RSA_RESULT (0=success)"
+ echo "ECC Test Result: $ECC_RESULT (0=success)"
exit 0
else
- echo -e "\n=== Command-Line Tests Failed $1 ==="
+ echo -e "\n=== Command-Line Tests Failed ==="
+ if [ "${WOLFPROV_FORCE_FAIL}" = "1" ]; then
+ echo "Force fail mode was enabled"
+ fi
+ if [ "${WOLFSSL_ISFIPS}" = "1" ]; then
+ echo "FIPS mode was enabled"
+ fi
echo "Hash Test Result: $HASH_RESULT (0=success)"
echo "AES Test Result: $AES_RESULT (0=success)"
echo "RSA Test Result: $RSA_RESULT (0=success)"
diff --git a/scripts/cmd_test/ecc-cmd-test.sh b/scripts/cmd_test/ecc-cmd-test.sh
index 9d0e80b6..e58659c5 100755
--- a/scripts/cmd_test/ecc-cmd-test.sh
+++ b/scripts/cmd_test/ecc-cmd-test.sh
@@ -33,19 +33,19 @@ source "${UTILS_DIR}/utils-openssl.sh"
source "${UTILS_DIR}/utils-wolfssl.sh"
source "${UTILS_DIR}/utils-wolfprovider.sh"
-# Initialize the environment
+# Initialize wolfProvider
init_wolfprov
# Fail flags
FAIL=0
-FORCE_FAIL=0
FORCE_FAIL_PASSED=0
-# Check for force fail parameter
-if [ "$1" = "WOLFPROV_FORCE_FAIL=1" ]; then
- export WOLFPROV_FORCE_FAIL=1
- FORCE_FAIL=1
- echo -e "\nForce fail mode enabled for ECC tests"
+# Get the force fail parameter
+if [ "${WOLFPROV_FORCE_FAIL}" = "1" ]; then
+ echo "Force fail mode enabled for ECC tests"
+fi
+if [ "${WOLFSSL_ISFIPS}" = "1" ]; then
+ echo "FIPS mode enabled for ECC tests"
fi
# Verify wolfProvider is properly loaded
@@ -86,7 +86,7 @@ use_wolf_provider() {
# Helper function to handle force fail checks
check_force_fail() {
- if [ $FORCE_FAIL -eq 1 ]; then
+ if [ "${WOLFPROV_FORCE_FAIL}" = "1" ]; then
echo "[PASS] Test passed when force fail was enabled"
FORCE_FAIL_PASSED=1
fi
@@ -306,7 +306,7 @@ for curve in "${CURVES[@]}"; do
done
done
-if [ $FORCE_FAIL -eq 1 ]; then
+if [ "${WOLFPROV_FORCE_FAIL}" = "1" ]; then
if [ $FORCE_FAIL_PASSED -eq 1 ]; then
echo -e "\n=== ECC Tests Failed With Force Fail Enabled ==="
echo "ERROR: Some tests passed when they should have failed"
diff --git a/scripts/cmd_test/hash-cmd-test.sh b/scripts/cmd_test/hash-cmd-test.sh
index e8ea03fc..59a977e7 100755
--- a/scripts/cmd_test/hash-cmd-test.sh
+++ b/scripts/cmd_test/hash-cmd-test.sh
@@ -33,19 +33,19 @@ source "${UTILS_DIR}/utils-openssl.sh"
source "${UTILS_DIR}/utils-wolfssl.sh"
source "${UTILS_DIR}/utils-wolfprovider.sh"
-# Initialize the environment
+# Initialize wolfProvider
init_wolfprov
# Fail flags
FAIL=0
-FORCE_FAIL=0
FORCE_FAIL_PASSED=0
-# Check for force fail parameter
-if [ "$1" = "WOLFPROV_FORCE_FAIL=1" ]; then
- export WOLFPROV_FORCE_FAIL=1
- FORCE_FAIL=1
- echo -e "\nForce fail mode enabled for hash tests"
+# Get the force fail parameter
+if [ "${WOLFPROV_FORCE_FAIL}" = "1" ]; then
+ echo "Force fail mode enabled for Hash tests"
+fi
+if [ "${WOLFSSL_ISFIPS}" = "1" ]; then
+ echo "FIPS mode enabled for Hash tests"
fi
# Verify wolfProvider is properly loaded
@@ -71,7 +71,7 @@ echo "This is test data for hash algorithm testing." > test.txt
# Helper function to handle force fail checks
check_force_fail() {
- if [ $FORCE_FAIL -eq 1 ]; then
+ if [ "${WOLFPROV_FORCE_FAIL}" = "1" ]; then
echo "[PASS] Test passed when force fail was enabled"
FORCE_FAIL_PASSED=1
fi
@@ -146,7 +146,7 @@ for algo in "${HASH_ALGOS[@]}"; do
done
# Modify end of script
-if [ $FORCE_FAIL -eq 1 ]; then
+if [ "${WOLFPROV_FORCE_FAIL}" = "1" ]; then
if [ $FORCE_FAIL_PASSED -eq 1 ]; then
echo -e "\n=== Hash Tests Failed With Force Fail Enabled ==="
echo "ERROR: Some tests passed when they should have failed"
diff --git a/scripts/cmd_test/rsa-cmd-test.sh b/scripts/cmd_test/rsa-cmd-test.sh
index d6feb311..2b497c43 100755
--- a/scripts/cmd_test/rsa-cmd-test.sh
+++ b/scripts/cmd_test/rsa-cmd-test.sh
@@ -33,19 +33,19 @@ source "${UTILS_DIR}/utils-openssl.sh"
source "${UTILS_DIR}/utils-wolfssl.sh"
source "${UTILS_DIR}/utils-wolfprovider.sh"
-# Initialize the environment
+# Initialize wolfProvider
init_wolfprov
# Fail flags
FAIL=0
-FORCE_FAIL=0
FORCE_FAIL_PASSED=0
-# Check for force fail parameter
-if [ "$1" = "WOLFPROV_FORCE_FAIL=1" ]; then
- export WOLFPROV_FORCE_FAIL=1
- FORCE_FAIL=1
- echo -e "\nForce fail mode enabled for RSA tests"
+# Get the force fail parameter
+if [ "${WOLFPROV_FORCE_FAIL}" = "1" ]; then
+ echo "Force fail mode enabled for RSA tests"
+fi
+if [ "${WOLFSSL_ISFIPS}" = "1" ]; then
+ echo "FIPS mode enabled for RSA tests"
fi
# Verify wolfProvider is properly loaded
@@ -86,7 +86,7 @@ use_wolf_provider() {
# Helper function to handle force fail checks
check_force_fail() {
- if [ $FORCE_FAIL -eq 1 ]; then
+ if [ "${WOLFPROV_FORCE_FAIL}" = "1" ]; then
echo "[PASS] Test passed when force fail was enabled"
FORCE_FAIL_PASSED=1
fi
@@ -379,7 +379,7 @@ for key_type in "${KEY_TYPES[@]}"; do
done
done
-if [ $FORCE_FAIL -eq 1 ]; then
+if [ "${WOLFPROV_FORCE_FAIL}" = "1" ]; then
if [ $FORCE_FAIL_PASSED -eq 1 ]; then
echo -e "\n=== RSA Tests Failed With Force Fail Enabled ==="
echo "ERROR: Some tests passed when they should have failed"
diff --git a/scripts/test-openssl.sh b/scripts/test-openssl.sh
index 08445b92..5f5ef8c3 100755
--- a/scripts/test-openssl.sh
+++ b/scripts/test-openssl.sh
@@ -16,16 +16,16 @@
#
# You should have received a copy of the GNU General Public License
# along with wolfProvider. If not, see .
-#
-
-# Execute this script from: wolfProvider
-#set -e
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
NUMCPU=${NUMCPU:-8}
WOLFPROV_DEBUG=${WOLFPROV_DEBUG:-0}
source ${SCRIPT_DIR}/utils-wolfprovider.sh
+if [ "${WOLFSSL_ISFIPS}" = "1" ]; then
+ echo "FIPS mode enabled for openssl tests"
+fi
+
do_cleanup() {
echo "Cleanup"
}
@@ -93,32 +93,57 @@ trap do_trap INT TERM
evp_test_run() {
printf "\tTesting with evp_test:\n"
- EVP_TESTS=(
- evpciph_aes_ccm_cavs.txt
- evpciph_aes_common.txt
- evpciph_aes_wrap.txt
- evpencod.txt
- evpkdf_hkdf.txt
- evpkdf_pbkdf2.txt
- evpkdf_tls11_prf.txt
- evpkdf_tls12_prf.txt
- evpkdf_tls13_kdf.txt
- evpmac_common.txt
- evpmd_md.txt
- evpmd_sha.txt
- evppbe_pbkdf2.txt
- evppbe_pkcs12.txt
- evppkey_dh.txt
- evppkey_ecc.txt
- evppkey_ecdh.txt
- evppkey_ecdsa.txt
- evppkey_ecx.txt
- evppkey_ffdhe.txt
- evppkey_kas.txt
- evppkey_kdf_hkdf.txt
- evppkey_kdf_tls1_prf.txt
- evppkey_mismatch.txt
- )
+
+ # FIPS-approved evp tests - exclude non-FIPS algorithms in FIPS mode
+ if [ "${WOLFSSL_ISFIPS}" = "1" ]; then
+ echo "FIPS mode enabled - using FIPS-approved evp tests only"
+ EVP_TESTS=(
+ evpciph_aes_ccm_cavs.txt
+ evpciph_aes_common.txt
+ evpkdf_hkdf.txt
+ evpkdf_pbkdf2.txt
+ evpkdf_tls12_prf.txt
+ evpkdf_tls13_kdf.txt
+ evpmac_common.txt
+ evpmd_sha.txt
+ evppbe_pbkdf2.txt
+ evppkey_ecc.txt
+ evppkey_ecdh.txt
+ evppkey_ecdsa.txt
+ evppkey_ffdhe.txt
+ evppkey_kas.txt
+ evppkey_kdf_hkdf.txt
+ evppkey_kdf_tls1_prf.txt
+ )
+ else
+ echo "Normal mode - using all evp tests"
+ EVP_TESTS=(
+ evpciph_aes_ccm_cavs.txt
+ evpciph_aes_common.txt
+ evpciph_aes_wrap.txt
+ evpencod.txt
+ evpkdf_hkdf.txt
+ evpkdf_pbkdf2.txt
+ evpkdf_tls11_prf.txt
+ evpkdf_tls12_prf.txt
+ evpkdf_tls13_kdf.txt
+ evpmac_common.txt
+ evpmd_md.txt
+ evpmd_sha.txt
+ evppbe_pbkdf2.txt
+ evppbe_pkcs12.txt
+ evppkey_dh.txt
+ evppkey_ecc.txt
+ evppkey_ecdh.txt
+ evppkey_ecdsa.txt
+ evppkey_ecx.txt
+ evppkey_ffdhe.txt
+ evppkey_kas.txt
+ evppkey_kdf_hkdf.txt
+ evppkey_kdf_tls1_prf.txt
+ evppkey_mismatch.txt
+ )
+ fi
for T in ${EVP_TESTS[@]}
do
diff --git a/scripts/test-sanity.sh b/scripts/test-sanity.sh
index ab582009..53cc7d0d 100755
--- a/scripts/test-sanity.sh
+++ b/scripts/test-sanity.sh
@@ -1,4 +1,22 @@
#!/bin/bash
+#
+# Copyright (C) 2006-2024 wolfSSL Inc.
+#
+# This file is part of wolfProvider.
+#
+# wolfProvider is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# wolfProvider is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with wolfProvider. If not, see .
+#
# This script provides simple sanity checks to make sure the provider is working
SET_PRE=$( set )
@@ -7,6 +25,10 @@ LOG_FILE=${SCRIPT_DIR}/test-sanity.log
rm -f ${LOG_FILE}
source ${SCRIPT_DIR}/utils-wolfprovider.sh
+if [ "${WOLFSSL_ISFIPS}" = "1" ]; then
+ echo "FIPS mode enabled for sanity tests"
+fi
+
echo "Using openssl: $OPENSSL_TAG, wolfssl: $WOLFSSL_TAG"
function doTestCmd() {
diff --git a/scripts/test-wp-cs.sh b/scripts/test-wp-cs.sh
index 890fbdd8..a577405a 100755
--- a/scripts/test-wp-cs.sh
+++ b/scripts/test-wp-cs.sh
@@ -16,11 +16,15 @@
#
# You should have received a copy of the GNU General Public License
# along with wolfProvider. If not, see .
-#
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
NUMCPU=${NUMCPU:-8}
WOLFPROV_DEBUG=${WOLFPROV_DEBUG:-0}
+
+if [ "${WOLFSSL_ISFIPS}" = "1" ]; then
+ echo "FIPS mode enabled for wp-cs tests"
+fi
+
source ${SCRIPT_DIR}/utils-wolfprovider.sh
source ${SCRIPT_DIR}/utils-openssl.sh
@@ -69,6 +73,11 @@ TLS13_CIPHERS=(
TLS_AES_128_CCM_SHA256
# TLS_AES_128_CCM_8_SHA256
)
+# FIPS-approved TLS 1.3 cipher suites
+TLS13_FIPS_CIPHERS=(
+ TLS_AES_256_GCM_SHA384
+ TLS_AES_128_GCM_SHA256
+)
TLS12_CIPHERS=(
ECDHE-ECDSA-AES256-GCM-SHA384
ECDHE-RSA-AES256-GCM-SHA384
@@ -107,6 +116,31 @@ TLS12_CIPHERS=(
AES256-SHA
AES128-SHA
)
+# FIPS-approved TLS 1.2 cipher suites
+TLS12_FIPS_CIPHERS=(
+ ECDHE-ECDSA-AES256-GCM-SHA384
+ ECDHE-RSA-AES256-GCM-SHA384
+ DHE-RSA-AES256-GCM-SHA384
+ ECDHE-ECDSA-AES128-GCM-SHA256
+ ECDHE-RSA-AES128-GCM-SHA256
+ DHE-RSA-AES128-GCM-SHA256
+ ECDHE-ECDSA-AES256-CCM
+ DHE-RSA-AES256-CCM
+ ECDHE-ECDSA-AES128-CCM
+ DHE-RSA-AES128-CCM
+ ECDHE-ECDSA-AES256-SHA384
+ ECDHE-RSA-AES256-SHA384
+ DHE-RSA-AES256-SHA256
+ ECDHE-ECDSA-AES128-SHA256
+ ECDHE-RSA-AES128-SHA256
+ DHE-RSA-AES128-SHA256
+ AES256-GCM-SHA384
+ AES128-GCM-SHA256
+ AES256-CCM
+ AES128-CCM
+ AES256-SHA256
+ AES128-SHA256
+)
TLS1_CIPHERS=(
ECDHE-RSA-AES256-SHA
ECDHE-ECDSA-AES256-SHA
@@ -206,15 +240,26 @@ do_client_test() { # usage: do_client_test [extraArgs]
# do_client "$1"
# done
+ # Select cipher suites based on FIPS mode
+ if [ "${WOLFSSL_ISFIPS}" = "1" ]; then
+ echo "FIPS mode enabled - using FIPS-approved cipher suites only" | tee -a $LOG_FILE
+ TLS12_TEST_CIPHERS=("${TLS12_FIPS_CIPHERS[@]}")
+ TLS13_TEST_CIPHERS=("${TLS13_FIPS_CIPHERS[@]}")
+ else
+ echo "Normal mode - using all cipher suites" | tee -a $LOG_FILE
+ TLS12_TEST_CIPHERS=("${TLS12_CIPHERS[@]}")
+ TLS13_TEST_CIPHERS=("${TLS13_CIPHERS[@]}")
+ fi
+
TLS_VERSION=-tls1_2
printf "\t$TLS_VERSION\n" | tee -a $LOG_FILE
- for CIPHER in ${TLS12_CIPHERS[@]}; do
+ for CIPHER in ${TLS12_TEST_CIPHERS[@]}; do
do_client "$1"
done
TLS_VERSION=-tls1_3
printf "\t$TLS_VERSION\n" | tee -a $LOG_FILE
- for CIPHER in ${TLS13_CIPHERS[@]}; do
+ for CIPHER in ${TLS13_TEST_CIPHERS[@]}; do
do_client "$1"
done
}
@@ -227,7 +272,7 @@ OPENSSL_ALL_CIPHERS="-cipher ALL -ciphersuites $TLS13_ALL_CIPHERS"
OPENSSL_PORT=$(generate_port)
# ensure we are doing a clean build
-printf "Cleaning up previous builds"
+printf "Cleaning up previous builds\n"
rm -rf ${SCRIPT_DIR}/../*-install
if [ -d ${OPENSSL_SOURCE_DIR} ]; then
pushd ${OPENSSL_SOURCE_DIR} > /dev/null
diff --git a/scripts/utils-wolfprovider.sh b/scripts/utils-wolfprovider.sh
index c3fe3824..f268f524 100755
--- a/scripts/utils-wolfprovider.sh
+++ b/scripts/utils-wolfprovider.sh
@@ -106,7 +106,14 @@ install_wolfprov() {
}
init_wolfprov() {
- install_wolfprov
+ # Unset WPFF so we dont fail unit test when building
+ if [ "${WOLFPROV_FORCE_FAIL}" = "1" ]; then
+ unset WOLFPROV_FORCE_FAIL
+ install_wolfprov
+ export WOLFPROV_FORCE_FAIL=1
+ else
+ install_wolfprov
+ fi
printf "\twolfProvider installed in: ${WOLFPROV_INSTALL_DIR}\n"
export OPENSSL_MODULES=$WOLFPROV_PATH