Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CRL_REPORT_LOAD_ERRORS option #6591

Merged
merged 1 commit into from
Jul 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion src/crl.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ CRL Options:
* CRL_MAX_REVOKED_CERTS: default: 4
* Specifies the number of buffers to hold RevokedCerts.
* The default value is set to 4.
* CRL_REPORT_LOAD_ERRORS: default: off
* Return any errors encountered during loading CRL
* from a directory.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
Expand Down Expand Up @@ -1562,15 +1565,27 @@ int LoadCRL(WOLFSSL_CRL* crl, const char* path, int type, int monitor)
}
}

#ifndef CRL_REPORT_LOAD_ERRORS
if (!skip && ProcessFile(NULL, name, type, CRL_TYPE, NULL, 0, crl,
VERIFY) != WOLFSSL_SUCCESS) {
WOLFSSL_MSG("CRL file load failed, continuing");
}
#else
if (!skip) {
ret = ProcessFile(NULL, name, type, CRL_TYPE, NULL, 0, crl, VERIFY);
if (ret != WOLFSSL_SUCCESS) {
WOLFSSL_MSG("CRL file load failed");
return ret;
}
}
#endif

ret = wc_ReadDirNext(readCtx, path, &name);
}
wc_ReadDirClose(readCtx);
ret = WOLFSSL_SUCCESS; /* load failures not reported, for backwards compat */

/* load failures not reported, for backwards compat */
ret = WOLFSSL_SUCCESS;

#ifdef WOLFSSL_SMALL_STACK
XFREE(readCtx, crl->heap, DYNAMIC_TYPE_TMP_BUFFER);
Expand Down