Revise ssl code to use a CERT_PKEY structure when outputting a

certificate chain instead of an X509 structure.

This makes it easier to enhance code in future and the chain
output functions have access to the CERT_PKEY structure being
used.
This commit is contained in:
Dr. Stephen Henson
2012-01-26 16:00:34 +00:00
parent 4379d0e457
commit c526ed410c
9 changed files with 28 additions and 21 deletions

View File

@@ -873,12 +873,19 @@ static int ssl_add_cert_to_buf(BUF_MEM *buf, unsigned long *l, X509 *x)
}
/* Add certificate chain to internal SSL BUF_MEM strcuture */
int ssl_add_cert_chain(SSL *s, X509 *x, unsigned long *l)
int ssl_add_cert_chain(SSL *s, CERT_PKEY *cpk, unsigned long *l)
{
BUF_MEM *buf = s->init_buf;
int no_chain;
int i;
X509 *x;
if (cpk)
x = cpk->x509;
else
x = NULL;
if ((s->mode & SSL_MODE_NO_AUTO_CHAIN) || s->ctx->extra_certs)
no_chain = 1;
else