diff options
author | Rob Stradling <rob.stradling@comodo.com> | 2013-11-11 18:04:24 +0100 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2013-11-13 23:47:37 +0000 |
commit | dc4bdf592f2865197312ebf7aee2c1d0a1e30b4f (patch) | |
tree | 896f8a823d44b683b4fd46de79aed9ba3c2d7779 /ssl/s3_lib.c | |
parent | b03d0513d039b78ae1f868e9c17b57959c26d3d2 (diff) |
Additional "chain_cert" functions.
PR#3169
This patch, which currently applies successfully against master and
1_0_2, adds the following functions:
SSL_[CTX_]select_current_cert() - set the current certificate without
disturbing the existing structure.
SSL_[CTX_]get0_chain_certs() - get the current certificate's chain.
SSL_[CTX_]clear_chain_certs() - clear the current certificate's chain.
The patch also adds these functions to, and fixes some existing errors
in, SSL_CTX_add1_chain_cert.pod.
(cherry picked from commit 2f56c9c015dbca45379c9a725915b3b8e765a119)
Diffstat (limited to 'ssl/s3_lib.c')
-rw-r--r-- | ssl/s3_lib.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/ssl/s3_lib.c b/ssl/s3_lib.c index 92b87c3876..e52d2dbb42 100644 --- a/ssl/s3_lib.c +++ b/ssl/s3_lib.c @@ -3431,6 +3431,13 @@ long ssl3_ctrl(SSL *s, int cmd, long larg, void *parg) else return ssl_cert_add0_chain_cert(s->cert, (X509 *)parg); + case SSL_CTRL_GET_CHAIN_CERTS: + *(STACK_OF(X509) **)parg = s->cert->key->chain; + break; + + case SSL_CTRL_SELECT_CURRENT_CERT: + return ssl_cert_select_current(s->cert, (X509 *)parg); + #ifndef OPENSSL_NO_EC case SSL_CTRL_GET_CURVES: { @@ -3929,6 +3936,13 @@ long ssl3_ctx_ctrl(SSL_CTX *ctx, int cmd, long larg, void *parg) else return ssl_cert_add0_chain_cert(ctx->cert, (X509 *)parg); + case SSL_CTRL_GET_CHAIN_CERTS: + *(STACK_OF(X509) **)parg = ctx->cert->key->chain; + break; + + case SSL_CTRL_SELECT_CURRENT_CERT: + return ssl_cert_select_current(ctx->cert, (X509 *)parg); + default: return(0); } |