summaryrefslogtreecommitdiff
path: root/src/lib/libssl/ssl_lib.c
diff options
context:
space:
mode:
authorbeck <>2018-03-17 16:20:01 +0000
committerbeck <>2018-03-17 16:20:01 +0000
commit035770aca4c8c1f0d36f1b8da62c9e1fb9a4f09b (patch)
tree12cc674e7652f4d67e57ec9e1882e6e824b4808d /src/lib/libssl/ssl_lib.c
parent1c31745efe6ed99c3a4e427046074fc4b544f08d (diff)
downloadopenbsd-035770aca4c8c1f0d36f1b8da62c9e1fb9a4f09b.tar.gz
openbsd-035770aca4c8c1f0d36f1b8da62c9e1fb9a4f09b.tar.bz2
openbsd-035770aca4c8c1f0d36f1b8da62c9e1fb9a4f09b.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 'src/lib/libssl/ssl_lib.c')
-rw-r--r--src/lib/libssl/ssl_lib.c7
1 files changed, 6 insertions, 1 deletions
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 @@
1/* $OpenBSD: ssl_lib.c,v 1.181 2018/03/17 15:48:31 tb Exp $ */ 1/* $OpenBSD: ssl_lib.c,v 1.182 2018/03/17 16:20:01 beck Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -1791,6 +1791,11 @@ SSL_CTX_new(const SSL_METHOD *meth)
1791{ 1791{
1792 SSL_CTX *ret; 1792 SSL_CTX *ret;
1793 1793
1794 if (!OPENSSL_init_ssl(0, NULL)) {
1795 SSLerrorx(SSL_R_LIBRARY_BUG);
1796 return (NULL);
1797 }
1798
1794 if (meth == NULL) { 1799 if (meth == NULL) {
1795 SSLerrorx(SSL_R_NULL_SSL_METHOD_PASSED); 1800 SSLerrorx(SSL_R_NULL_SSL_METHOD_PASSED);
1796 return (NULL); 1801 return (NULL);