int idx;
switch (operation) {
+ case ASN1_OP_D2I_PRE:
+ if (crl->meth->crl_free) {
+ if (!crl->meth->crl_free(crl))
+ return 0;
+ }
+ AUTHORITY_KEYID_free(crl->akid);
+ ISSUING_DIST_POINT_free(crl->idp);
+ ASN1_INTEGER_free(crl->crl_number);
+ ASN1_INTEGER_free(crl->base_crl_number);
+ sk_GENERAL_NAMES_pop_free(crl->issuers, GENERAL_NAMES_free);
+ /* fall thru */
+
case ASN1_OP_NEW_POST:
crl->idp = NULL;
crl->akid = NULL;
return r;
}
+static int test_reuse_crl(void)
+{
+ X509_CRL *reused_crl = CRL_from_strings(kBasicCRL);
+ char *p;
+ BIO *b = glue2bio(kRevokedCRL, &p);
+
+ reused_crl = PEM_read_bio_X509_CRL(b, &reused_crl, NULL, NULL);
+
+ OPENSSL_free(p);
+ BIO_free(b);
+ X509_CRL_free(reused_crl);
+ return 1;
+}
+
int setup_tests(void)
{
if (!TEST_ptr(test_root = X509_from_strings(kCRLTestRoot))
ADD_TEST(test_bad_issuer_crl);
ADD_TEST(test_known_critical_crl);
ADD_ALL_TESTS(test_unknown_critical_crl, OSSL_NELEM(unknown_critical_crls));
+ ADD_TEST(test_reuse_crl);
return 1;
}