summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschwarze <>2021-08-30 18:18:16 +0000
committerschwarze <>2021-08-30 18:18:16 +0000
commit37732ca538fda5adb9e386dccdee41595d23c8d8 (patch)
tree73c2da05ca9a7cb7032bfaa6fc1296a69226d984
parentc96960dbca904b29bdc31a6c1ea8eb4930557a9a (diff)
downloadopenbsd-37732ca538fda5adb9e386dccdee41595d23c8d8.tar.gz
openbsd-37732ca538fda5adb9e386dccdee41595d23c8d8.tar.bz2
openbsd-37732ca538fda5adb9e386dccdee41595d23c8d8.zip
sync with OpenSSL 1.1.1, which is still under a free license;
in particular, this includes new text by Matt Caswell from OpenSSL commit 721eb8f6 Nov 28 12:03:00 2019 +0000 and corrects a wrong argument type that i introduced into the SYNOPSIS; requested by tb@
-rw-r--r--src/lib/libssl/man/SSL_CTX_set_tlsext_servername_callback.3122
1 files changed, 107 insertions, 15 deletions
diff --git a/src/lib/libssl/man/SSL_CTX_set_tlsext_servername_callback.3 b/src/lib/libssl/man/SSL_CTX_set_tlsext_servername_callback.3
index 8b8147a09f..d3cb5bc723 100644
--- a/src/lib/libssl/man/SSL_CTX_set_tlsext_servername_callback.3
+++ b/src/lib/libssl/man/SSL_CTX_set_tlsext_servername_callback.3
@@ -1,10 +1,11 @@
1.\" $OpenBSD: SSL_CTX_set_tlsext_servername_callback.3,v 1.4 2019/06/12 09:36:30 schwarze Exp $ 1.\" $OpenBSD: SSL_CTX_set_tlsext_servername_callback.3,v 1.5 2021/08/30 18:18:16 schwarze Exp $
2.\" OpenSSL 190b9a03 Jun 28 15:46:13 2017 +0800 2.\" full merge up to: OpenSSL 190b9a03 Jun 28 15:46:13 2017 +0800
3.\" OpenSSL 8c55c461 Mar 29 08:34:37 2017 +1000 3.\" selective merge up to: OpenSSL 6328d367 Jul 4 21:58:30 2020 +0200
4.\" 4.\"
5.\" This file was written by Jon Spillett <jon.spillett@oracle.com> 5.\" This file was written by Jon Spillett <jon.spillett@oracle.com>,
6.\" and Paul Yang <yang dot yang at baishancloud dot com>. 6.\" Paul Yang <yang dot yang at baishancloud dot com>, and
7.\" Copyright (c) 2000 The OpenSSL Project. All rights reserved. 7.\" Matt Caswell <matt@openssl.org>.
8.\" Copyright (c) 2017, 2019 The OpenSSL Project. All rights reserved.
8.\" 9.\"
9.\" Redistribution and use in source and binary forms, with or without 10.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions 11.\" modification, are permitted provided that the following conditions
@@ -50,7 +51,7 @@
50.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 51.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
51.\" OF THE POSSIBILITY OF SUCH DAMAGE. 52.\" OF THE POSSIBILITY OF SUCH DAMAGE.
52.\" 53.\"
53.Dd $Mdocdate: June 12 2019 $ 54.Dd $Mdocdate: August 30 2021 $
54.Dt SSL_CTX_SET_TLSEXT_SERVERNAME_CALLBACK 3 55.Dt SSL_CTX_SET_TLSEXT_SERVERNAME_CALLBACK 3
55.Os 56.Os
56.Sh NAME 57.Sh NAME
@@ -65,7 +66,7 @@
65.Ft long 66.Ft long
66.Fo SSL_CTX_set_tlsext_servername_callback 67.Fo SSL_CTX_set_tlsext_servername_callback
67.Fa "SSL_CTX *ctx" 68.Fa "SSL_CTX *ctx"
68.Fa "int (*cb)(SSL_CTX *, int *, void *)" 69.Fa "int (*cb)(SSL *ssl, int *alert, void *arg)"
69.Fc 70.Fc
70.Ft long 71.Ft long
71.Fo SSL_CTX_set_tlsext_servername_arg 72.Fo SSL_CTX_set_tlsext_servername_arg
@@ -74,16 +75,16 @@
74.Fc 75.Fc
75.Ft const char * 76.Ft const char *
76.Fo SSL_get_servername 77.Fo SSL_get_servername
77.Fa "const SSL *s" 78.Fa "const SSL *ssl"
78.Fa "const int type" 79.Fa "const int type"
79.Fc 80.Fc
80.Ft int 81.Ft int
81.Fo SSL_get_servername_type 82.Fo SSL_get_servername_type
82.Fa "const SSL *s" 83.Fa "const SSL *ssl"
83.Fc 84.Fc
84.Ft int 85.Ft int
85.Fo SSL_set_tlsext_host_name 86.Fo SSL_set_tlsext_host_name
86.Fa "const SSL *s" 87.Fa "const SSL *ssl"
87.Fa "const char *name" 88.Fa "const char *name"
88.Fc 89.Fc
89.Sh DESCRIPTION 90.Sh DESCRIPTION
@@ -97,14 +98,105 @@ When
97is 98is
98.Dv NULL , 99.Dv NULL ,
99SNI is not used. 100SNI is not used.
100The 101.Pp
101.Fa arg 102The servername callback should return one of the following values:
102value is a pointer which is passed to the application callback. 103.Bl -tag -width Ds
104.It Dv SSL_TLSEXT_ERR_OK
105This is used to indicate that the servername requested by the client
106has been accepted.
107Typically a server will call
108.Xr SSL_set_SSL_CTX 3
109in the callback to set up a different configuration
110for the selected servername in this case.
111.It Dv SSL_TLSEXT_ERR_ALERT_FATAL
112In this case the servername requested by the client is not accepted
113and the handshake will be aborted.
114The value of the alert to be used should be stored in the location
115pointed to by the
116.Fa alert
117parameter to the callback.
118By default this value is initialised to
119.Dv SSL_AD_UNRECOGNIZED_NAME .
120.It Dv SSL_TLSEXT_ERR_ALERT_WARNING
121If this value is returned, then the servername is not accepted by the server.
122However, the handshake will continue and send a warning alert instead.
123The value of the alert should be stored in the location pointed to by the
124.Fa alert
125parameter as for
126.Dv SSL_TLSEXT_ERR_ALERT_FATAL
127above.
128Note that TLSv1.3 does not support warning alerts, so if TLSv1.3 has
129been negotiated then this return value is treated the same way as
130.Dv SSL_TLSEXT_ERR_NOACK .
131.It Dv SSL_TLSEXT_ERR_NOACK
132This return value indicates
133that the servername is not accepted by the server.
134No alerts are sent
135and the server will not acknowledge the requested servername.
136.El
103.Pp 137.Pp
104.Fn SSL_CTX_set_tlsext_servername_arg 138.Fn SSL_CTX_set_tlsext_servername_arg
105sets a context-specific argument to be passed into the callback for 139sets a context-specific argument to be passed into the callback via the
140.Fa arg
141parameter for
106.Fa ctx . 142.Fa ctx .
107.Pp 143.Pp
144The behaviour of
145.Fn SSL_get_servername
146depends on a number of different factors.
147In particular note that in TLSv1.3,
148the servername is negotiated in every handshake.
149In TLSv1.2 the servername is only negotiated on initial handshakes
150and not on resumption handshakes.
151.Bl -tag -width Ds
152.It On the client, before the handshake:
153If a servername has been set via a call to
154.Fn SSL_set_tlsext_host_name ,
155then it will return that servername.
156If one has not been set, but a TLSv1.2 resumption is being attempted
157and the session from the original handshake had a servername
158accepted by the server, then it will return that servername.
159Otherwise it returns
160.Dv NULL .
161.It On the client, during or after the handshake,\
162 if a TLSv1.2 (or below) resumption occurred:
163If the session from the original handshake had a servername accepted by the
164server, then it will return that servername.
165Otherwise it returns the servername set via
166.Fn SSL_set_tlsext_host_name
167or
168.Dv NULL
169if it was not called.
170.It On the client, during or after the handshake,\
171 if a TLSv1.2 (or below) resumption did not occur:
172It will return the servername set via
173.Fn SSL_set_tlsext_host_name
174or
175.Dv NULL
176if it was not called.
177.It On the server, before the handshake:
178The function will always return
179.Dv NULL
180before the handshake.
181.It On the server, after the servername extension has been processed,\
182 if a TLSv1.2 (or below) resumption occurred:
183If a servername was accepted by the server in the original handshake,
184then it will return that servername, or
185.Dv NULL
186otherwise.
187.It On the server, after the servername extension has been processed,\
188 if a TLSv1.2 (or below) resumption did not occur:
189The function will return the servername
190requested by the client in this handshake or
191.Dv NULL
192if none was requested.
193.El
194.Pp
195Note that the early callback occurs before a servername extension
196from the client is processed.
197The servername, certificate and ALPN callbacks occur
198after a servername extension from the client is processed.
199.Pp
108.Fn SSL_set_tlsext_host_name 200.Fn SSL_set_tlsext_host_name
109sets the server name indication ClientHello extension 201sets the server name indication ClientHello extension
110to contain the value 202to contain the value