@@ -93692,6 +93692,40 @@ static int test_revoked_loaded_int_cert_ctx_ready2(WOLFSSL_CTX* ctx)
9369293692 WOLFSSL_FILETYPE_PEM), WOLFSSL_SUCCESS);
9369393693 return EXPECT_RESULT();
9369493694}
93695+
93696+ static int test_revoked_loaded_int_cert_ctx_ready3_crl_missing_cb(int ret,
93697+ WOLFSSL_CRL* crl, WOLFSSL_CERT_MANAGER* cm, void* ctx)
93698+ {
93699+ (void)crl;
93700+ (void)cm;
93701+ (void)ctx;
93702+ if (ret == WC_NO_ERR_TRACE(CRL_MISSING))
93703+ return 1;
93704+ return 0;
93705+ }
93706+
93707+ /* Here we are allowing missing CRL's but want to error out when its revoked */
93708+ static int test_revoked_loaded_int_cert_ctx_ready3(WOLFSSL_CTX* ctx)
93709+ {
93710+ EXPECT_DECLS;
93711+ wolfSSL_CTX_set_verify(ctx, WOLFSSL_VERIFY_PEER, myVerify);
93712+ myVerifyAction = VERIFY_USE_PREVERFIY;
93713+ ExpectIntEQ(wolfSSL_CTX_load_verify_locations_ex(ctx,
93714+ "./certs/ca-cert.pem", NULL, 0), WOLFSSL_SUCCESS);
93715+ ExpectIntEQ(wolfSSL_CTX_load_verify_locations_ex(ctx,
93716+ "./certs/intermediate/ca-int-cert.pem", NULL, 0), WOLFSSL_SUCCESS);
93717+ ExpectIntEQ(wolfSSL_CTX_load_verify_locations_ex(ctx,
93718+ "./certs/intermediate/ca-int2-cert.pem", NULL, 0), WOLFSSL_SUCCESS);
93719+ ExpectIntEQ(wolfSSL_CTX_EnableCRL(ctx, WOLFSSL_CRL_CHECKALL),
93720+ WOLFSSL_SUCCESS);
93721+ ExpectIntEQ(wolfSSL_CTX_LoadCRLFile(ctx,
93722+ "./certs/crl/extra-crls/ca-int-cert-revoked.pem",
93723+ WOLFSSL_FILETYPE_PEM), WOLFSSL_SUCCESS);
93724+ ExpectIntEQ(wolfSSL_CTX_SetCRL_ErrorCb(ctx,
93725+ test_revoked_loaded_int_cert_ctx_ready3_crl_missing_cb, NULL),
93726+ WOLFSSL_SUCCESS);
93727+ return EXPECT_RESULT();
93728+ }
9369593729#endif
9369693730
9369793731static int test_revoked_loaded_int_cert(void)
@@ -93713,6 +93747,8 @@ static int test_revoked_loaded_int_cert(void)
9371393747 "./certs/server-key.pem", test_revoked_loaded_int_cert_ctx_ready2},
9371493748 {"./certs/intermediate/server-chain-short.pem",
9371593749 "./certs/server-key.pem", test_revoked_loaded_int_cert_ctx_ready2},
93750+ {"./certs/intermediate/server-chain-short.pem",
93751+ "./certs/server-key.pem", test_revoked_loaded_int_cert_ctx_ready3},
9371693752 };
9371793753 size_t i;
9371893754
0 commit comments