From 0a7afeae06c69c09fad3e24ba5446736b204958d Mon Sep 17 00:00:00 2001 From: schwarze <> Date: Sun, 20 Sep 2020 10:20:44 +0000 Subject: Document the public function SSL_set_SSL_CTX(3) from scratch, which is undocumented in OpenSSL but mentioned in passing in one OpenSSL manual page, and which was recently mentioned by jsing@ when working on SSL_set_ciphersuites(3). With corrections from and OK inoguchi@. --- src/lib/libssl/man/Makefile | 3 +- src/lib/libssl/man/SSL_set_SSL_CTX.3 | 67 ++++++++++++++++++++++++++++++++++++ src/lib/libssl/man/ssl.3 | 5 +-- 3 files changed, 72 insertions(+), 3 deletions(-) create mode 100644 src/lib/libssl/man/SSL_set_SSL_CTX.3 diff --git a/src/lib/libssl/man/Makefile b/src/lib/libssl/man/Makefile index 0ea04a3077..f8e5cffd59 100644 --- a/src/lib/libssl/man/Makefile +++ b/src/lib/libssl/man/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.67 2020/09/17 08:04:22 schwarze Exp $ +# $OpenBSD: Makefile,v 1.68 2020/09/20 10:20:43 schwarze Exp $ .include @@ -104,6 +104,7 @@ MAN = BIO_f_ssl.3 \ SSL_session_reused.3 \ SSL_set1_host.3 \ SSL_set1_param.3 \ + SSL_set_SSL_CTX.3 \ SSL_set_bio.3 \ SSL_set_connect_state.3 \ SSL_set_fd.3 \ diff --git a/src/lib/libssl/man/SSL_set_SSL_CTX.3 b/src/lib/libssl/man/SSL_set_SSL_CTX.3 new file mode 100644 index 0000000000..567e34f681 --- /dev/null +++ b/src/lib/libssl/man/SSL_set_SSL_CTX.3 @@ -0,0 +1,67 @@ +.\" $OpenBSD: SSL_set_SSL_CTX.3,v 1.1 2020/09/20 10:20:44 schwarze Exp $ +.\" +.\" Copyright (c) 2020 Ingo Schwarze +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.Dd $Mdocdate: September 20 2020 $ +.Dt SSL_SET_SSL_CTX 3 +.Os +.Sh NAME +.Nm SSL_set_SSL_CTX +.Nd associate an SSL connection object with a context +.Sh SYNOPSIS +.In openssl/ssl.h +.Ft SSL_CTX * +.Fo SSL_set_SSL_CTX +.Fa "SSL *ssl" +.Fa "SSL_CTX* ctx" +.Fc +.Sh DESCRIPTION +.Fn SSL_set_SSL_CTX +causes +.Fa ssl +to use the context +.Fa ctx +in the future. +.Pp +If +.Fa ctx +is +.Dv NULL , +.Fa ssl +reverts to using the context that it was initially created from with +.Xr SSL_new 3 . +.Pp +If +.Fa ssl +already uses +.Fa ctx , +no action occurs. +.Sh RETURN VALUES +.Fn SSL_set_SSL_CTX +returns an internal pointer to the context that +.Fa ssl +will use after the call, or +.Dv NULL +if memory allocation fails. +.Sh SEE ALSO +.Xr ssl 3 , +.Xr SSL_clear 3 , +.Xr SSL_CTX_new 3 , +.Xr SSL_get_SSL_CTX 3 , +.Xr SSL_new 3 +.Sh HISTORY +.Fn SSL_set_SSL_CTX +first appeared in OpenSSL 0.9.8f and has been available since +.Ox 4.5 . diff --git a/src/lib/libssl/man/ssl.3 b/src/lib/libssl/man/ssl.3 index 0833a52f86..26596a5f8c 100644 --- a/src/lib/libssl/man/ssl.3 +++ b/src/lib/libssl/man/ssl.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ssl.3,v 1.18 2020/09/18 15:39:37 schwarze Exp $ +.\" $OpenBSD: ssl.3,v 1.19 2020/09/20 10:20:44 schwarze Exp $ .\" full merge up to: OpenSSL e330f55d Nov 11 00:51:04 2016 +0100 .\" selective merge up to: OpenSSL 322755cc Sep 1 08:40:51 2018 +0800 .\" @@ -51,7 +51,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: September 18 2020 $ +.Dd $Mdocdate: September 20 2020 $ .Dt SSL 3 .Os .Sh NAME @@ -295,6 +295,7 @@ Constructors and destructors: .Pp To change the configuration: .Xr SSL_clear 3 , +.Xr SSL_set_SSL_CTX 3 , .Xr SSL_copy_session_id 3 , .Xr SSL_set_bio 3 , .Xr SSL_set_connect_state 3 , -- cgit v1.2.3-55-g6feb