summaryrefslogtreecommitdiff
path: root/lib/libssl
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2018-02-22 17:25:19 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2018-02-22 17:25:19 +0000
commit79999ad5ea7fca35c3cb89b2bfe5daa11bb53966 (patch)
tree40e63a5147b03d6f9e50567dba646097956f5593 /lib/libssl
parente214ef686db1f0835270277e8e1a0cad1d832a5b (diff)
Provide SSL_SESSION_up_ref().
Diffstat (limited to 'lib/libssl')
-rw-r--r--lib/libssl/Symbols.list1
-rw-r--r--lib/libssl/ssl.h5
-rw-r--r--lib/libssl/ssl_sess.c9
3 files changed, 12 insertions, 3 deletions
diff --git a/lib/libssl/Symbols.list b/lib/libssl/Symbols.list
index ed7f9f6e64a..60e56396bfa 100644
--- a/lib/libssl/Symbols.list
+++ b/lib/libssl/Symbols.list
@@ -145,6 +145,7 @@ SSL_SESSION_set1_id_context
SSL_SESSION_set_ex_data
SSL_SESSION_set_time
SSL_SESSION_set_timeout
+SSL_SESSION_up_ref
SSL_accept
SSL_add_client_CA
SSL_add_dir_cert_subjects_to_stack
diff --git a/lib/libssl/ssl.h b/lib/libssl/ssl.h
index 47c90fb39db..c24c729bb26 100644
--- a/lib/libssl/ssl.h
+++ b/lib/libssl/ssl.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssl.h,v 1.141 2018/02/20 18:07:11 tb Exp $ */
+/* $OpenBSD: ssl.h,v 1.142 2018/02/22 17:25:18 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -1290,12 +1290,13 @@ int SSL_SESSION_set1_id_context(SSL_SESSION *s,
const unsigned char *sid_ctx, unsigned int sid_ctx_len);
SSL_SESSION *SSL_SESSION_new(void);
+void SSL_SESSION_free(SSL_SESSION *ses);
+int SSL_SESSION_up_ref(SSL_SESSION *ss);
const unsigned char *SSL_SESSION_get_id(const SSL_SESSION *s,
unsigned int *len);
unsigned int SSL_SESSION_get_compress_id(const SSL_SESSION *s);
int SSL_SESSION_print_fp(FILE *fp, const SSL_SESSION *ses);
int SSL_SESSION_print(BIO *fp, const SSL_SESSION *ses);
-void SSL_SESSION_free(SSL_SESSION *ses);
int i2d_SSL_SESSION(SSL_SESSION *in, unsigned char **pp);
int SSL_set_session(SSL *to, SSL_SESSION *session);
int SSL_CTX_add_session(SSL_CTX *s, SSL_SESSION *c);
diff --git a/lib/libssl/ssl_sess.c b/lib/libssl/ssl_sess.c
index 54e39183f51..37a02380043 100644
--- a/lib/libssl/ssl_sess.c
+++ b/lib/libssl/ssl_sess.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssl_sess.c,v 1.73 2018/02/20 18:07:11 tb Exp $ */
+/* $OpenBSD: ssl_sess.c,v 1.74 2018/02/22 17:25:18 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -710,6 +710,13 @@ SSL_SESSION_free(SSL_SESSION *ss)
}
int
+SSL_SESSION_up_ref(SSL_SESSION *ss)
+{
+ int refs = CRYPTO_add(&ss->references, 1, CRYPTO_LOCK_SSL_SESSION);
+ return (refs > 1) ? 1 : 0;
+}
+
+int
SSL_set_session(SSL *s, SSL_SESSION *session)
{
int ret = 0;