Skip to content

Commit 6566e38

Browse files
authored
Merge pull request #156 from ColtonWilley/wp_allow_mismatch_debug
Allow wolfProvider to be built with debug when wolfSSL is not built with debug
2 parents 6e16754 + 0d1ed2e commit 6566e38

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

src/wp_wolfprov.c

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1191,8 +1191,17 @@ int wolfssl_provider_init(const OSSL_CORE_HANDLE* handle,
11911191
OSSL_FUNC_core_get_libctx_fn* c_get_libctx = NULL;
11921192

11931193
#ifdef WOLFPROV_DEBUG
1194-
ok = (wolfProv_Debugging_ON() == 0) && (wolfSSL_Debugging_ON() == 0);
1195-
wolfSSL_SetLoggingPrefix("wolfSSL");
1194+
ok = (wolfProv_Debugging_ON() == 0);
1195+
if (ok) {
1196+
if (wolfSSL_Debugging_ON() != 0) {
1197+
WOLFPROV_MSG(WP_LOG_PROVIDER,
1198+
"WARNING: wolfProvider built with debug but underlying wolfSSL is not!"
1199+
"Building wolfSSl with debug is highly recommended, proceeding...");
1200+
}
1201+
else {
1202+
wolfSSL_SetLoggingPrefix("wolfSSL");
1203+
}
1204+
}
11961205
#endif
11971206

11981207
#ifdef HAVE_FIPS
@@ -1204,8 +1213,8 @@ int wolfssl_provider_init(const OSSL_CORE_HANDLE* handle,
12041213
#if defined(XGETENV) && !defined(NO_GETENV)
12051214
forceFailEnv = XGETENV("WOLFPROV_FORCE_FAIL");
12061215
if (forceFailEnv != NULL && XATOI(forceFailEnv) == 1) {
1207-
WOLFPROV_MSG(WP_LOG_PROVIDER, "WOLFPROV_FORCE_FAIL=1, Forcing failure\n");
1208-
forceFail = 1;
1216+
WOLFPROV_MSG(WP_LOG_PROVIDER, "WOLFPROV_FORCE_FAIL=1, Forcing failure\n");
1217+
forceFail = 1;
12091218
}
12101219
#else
12111220
#error "Force failure check enabled but impossible to perform without XGETENV, use -DWP_NO_FORCE_FAIL"

0 commit comments

Comments
 (0)