summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/man3/SSL_SESSION_free.pod9
-rw-r--r--include/openssl/ssl.h1
-rw-r--r--ssl/ssl_sess.c5
-rw-r--r--util/libssl.num1
4 files changed, 16 insertions, 0 deletions
diff --git a/doc/man3/SSL_SESSION_free.pod b/doc/man3/SSL_SESSION_free.pod
index b288baf2d2..87a1cab1b4 100644
--- a/doc/man3/SSL_SESSION_free.pod
+++ b/doc/man3/SSL_SESSION_free.pod
@@ -3,6 +3,7 @@
=head1 NAME
SSL_SESSION_new,
+SSL_SESSION_dup,
SSL_SESSION_up_ref,
SSL_SESSION_free - create, free and manage SSL_SESSION structures
@@ -11,6 +12,7 @@ SSL_SESSION_free - create, free and manage SSL_SESSION structures
#include <openssl/ssl.h>
SSL_SESSION *SSL_SESSION_new(void);
+ SSL_SESSION *SSL_SESSION_dup(SSL_SESSION *src);
int SSL_SESSION_up_ref(SSL_SESSION *ses);
void SSL_SESSION_free(SSL_SESSION *session);
@@ -19,6 +21,9 @@ SSL_SESSION_free - create, free and manage SSL_SESSION structures
SSL_SESSION_new() creates a new SSL_SESSION structure and returns a pointer to
it.
+SSL_SESSION_dup() copies the contents of the SSL_SESSION structure in B<src>
+and returns a pointer to it.
+
SSL_SESSION_up_ref() increments the reference count on the given SSL_SESSION
structure.
@@ -66,6 +71,10 @@ L<SSL_CTX_set_session_cache_mode(3)>,
L<SSL_CTX_flush_sessions(3)>,
L<d2i_SSL_SESSION(3)>
+=head1 HISTORY
+
+SSL_SESSION_dup() was added in OpenSSL 1.1.1.
+
=head1 COPYRIGHT
Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved.
diff --git a/include/openssl/ssl.h b/include/openssl/ssl.h
index a2d13bf3d7..b4c66441c2 100644
--- a/include/openssl/ssl.h
+++ b/include/openssl/ssl.h
@@ -1545,6 +1545,7 @@ __owur int SSL_SESSION_set1_id(SSL_SESSION *s, const unsigned char *sid,
__owur int SSL_SESSION_is_resumable(const SSL_SESSION *s);
__owur SSL_SESSION *SSL_SESSION_new(void);
+__owur SSL_SESSION *SSL_SESSION_dup(SSL_SESSION *src);
const unsigned char *SSL_SESSION_get_id(const SSL_SESSION *s,
unsigned int *len);
const unsigned char *SSL_SESSION_get0_id_context(const SSL_SESSION *s,
diff --git a/ssl/ssl_sess.c b/ssl/ssl_sess.c
index 8cd4355cc6..7336251210 100644
--- a/ssl/ssl_sess.c
+++ b/ssl/ssl_sess.c
@@ -93,6 +93,11 @@ SSL_SESSION *SSL_SESSION_new(void)
return ss;
}
+SSL_SESSION *SSL_SESSION_dup(SSL_SESSION *src)
+{
+ return ssl_session_dup(src, 1);
+}
+
/*
* Create a new SSL_SESSION and duplicate the contents of |src| into it. If
* ticket == 0 then no ticket information is duplicated, otherwise it is.
diff --git a/util/libssl.num b/util/libssl.num
index 6a93ecb7ff..78fb65a685 100644
--- a/util/libssl.num
+++ b/util/libssl.num
@@ -462,3 +462,4 @@ SSL_SESSION_set_protocol_version 462 1_1_1 EXIST::FUNCTION:
OPENSSL_cipher_name 463 1_1_1 EXIST::FUNCTION:
SSL_alloc_buffers 464 1_1_1 EXIST::FUNCTION:
SSL_free_buffers 465 1_1_1 EXIST::FUNCTION:
+SSL_SESSION_dup 466 1_1_1 EXIST::FUNCTION: