From 9f0f53b7db502ad338baa45edfd163d0ca7aabc5 Mon Sep 17 00:00:00 2001 From: Matt Caswell Date: Fri, 20 Mar 2020 11:55:19 +0000 Subject: Explicitly cache X509v3 extensions in libssl Caching the X509v3 extensions requires an explicit libctx. We do that where required in libssl. Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/11409) --- ssl/s3_lib.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'ssl/s3_lib.c') diff --git a/ssl/s3_lib.c b/ssl/s3_lib.c index ffdf3a90fb..9060ee38f0 100644 --- a/ssl/s3_lib.c +++ b/ssl/s3_lib.c @@ -17,6 +17,7 @@ #include #include #include +#include #include "internal/cryptlib.h" #define TLS13_NUM_CIPHERS OSSL_NELEM(tls13_ciphers) @@ -3947,6 +3948,10 @@ long ssl3_ctx_ctrl(SSL_CTX *ctx, int cmd, long larg, void *parg) return 0; } } + if (!X509v3_cache_extensions((X509 *)parg, ctx->libctx, ctx->propq)) { + SSLerr(0, ERR_LIB_X509); + return 0; + } if (!sk_X509_push(ctx->extra_certs, (X509 *)parg)) { SSLerr(SSL_F_SSL3_CTX_CTRL, ERR_R_MALLOC_FAILURE); return 0; -- cgit v1.2.3