From d9a6484b7514cdd24514f150096dfa551d315d02 Mon Sep 17 00:00:00 2001 From: David Garske Date: Thu, 6 Sep 2018 13:01:44 -0700 Subject: [PATCH] Fix to improve return code logic in `wolfSSL_CTX_load_verify_locations_ex`. --- src/ssl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ssl.c b/src/ssl.c index 0e14a19e8..f673f427e 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -5800,9 +5800,9 @@ int wolfSSL_CTX_load_verify_locations_ex(WOLFSSL_CTX* ctx, const char* file, if (fileRet != WC_READDIR_NOFILE) { ret = fileRet; } - else if (file == NULL && (successCount == 0 || failCount > 0)) { - /* report failure if no files were loaded or there were failures */ - /* pass on existing error code if exists */ + /* report failure if no files were loaded or there were failures */ + else if (successCount == 0 || failCount > 0) { + /* use existing error code if exists */ if (ret == WOLFSSL_SUCCESS) ret = WOLFSSL_FAILURE; }