Skip to content

Commit 7fbb209

Browse files
committed
ssl.c: in wolfSSL_Init(), fix cppcheck identicalInnerCondition warning on non-FIPS configurations.
1 parent efda4b5 commit 7fbb209

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

src/ssl.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6244,20 +6244,20 @@ int wolfSSL_Init(void)
62446244
return BAD_MUTEX_E;
62456245
}
62466246

6247-
if ((ret == WOLFSSL_SUCCESS) && (initRefCount == 0)) {
6248-
/* Initialize crypto for use with TLS connection */
6249-
62506247
#if FIPS_VERSION_GE(5,1)
6248+
if ((ret == WOLFSSL_SUCCESS) && (initRefCount == 0)) {
62516249
ret = wolfCrypt_SetPrivateKeyReadEnable_fips(1, WC_KEYTYPE_ALL);
62526250
if (ret == 0)
62536251
ret = WOLFSSL_SUCCESS;
6252+
}
62546253
#endif
62556254

6256-
if (ret == WOLFSSL_SUCCESS) {
6257-
if (wolfCrypt_Init() != 0) {
6258-
WOLFSSL_MSG("Bad wolfCrypt Init");
6259-
ret = WC_INIT_E;
6260-
}
6255+
if ((ret == WOLFSSL_SUCCESS) && (initRefCount == 0)) {
6256+
/* Initialize crypto for use with TLS connection */
6257+
6258+
if (wolfCrypt_Init() != 0) {
6259+
WOLFSSL_MSG("Bad wolfCrypt Init");
6260+
ret = WC_INIT_E;
62616261
}
62626262

62636263
#if defined(HAVE_GLOBAL_RNG) && !defined(WOLFSSL_MUTEX_INITIALIZER)

0 commit comments

Comments
 (0)