Skip to content

Commit a640fb3

Browse files
committed
Add error messages on FIPS CAST errors
1 parent 1a9f759 commit a640fb3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/wp_wolfprov.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1316,13 +1316,19 @@ int wolfssl_provider_init(const OSSL_CORE_HANDLE* handle,
13161316
/* To avoid multi-threading issues in FIPS CAST tests, run all tests
13171317
* under a lock now */
13181318
if (wp_lock(wp_get_cast_mutex()) != 1) {
1319+
WOLFPROV_ERROR_MSG(WP_LOG_COMP_PROVIDER,
1320+
"Fatal Error: unable to acquire FIPS CAST lock");
13191321
ok = 0;
13201322
}
13211323
if (ok) {
13221324
if (wc_RunAllCast_fips() != 0) {
1325+
WOLFPROV_ERROR_MSG(WP_LOG_COMP_PROVIDER,
1326+
"Fatal Error: FIPS algo selftest failure");
1327+
ok = 0;
1328+
}
1329+
if (wp_unlock(wp_get_cast_mutex()) != 1) {
13231330
ok = 0;
13241331
}
1325-
wp_unlock(wp_get_cast_mutex());
13261332
}
13271333
#endif
13281334
}

0 commit comments

Comments
 (0)