From c53a5308a5670a685bc47fd7f66d715ad311dff2 Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Wed, 5 Feb 2014 18:55:37 +0000 Subject: [PATCH] Oops, get selection logic right. --- ssl/s3_lib.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ssl/s3_lib.c b/ssl/s3_lib.c index d97082e241..4531f46556 100644 --- a/ssl/s3_lib.c +++ b/ssl/s3_lib.c @@ -3908,9 +3908,10 @@ long ssl3_ctx_ctrl(SSL_CTX *ctx, int cmd, long larg, void *parg) break; case SSL_CTRL_GET_EXTRA_CHAIN_CERTS: - *(STACK_OF(X509) **)parg = ctx->extra_certs; - if (parg == NULL && larg == 0) + if (ctx->extra_certs == NULL && larg == 0) *(STACK_OF(X509) **)parg = ctx->cert->key->chain; + else + *(STACK_OF(X509) **)parg = ctx->extra_certs; break; case SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS: -- 2.25.1