Skip to content

Commit f9cb956

Browse files
committed
Add CRL_REPORT_LOAD_ERRORS option
1 parent 477e65e commit f9cb956

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

src/crl.c

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ CRL Options:
2828
* CRL_MAX_REVOKED_CERTS: default: 4
2929
* Specifies the number of buffers to hold RevokedCerts.
3030
* The default value is set to 4.
31+
* CRL_REPORT_LOAD_ERRORS: default: off
32+
* Return any errors encountered during loading CRL
33+
* from a directory.
3134
*/
3235
#ifdef HAVE_CONFIG_H
3336
#include <config.h>
@@ -1562,15 +1565,27 @@ int LoadCRL(WOLFSSL_CRL* crl, const char* path, int type, int monitor)
15621565
}
15631566
}
15641567

1568+
#ifndef CRL_REPORT_LOAD_ERRORS
15651569
if (!skip && ProcessFile(NULL, name, type, CRL_TYPE, NULL, 0, crl,
15661570
VERIFY) != WOLFSSL_SUCCESS) {
15671571
WOLFSSL_MSG("CRL file load failed, continuing");
15681572
}
1573+
#else
1574+
if (!skip) {
1575+
ret = ProcessFile(NULL, name, type, CRL_TYPE, NULL, 0, crl, VERIFY);
1576+
if (ret != WOLFSSL_SUCCESS) {
1577+
WOLFSSL_MSG("CRL file load failed");
1578+
return ret;
1579+
}
1580+
}
1581+
#endif
15691582

15701583
ret = wc_ReadDirNext(readCtx, path, &name);
15711584
}
15721585
wc_ReadDirClose(readCtx);
1573-
ret = WOLFSSL_SUCCESS; /* load failures not reported, for backwards compat */
1586+
1587+
/* load failures not reported, for backwards compat */
1588+
ret = WOLFSSL_SUCCESS;
15741589

15751590
#ifdef WOLFSSL_SMALL_STACK
15761591
XFREE(readCtx, crl->heap, DYNAMIC_TYPE_TMP_BUFFER);

0 commit comments

Comments
 (0)