From d18ae25f28e72831dc3c51f78e0735342540098b Mon Sep 17 00:00:00 2001 From: beck <> Date: Sat, 17 Mar 2018 16:20:01 +0000 Subject: Bring in compatibility for OpenSSL 1.1 style init functions. This adds OPENSSL_init_crypto and OPENSSL_init_ssl, as well thread safety modifications for the existing LibreSSL init functions. The initialization routines are called automatically by the normal entry points into the library, as in newer OpenSSL ok jsing@, nits by tb@ and deraadt@ --- src/lib/libssl/ssl_lib.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/lib/libssl/ssl_lib.c') diff --git a/src/lib/libssl/ssl_lib.c b/src/lib/libssl/ssl_lib.c index eca3c97fac..573e63c934 100644 --- a/src/lib/libssl/ssl_lib.c +++ b/src/lib/libssl/ssl_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_lib.c,v 1.181 2018/03/17 15:48:31 tb Exp $ */ +/* $OpenBSD: ssl_lib.c,v 1.182 2018/03/17 16:20:01 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -1791,6 +1791,11 @@ SSL_CTX_new(const SSL_METHOD *meth) { SSL_CTX *ret; + if (!OPENSSL_init_ssl(0, NULL)) { + SSLerrorx(SSL_R_LIBRARY_BUG); + return (NULL); + } + if (meth == NULL) { SSLerrorx(SSL_R_NULL_SSL_METHOD_PASSED); return (NULL); -- cgit v1.2.3-55-g6feb