Skip to content

Commit d53abc2

Browse files
authored
Merge pull request #7441 from kareem-wolfssl/zd17857
Allow using wolfSSL_CTX_set_default_verify_paths without WOLFSSL_SYS_CA_CERTS defined.
2 parents ac17616 + c1f23cc commit d53abc2

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/ssl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19614,7 +19614,7 @@ long wolfSSL_CTX_ctrl(WOLFSSL_CTX* ctx, int cmd, long opt, void* pt)
1961419614
return ret;
1961519615
}
1961619616

19617-
#ifndef WOLFSSL_NO_STUB
19617+
#ifndef NO_WOLFSSL_STUB
1961819618
long wolfSSL_CTX_callback_ctrl(WOLFSSL_CTX* ctx, int cmd, void (*fp)(void))
1961919619
{
1962019620
(void) ctx;
@@ -19624,7 +19624,7 @@ long wolfSSL_CTX_callback_ctrl(WOLFSSL_CTX* ctx, int cmd, void (*fp)(void))
1962419624
return WOLFSSL_FAILURE;
1962519625

1962619626
}
19627-
#endif /* WOLFSSL_NO_STUB */
19627+
#endif /* NO_WOLFSSL_STUB */
1962819628

1962919629
#ifndef NO_WOLFSSL_STUB
1963019630
long wolfSSL_CTX_clear_extra_chain_certs(WOLFSSL_CTX* ctx)

src/ssl_load.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5029,8 +5029,6 @@ int wolfSSL_CTX_use_RSAPrivateKey(WOLFSSL_CTX* ctx, WOLFSSL_RSA* rsa)
50295029

50305030
#ifdef OPENSSL_EXTRA
50315031

5032-
#ifdef WOLFSSL_SYS_CA_CERTS
5033-
50345032
/* Use the default paths to look for CA certificate.
50355033
*
50365034
* This is an OpenSSL compatibility layer function, but it doesn't mirror
@@ -5089,7 +5087,7 @@ int wolfSSL_CTX_set_default_verify_paths(WOLFSSL_CTX* ctx)
50895087
WOLFSSL_MSG("wolfSSL_CTX_set_default_verify_paths not supported"
50905088
" with NO_FILESYSTEM enabled");
50915089
ret = WOLFSSL_FATAL_ERROR;
5092-
#else
5090+
#elif defined(WOLFSSL_SYS_CA_CERTS)
50935091
/* Load the system CA certificates. */
50945092
ret = wolfSSL_CTX_load_system_CA_certs(ctx);
50955093
if (ret == WOLFSSL_BAD_PATH) {
@@ -5098,6 +5096,10 @@ int wolfSSL_CTX_set_default_verify_paths(WOLFSSL_CTX* ctx)
50985096
*/
50995097
ret = 1;
51005098
}
5099+
#else
5100+
/* OpenSSL's implementation of this API does not require loading the
5101+
system CA cert directory. Allow skipping this without erroring out. */
5102+
ret = 1;
51015103
#endif
51025104
}
51035105

@@ -5106,8 +5108,6 @@ int wolfSSL_CTX_set_default_verify_paths(WOLFSSL_CTX* ctx)
51065108
return ret;
51075109
}
51085110

5109-
#endif /* WOLFSSL_SYS_CA_CERTS */
5110-
51115111
#endif /* OPENSSL_EXTRA */
51125112

51135113
#ifndef NO_DH

0 commit comments

Comments
 (0)