From 3c64731c4f5df5fedba51a8c50410e4d29979a3d Mon Sep 17 00:00:00 2001 From: Juliusz Sosinowicz Date: Tue, 8 Mar 2022 14:52:40 +0100 Subject: [PATCH] Don't force a ECC CA when a custom CA is passed with `-A` The following config would fail `../configure --enable-opensslall CFLAGS="-DOPENSSL_COMPATIBLE_DEFAULTS" && make -j check`. This is because `test-fails.conf` `ECC no signer error` test expects a failure while the ECC CA was being added as a trusted cert due to `OPENSSL_COMPATIBLE_DEFAULTS`. --- examples/client/client.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/client/client.c b/examples/client/client.c index 86e8ecb29..f0a653167 100644 --- a/examples/client/client.c +++ b/examples/client/client.c @@ -1927,6 +1927,7 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args) unsigned char alpn_opt = 0; char* cipherList = NULL; int useDefCipherList = 0; + int customVerifyCert = 0; const char* verifyCert; const char* ourCert; const char* ourKey; @@ -2060,6 +2061,7 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args) (void)resumeScr; (void)ourKey; (void)ourCert; + (void)customVerifyCert; (void)verifyCert; (void)useClientCert; (void)disableCRL; @@ -2284,6 +2286,7 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args) break; case 'A' : + customVerifyCert = 1; verifyCert = myoptarg; break; @@ -3179,7 +3182,7 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args) err_sys("can't load ecc ca buffer"); } #elif !defined(TEST_LOAD_BUFFER) - if (doPeerCheck != 0 && + if (doPeerCheck != 0 && !customVerifyCert && wolfSSL_CTX_load_verify_locations_ex(ctx, eccCertFile, 0, verify_flags) != WOLFSSL_SUCCESS) { wolfSSL_CTX_free(ctx); ctx = NULL;