@@ -95,15 +95,30 @@ use_default_provider() {
9595 unset OPENSSL_CONF
9696 unset OPENSSL_MODULES
9797 fi
98-
98+
9999 # Re-detect after disabling
100100 detect_wolfprovider_mode
101101
102102 # Verify that we are using the OpenSSL default provider (not wolfProvider)
103103 if [ " $is_openssl_default_provider " != " 1" ]; then
104- echo " FAIL: unable to switch to default provider, wolfProvider is still active"
105- echo " is_openssl_default_provider: $is_openssl_default_provider "
106- exit 1
104+ # If we can't switch, this indicates replace-default mode
105+ # Check if wolfProvider is still active - if so, we're in replace-default mode
106+ if [ " $is_wp_active " = " 1" ]; then
107+ echo " INFO: Cannot switch to OpenSSL default provider - detected replace-default mode"
108+ echo " INFO: Setting is_openssl_replace_default=1 for remaining tests"
109+ is_openssl_replace_default=1
110+ is_wp_default=1
111+ export is_openssl_replace_default
112+ export is_wp_default
113+ # Also set the environment variable for child processes
114+ export WOLFPROV_REPLACE_DEFAULT=1
115+ return 0 # Return success - this is expected in replace-default mode
116+ else
117+ echo " FAIL: unable to switch to default provider, and wolfProvider is not active"
118+ echo " is_openssl_default_provider: $is_openssl_default_provider "
119+ echo " is_wp_active: $is_wp_active "
120+ exit 1
121+ fi
107122 fi
108123 echo " INFO: Switched to OpenSSL default provider"
109124 return 0
@@ -240,3 +255,12 @@ use_provider_by_name() {
240255 use_default_provider
241256 fi
242257}
258+
259+ # Check if we can perform provider comparison tests
260+ # Returns 0 if comparison possible (normal mode), 1 if replace-default mode (no comparison)
261+ can_compare_providers () {
262+ if [ " $is_openssl_replace_default " = " 1" ] || [ " ${WOLFPROV_REPLACE_DEFAULT:- 0} " = " 1" ]; then
263+ return 1 # Cannot compare - replace-default mode
264+ fi
265+ return 0 # Can compare - normal mode
266+ }
0 commit comments