summaryrefslogtreecommitdiffstats
path: root/lib/libssl/ssl_lib.c
diff options
context:
space:
mode:
authorbeck <beck@openbsd.org>2018-03-17 16:20:01 +0000
committerbeck <beck@openbsd.org>2018-03-17 16:20:01 +0000
commite68eaf899d992866359733a944d0495c6196ce94 (patch)
tree0bb81eff521337edb5ede76c62135e836cfc460c /lib/libssl/ssl_lib.c
parentProvide SSL_SESSION_get_ticket_lifetime_hint() and (diff)
downloadwireguard-openbsd-e68eaf899d992866359733a944d0495c6196ce94.tar.xz
wireguard-openbsd-e68eaf899d992866359733a944d0495c6196ce94.zip
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@
Diffstat (limited to 'lib/libssl/ssl_lib.c')
-rw-r--r--lib/libssl/ssl_lib.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/libssl/ssl_lib.c b/lib/libssl/ssl_lib.c
index eca3c97facf..573e63c934a 100644
--- a/lib/libssl/ssl_lib.c
+++ b/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);