summaryrefslogtreecommitdiff
path: root/src/lib/libssl/ssl_sess.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_sess.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_sess.c')
-rw-r--r--src/lib/libssl/ssl_sess.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/lib/libssl/ssl_sess.c b/src/lib/libssl/ssl_sess.c
index 4903719fb3..51aa2eac04 100644
--- a/src/lib/libssl/ssl_sess.c
+++ b/src/lib/libssl/ssl_sess.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssl_sess.c,v 1.77 2018/03/17 15:55:53 tb Exp $ */ 1/* $OpenBSD: ssl_sess.c,v 1.78 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 *
@@ -199,6 +199,11 @@ SSL_SESSION_new(void)
199{ 199{
200 SSL_SESSION *ss; 200 SSL_SESSION *ss;
201 201
202 if (!OPENSSL_init_ssl(0, NULL)) {
203 SSLerrorx(SSL_R_LIBRARY_BUG);
204 return(NULL);
205 }
206
202 if ((ss = calloc(1, sizeof(*ss))) == NULL) { 207 if ((ss = calloc(1, sizeof(*ss))) == NULL) {
203 SSLerrorx(ERR_R_MALLOC_FAILURE); 208 SSLerrorx(ERR_R_MALLOC_FAILURE);
204 return (NULL); 209 return (NULL);