@@ -93450,6 +93450,40 @@ static int test_revoked_loaded_int_cert_ctx_ready2(WOLFSSL_CTX* ctx)
9345093450 WOLFSSL_FILETYPE_PEM), WOLFSSL_SUCCESS);
9345193451 return EXPECT_RESULT();
9345293452}
93453+
93454+ static int test_revoked_loaded_int_cert_ctx_ready3_crl_missing_cb(int ret,
93455+ WOLFSSL_CRL* crl, WOLFSSL_CERT_MANAGER* cm, void* ctx)
93456+ {
93457+ (void)crl;
93458+ (void)cm;
93459+ (void)ctx;
93460+ if (ret == WC_NO_ERR_TRACE(CRL_MISSING))
93461+ return 1;
93462+ return 0;
93463+ }
93464+
93465+ /* Here we are allowing missing CRL's but want to error out when its revoked */
93466+ static int test_revoked_loaded_int_cert_ctx_ready3(WOLFSSL_CTX* ctx)
93467+ {
93468+ EXPECT_DECLS;
93469+ wolfSSL_CTX_set_verify(ctx, WOLFSSL_VERIFY_PEER, myVerify);
93470+ myVerifyAction = VERIFY_USE_PREVERFIY;
93471+ ExpectIntEQ(wolfSSL_CTX_load_verify_locations_ex(ctx,
93472+ "./certs/ca-cert.pem", NULL, 0), WOLFSSL_SUCCESS);
93473+ ExpectIntEQ(wolfSSL_CTX_load_verify_locations_ex(ctx,
93474+ "./certs/intermediate/ca-int-cert.pem", NULL, 0), WOLFSSL_SUCCESS);
93475+ ExpectIntEQ(wolfSSL_CTX_load_verify_locations_ex(ctx,
93476+ "./certs/intermediate/ca-int2-cert.pem", NULL, 0), WOLFSSL_SUCCESS);
93477+ ExpectIntEQ(wolfSSL_CTX_EnableCRL(ctx, WOLFSSL_CRL_CHECKALL),
93478+ WOLFSSL_SUCCESS);
93479+ ExpectIntEQ(wolfSSL_CTX_LoadCRLFile(ctx,
93480+ "./certs/crl/extra-crls/ca-int-cert-revoked.pem",
93481+ WOLFSSL_FILETYPE_PEM), WOLFSSL_SUCCESS);
93482+ ExpectIntEQ(wolfSSL_CTX_SetCRL_ErrorCb(ctx,
93483+ test_revoked_loaded_int_cert_ctx_ready3_crl_missing_cb, NULL),
93484+ WOLFSSL_SUCCESS);
93485+ return EXPECT_RESULT();
93486+ }
9345393487#endif
9345493488
9345593489static int test_revoked_loaded_int_cert(void)
@@ -93471,6 +93505,8 @@ static int test_revoked_loaded_int_cert(void)
9347193505 "./certs/server-key.pem", test_revoked_loaded_int_cert_ctx_ready2},
9347293506 {"./certs/intermediate/server-chain-short.pem",
9347393507 "./certs/server-key.pem", test_revoked_loaded_int_cert_ctx_ready2},
93508+ {"./certs/intermediate/server-chain-short.pem",
93509+ "./certs/server-key.pem", test_revoked_loaded_int_cert_ctx_ready3},
9347493510 };
9347593511 size_t i;
9347693512
0 commit comments