mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 10:47:28 +02:00
add LOAD flag to be compliant with OpenSSL
This commit is contained in:
19
src/ssl.c
19
src/ssl.c
@ -6896,15 +6896,30 @@ int wolfSSL_CTX_load_verify_locations_ex(WOLFSSL_CTX* ctx, const char* file,
|
|||||||
if (fileRet != WC_READDIR_NOFILE) {
|
if (fileRet != WC_READDIR_NOFILE) {
|
||||||
ret = fileRet;
|
ret = fileRet;
|
||||||
#if defined(WOLFSSL_QT)
|
#if defined(WOLFSSL_QT)
|
||||||
/* qssl socket wants to know errors. */
|
if (ret == BAD_PATH_ERROR &&
|
||||||
WOLFSSL_ERROR(ret);
|
flags & WOLFSSL_LOAD_FLAG_IGNORE_BAD_PATH_ERR) {
|
||||||
|
/* QSslSocket always loads certs in system folder
|
||||||
|
* when it is initialized.
|
||||||
|
* Compliant with OpenSSL when flag sets.*/
|
||||||
|
ret = WOLFSSL_SUCCESS;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
/* qssl socket wants to know errors. */
|
||||||
|
WOLFSSL_ERROR(ret);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
/* report failure if no files were loaded or there were failures */
|
/* report failure if no files were loaded or there were failures */
|
||||||
else if (successCount == 0 || failCount > 0) {
|
else if (successCount == 0 || failCount > 0) {
|
||||||
/* use existing error code if exists */
|
/* use existing error code if exists */
|
||||||
|
#if defined(WOLFSSL_QT)
|
||||||
|
/* compliant with OpenSSL when flag sets*/
|
||||||
|
if (!(flags & WOLFSSL_LOAD_FLAG_IGNORE_ZEROFILE)) {
|
||||||
|
#endif
|
||||||
if (ret == WOLFSSL_SUCCESS)
|
if (ret == WOLFSSL_SUCCESS)
|
||||||
ret = WOLFSSL_FAILURE;
|
ret = WOLFSSL_FAILURE;
|
||||||
|
#if defined(WOLFSSL_QT)
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ret = WOLFSSL_SUCCESS;
|
ret = WOLFSSL_SUCCESS;
|
||||||
|
@ -876,6 +876,10 @@ WOLFSSL_ABI WOLFSSL_API int wolfSSL_CTX_use_PrivateKey_file(WOLFSSL_CTX*,
|
|||||||
#define WOLFSSL_LOAD_FLAG_IGNORE_ERR 0x00000001
|
#define WOLFSSL_LOAD_FLAG_IGNORE_ERR 0x00000001
|
||||||
#define WOLFSSL_LOAD_FLAG_DATE_ERR_OKAY 0x00000002
|
#define WOLFSSL_LOAD_FLAG_DATE_ERR_OKAY 0x00000002
|
||||||
#define WOLFSSL_LOAD_FLAG_PEM_CA_ONLY 0x00000004
|
#define WOLFSSL_LOAD_FLAG_PEM_CA_ONLY 0x00000004
|
||||||
|
#if defined(WOLFSSL_QT)
|
||||||
|
#define WOLFSSL_LOAD_FLAG_IGNORE_BAD_PATH_ERR 0x00000008
|
||||||
|
#define WOLFSSL_LOAD_FLAG_IGNORE_ZEROFILE 0x00000010
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef WOLFSSL_LOAD_VERIFY_DEFAULT_FLAGS
|
#ifndef WOLFSSL_LOAD_VERIFY_DEFAULT_FLAGS
|
||||||
#define WOLFSSL_LOAD_VERIFY_DEFAULT_FLAGS WOLFSSL_LOAD_FLAG_NONE
|
#define WOLFSSL_LOAD_VERIFY_DEFAULT_FLAGS WOLFSSL_LOAD_FLAG_NONE
|
||||||
|
Reference in New Issue
Block a user