-static int show_cert_detail(X509 *cert, STACK_OF(X509) *chain, struct buffer *out)
+static int show_cert_detail(X509 *cert, STACK_OF(X509) *chain, struct issuer_chain *extra_chain, struct buffer *out)
{
BIO *bio = NULL;
struct buffer *tmp = alloc_trash_chunk();
if (!cert)
goto end;
- if (chain == NULL) {
- struct issuer_chain *issuer;
- issuer = ssl_get0_issuer_chain(cert);
- if (issuer) {
- chain = issuer->chain;
- chunk_appendf(out, "Chain Filename: ");
- chunk_appendf(out, "%s\n", issuer->path);
- }
+ if (extra_chain) {
+ chunk_appendf(out, "Chain Filename: ");
+ chunk_appendf(out, "%s\n", extra_chain->path);
}
+
chunk_appendf(out, "Serial: ");
if (ssl_sock_get_serial(cert, tmp) == -1)
goto end;
else
chunk_appendf(out, "Used\n");
- retval = show_cert_detail(ckchs->data->cert, ckchs->data->chain, out);
+ retval = show_cert_detail(ckchs->data->cert, ckchs->data->chain, ckchs->data->extra_chain, out);
if (retval < 0)
goto end_no_putchk;
else if (retval)
/* file starts at line 1 */
chunk_appendf(out, " \nCertificate #%d:\n", i+1);
- retval = show_cert_detail(cert, NULL, out);
+ retval = show_cert_detail(cert, NULL, NULL, out);
if (retval < 0)
goto end_no_putchk;
else if (retval)