Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion modules/md/md_crypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -2226,7 +2226,7 @@ apr_status_t md_cert_get_ari_cert_id(const char **pari_cert_id,
const ASN1_INTEGER *serial;
BIGNUM *bn;
int i = -1, sder_len;
unsigned char *ucp, sbuf[256];
unsigned char *ucp, *sbuf;

*pari_cert_id = NULL;
s_aki = X509_get_ext_d2i(cert->x509, NID_authority_key_identifier, &i, NULL);
Expand All @@ -2253,6 +2253,10 @@ apr_status_t md_cert_get_ari_cert_id(const char **pari_cert_id,
}
memset(&ser_buf, 0, sizeof(ser_buf));
bn = ASN1_INTEGER_to_BN(serial, NULL);
if (!bn) {
return APR_EINVAL;
}
sbuf = apr_pcalloc(p, BN_num_bytes(bn));
sder_len = BN_bn2bin(bn, sbuf);
BN_free(bn);
if (sder_len < 1)
Expand Down