version 1.41, 2021/08/28 05:30:09 |
version 1.42, 2021/08/30 12:12:11 |
|
|
if (!save_serial(crlnumberfile, "new", crlnumber, NULL)) |
if (!save_serial(crlnumberfile, "new", crlnumber, NULL)) |
goto err; |
goto err; |
|
|
if (crlnumber != NULL) { |
BN_free(crlnumber); |
BN_free(crlnumber); |
crlnumber = NULL; |
crlnumber = NULL; |
|
} |
|
if (!do_X509_CRL_sign(bio_err, crl, pkey, dgst, |
if (!do_X509_CRL_sign(bio_err, crl, pkey, dgst, |
ca_config.sigopts)) |
ca_config.sigopts)) |
goto err; |
goto err; |
|
|
BIO_free_all(out); |
BIO_free_all(out); |
BIO_free_all(in); |
BIO_free_all(in); |
|
|
if (cert_sk) |
sk_X509_pop_free(cert_sk, X509_free); |
sk_X509_pop_free(cert_sk, X509_free); |
|
|
|
if (ret) |
if (ret) |
ERR_print_errors(bio_err); |
ERR_print_errors(bio_err); |
if (free_key && ca_config.key) |
if (free_key) |
free(ca_config.key); |
free(ca_config.key); |
BN_free(serial); |
BN_free(serial); |
BN_free(crlnumber); |
BN_free(crlnumber); |
free_index(db); |
free_index(db); |
if (ca_config.sigopts) |
sk_OPENSSL_STRING_free(ca_config.sigopts); |
sk_OPENSSL_STRING_free(ca_config.sigopts); |
|
EVP_PKEY_free(pkey); |
EVP_PKEY_free(pkey); |
if (x509) |
X509_free(x509); |
X509_free(x509); |
|
X509_CRL_free(crl); |
X509_CRL_free(crl); |
X509_REVOKED_free(r); |
X509_REVOKED_free(r); |
ASN1_TIME_free(tmptm); |
ASN1_TIME_free(tmptm); |
|
|
ext_copy, selfsign); |
ext_copy, selfsign); |
|
|
err: |
err: |
if (req != NULL) |
X509_REQ_free(req); |
X509_REQ_free(req); |
BIO_free(in); |
if (in != NULL) |
|
BIO_free(in); |
|
return (ok); |
return (ok); |
} |
} |
|
|
|
|
ext_copy, 0); |
ext_copy, 0); |
|
|
err: |
err: |
if (rreq != NULL) |
X509_REQ_free(rreq); |
X509_REQ_free(rreq); |
X509_free(req); |
if (req != NULL) |
|
X509_free(req); |
|
return (ok); |
return (ok); |
} |
} |
|
|
|
|
if (push != NULL) { |
if (push != NULL) { |
if (!X509_NAME_add_entry(subject, push, |
if (!X509_NAME_add_entry(subject, push, |
-1, 0)) { |
-1, 0)) { |
if (push != NULL) |
X509_NAME_ENTRY_free(push); |
X509_NAME_ENTRY_free(push); |
|
BIO_printf(bio_err, |
BIO_printf(bio_err, |
"Memory allocation failure\n"); |
"Memory allocation failure\n"); |
goto err; |
goto err; |
|
|
* Free the current entries if any, there should not be any I |
* Free the current entries if any, there should not be any I |
* believe |
* believe |
*/ |
*/ |
if (ci->extensions != NULL) |
sk_X509_EXTENSION_pop_free(ci->extensions, X509_EXTENSION_free); |
sk_X509_EXTENSION_pop_free(ci->extensions, |
|
X509_EXTENSION_free); |
|
|
|
ci->extensions = NULL; |
ci->extensions = NULL; |
|
|
/* Initialize the context structure */ |
/* Initialize the context structure */ |
|
|
for (i = 0; i < DB_NUMBER; i++) |
for (i = 0; i < DB_NUMBER; i++) |
free(row[i]); |
free(row[i]); |
|
|
if (CAname != NULL) |
X509_NAME_free(CAname); |
X509_NAME_free(CAname); |
X509_NAME_free(subject); |
if (subject != NULL) |
if (!email_dn) |
X509_NAME_free(subject); |
|
if ((dn_subject != NULL) && !email_dn) |
|
X509_NAME_free(dn_subject); |
X509_NAME_free(dn_subject); |
if (tmptm != NULL) |
ASN1_UTCTIME_free(tmptm); |
ASN1_UTCTIME_free(tmptm); |
|
if (ok <= 0) { |
if (ok <= 0) { |
if (ret != NULL) |
X509_free(ret); |
X509_free(ret); |
|
ret = NULL; |
ret = NULL; |
} else |
} else |
*xret = ret; |
*xret = ret; |
|
|
return (ok); |
return (ok); |
} |
} |
|
|
|
|
ext_copy, 0); |
ext_copy, 0); |
|
|
err: |
err: |
if (req != NULL) |
X509_REQ_free(req); |
X509_REQ_free(req); |
CONF_free(parms); |
if (parms != NULL) |
NETSCAPE_SPKI_free(spki); |
CONF_free(parms); |
|
if (spki != NULL) |
|
NETSCAPE_SPKI_free(spki); |
|
|
|
return (ok); |
return (ok); |
} |
} |