Oops, get selection logic right.

(cherry picked from commit 3880579240d476d21f68fd01a391dd325920f479)
This commit is contained in:
Dr. Stephen Henson 2014-02-05 18:55:37 +00:00
parent 41cf2d2518
commit 3bff195dca

View File

@ -3914,9 +3914,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: