summaryrefslogtreecommitdiff
path: root/src/lib/libssl/man
diff options
context:
space:
mode:
authorcvs2svn <admin@example.com>2025-04-14 17:32:06 +0000
committercvs2svn <admin@example.com>2025-04-14 17:32:06 +0000
commiteb8dd9dca1228af0cd132f515509051ecfabf6f6 (patch)
treeedb6da6af7e865d488dc1a29309f1e1ec226e603 /src/lib/libssl/man
parent247f0352e0ed72a4f476db9dc91f4d982bc83eb2 (diff)
downloadopenbsd-tb_20250414.tar.gz
openbsd-tb_20250414.tar.bz2
openbsd-tb_20250414.zip
This commit was manufactured by cvs2git to create tag 'tb_20250414'.tb_20250414
Diffstat (limited to 'src/lib/libssl/man')
-rw-r--r--src/lib/libssl/man/BIO_f_ssl.3609
-rw-r--r--src/lib/libssl/man/DTLSv1_listen.3187
-rw-r--r--src/lib/libssl/man/Makefile134
-rw-r--r--src/lib/libssl/man/OPENSSL_init_ssl.376
-rw-r--r--src/lib/libssl/man/PEM_read_SSL_SESSION.3147
-rw-r--r--src/lib/libssl/man/SSL_CIPHER_get_name.3398
-rw-r--r--src/lib/libssl/man/SSL_COMP_add_compression_method.342
-rw-r--r--src/lib/libssl/man/SSL_CTX_add1_chain_cert.3222
-rw-r--r--src/lib/libssl/man/SSL_CTX_add_extra_chain_cert.3160
-rw-r--r--src/lib/libssl/man/SSL_CTX_add_session.3132
-rw-r--r--src/lib/libssl/man/SSL_CTX_ctrl.3122
-rw-r--r--src/lib/libssl/man/SSL_CTX_flush_sessions.3100
-rw-r--r--src/lib/libssl/man/SSL_CTX_free.3101
-rw-r--r--src/lib/libssl/man/SSL_CTX_get0_certificate.351
-rw-r--r--src/lib/libssl/man/SSL_CTX_get_ex_new_index.3124
-rw-r--r--src/lib/libssl/man/SSL_CTX_get_verify_mode.3131
-rw-r--r--src/lib/libssl/man/SSL_CTX_load_verify_locations.3238
-rw-r--r--src/lib/libssl/man/SSL_CTX_new.3345
-rw-r--r--src/lib/libssl/man/SSL_CTX_sess_number.3168
-rw-r--r--src/lib/libssl/man/SSL_CTX_sess_set_cache_size.3109
-rw-r--r--src/lib/libssl/man/SSL_CTX_sess_set_get_cb.3221
-rw-r--r--src/lib/libssl/man/SSL_CTX_sessions.386
-rw-r--r--src/lib/libssl/man/SSL_CTX_set1_groups.3163
-rw-r--r--src/lib/libssl/man/SSL_CTX_set_alpn_select_cb.3305
-rw-r--r--src/lib/libssl/man/SSL_CTX_set_cert_store.3146
-rw-r--r--src/lib/libssl/man/SSL_CTX_set_cert_verify_callback.3163
-rw-r--r--src/lib/libssl/man/SSL_CTX_set_cipher_list.3375
-rw-r--r--src/lib/libssl/man/SSL_CTX_set_client_CA_list.3183
-rw-r--r--src/lib/libssl/man/SSL_CTX_set_client_cert_cb.3191
-rw-r--r--src/lib/libssl/man/SSL_CTX_set_default_passwd_cb.3216
-rw-r--r--src/lib/libssl/man/SSL_CTX_set_generate_session_id.3221
-rw-r--r--src/lib/libssl/man/SSL_CTX_set_info_callback.3233
-rw-r--r--src/lib/libssl/man/SSL_CTX_set_keylog_callback.356
-rw-r--r--src/lib/libssl/man/SSL_CTX_set_max_cert_list.3154
-rw-r--r--src/lib/libssl/man/SSL_CTX_set_min_proto_version.3156
-rw-r--r--src/lib/libssl/man/SSL_CTX_set_mode.3204
-rw-r--r--src/lib/libssl/man/SSL_CTX_set_msg_callback.3183
-rw-r--r--src/lib/libssl/man/SSL_CTX_set_num_tickets.363
-rw-r--r--src/lib/libssl/man/SSL_CTX_set_options.3374
-rw-r--r--src/lib/libssl/man/SSL_CTX_set_quiet_shutdown.3161
-rw-r--r--src/lib/libssl/man/SSL_CTX_set_read_ahead.3144
-rw-r--r--src/lib/libssl/man/SSL_CTX_set_security_level.3159
-rw-r--r--src/lib/libssl/man/SSL_CTX_set_session_cache_mode.3198
-rw-r--r--src/lib/libssl/man/SSL_CTX_set_session_id_context.3160
-rw-r--r--src/lib/libssl/man/SSL_CTX_set_ssl_version.3146
-rw-r--r--src/lib/libssl/man/SSL_CTX_set_timeout.3118
-rw-r--r--src/lib/libssl/man/SSL_CTX_set_tlsext_servername_callback.3247
-rw-r--r--src/lib/libssl/man/SSL_CTX_set_tlsext_status_cb.3238
-rw-r--r--src/lib/libssl/man/SSL_CTX_set_tlsext_ticket_key_cb.3300
-rw-r--r--src/lib/libssl/man/SSL_CTX_set_tlsext_use_srtp.3197
-rw-r--r--src/lib/libssl/man/SSL_CTX_set_tmp_dh_callback.3229
-rw-r--r--src/lib/libssl/man/SSL_CTX_set_tmp_rsa_callback.3114
-rw-r--r--src/lib/libssl/man/SSL_CTX_set_verify.3479
-rw-r--r--src/lib/libssl/man/SSL_CTX_use_certificate.3451
-rw-r--r--src/lib/libssl/man/SSL_SESSION_free.3148
-rw-r--r--src/lib/libssl/man/SSL_SESSION_get0_cipher.394
-rw-r--r--src/lib/libssl/man/SSL_SESSION_get0_peer.380
-rw-r--r--src/lib/libssl/man/SSL_SESSION_get_compress_id.378
-rw-r--r--src/lib/libssl/man/SSL_SESSION_get_ex_new_index.3134
-rw-r--r--src/lib/libssl/man/SSL_SESSION_get_id.3112
-rw-r--r--src/lib/libssl/man/SSL_SESSION_get_protocol_version.384
-rw-r--r--src/lib/libssl/man/SSL_SESSION_get_time.3165
-rw-r--r--src/lib/libssl/man/SSL_SESSION_has_ticket.385
-rw-r--r--src/lib/libssl/man/SSL_SESSION_is_resumable.381
-rw-r--r--src/lib/libssl/man/SSL_SESSION_new.378
-rw-r--r--src/lib/libssl/man/SSL_SESSION_print.374
-rw-r--r--src/lib/libssl/man/SSL_SESSION_set1_id_context.3113
-rw-r--r--src/lib/libssl/man/SSL_accept.3155
-rw-r--r--src/lib/libssl/man/SSL_alert_type_string.3253
-rw-r--r--src/lib/libssl/man/SSL_clear.3144
-rw-r--r--src/lib/libssl/man/SSL_connect.3154
-rw-r--r--src/lib/libssl/man/SSL_copy_session_id.379
-rw-r--r--src/lib/libssl/man/SSL_do_handshake.3152
-rw-r--r--src/lib/libssl/man/SSL_dup.362
-rw-r--r--src/lib/libssl/man/SSL_dup_CA_list.354
-rw-r--r--src/lib/libssl/man/SSL_export_keying_material.3133
-rw-r--r--src/lib/libssl/man/SSL_free.3115
-rw-r--r--src/lib/libssl/man/SSL_get_SSL_CTX.379
-rw-r--r--src/lib/libssl/man/SSL_get_certificate.364
-rw-r--r--src/lib/libssl/man/SSL_get_ciphers.3249
-rw-r--r--src/lib/libssl/man/SSL_get_client_CA_list.396
-rw-r--r--src/lib/libssl/man/SSL_get_client_random.3150
-rw-r--r--src/lib/libssl/man/SSL_get_current_cipher.3122
-rw-r--r--src/lib/libssl/man/SSL_get_default_timeout.385
-rw-r--r--src/lib/libssl/man/SSL_get_error.3217
-rw-r--r--src/lib/libssl/man/SSL_get_ex_data_X509_STORE_CTX_idx.3116
-rw-r--r--src/lib/libssl/man/SSL_get_ex_new_index.3136
-rw-r--r--src/lib/libssl/man/SSL_get_fd.3103
-rw-r--r--src/lib/libssl/man/SSL_get_finished.377
-rw-r--r--src/lib/libssl/man/SSL_get_peer_cert_chain.3107
-rw-r--r--src/lib/libssl/man/SSL_get_peer_certificate.3105
-rw-r--r--src/lib/libssl/man/SSL_get_rbio.398
-rw-r--r--src/lib/libssl/man/SSL_get_server_tmp_key.389
-rw-r--r--src/lib/libssl/man/SSL_get_session.3163
-rw-r--r--src/lib/libssl/man/SSL_get_shared_ciphers.3103
-rw-r--r--src/lib/libssl/man/SSL_get_state.3161
-rw-r--r--src/lib/libssl/man/SSL_get_verify_result.3102
-rw-r--r--src/lib/libssl/man/SSL_get_version.3123
-rw-r--r--src/lib/libssl/man/SSL_library_init.398
-rw-r--r--src/lib/libssl/man/SSL_load_client_CA_file.3185
-rw-r--r--src/lib/libssl/man/SSL_new.3110
-rw-r--r--src/lib/libssl/man/SSL_num_renegotiations.375
-rw-r--r--src/lib/libssl/man/SSL_pending.390
-rw-r--r--src/lib/libssl/man/SSL_read.3278
-rw-r--r--src/lib/libssl/man/SSL_read_early_data.3174
-rw-r--r--src/lib/libssl/man/SSL_renegotiate.3166
-rw-r--r--src/lib/libssl/man/SSL_rstate_string.3108
-rw-r--r--src/lib/libssl/man/SSL_session_reused.384
-rw-r--r--src/lib/libssl/man/SSL_set1_host.3172
-rw-r--r--src/lib/libssl/man/SSL_set1_param.3137
-rw-r--r--src/lib/libssl/man/SSL_set_SSL_CTX.367
-rw-r--r--src/lib/libssl/man/SSL_set_bio.399
-rw-r--r--src/lib/libssl/man/SSL_set_connect_state.3153
-rw-r--r--src/lib/libssl/man/SSL_set_fd.3129
-rw-r--r--src/lib/libssl/man/SSL_set_max_send_fragment.397
-rw-r--r--src/lib/libssl/man/SSL_set_psk_use_session_callback.386
-rw-r--r--src/lib/libssl/man/SSL_set_session.3119
-rw-r--r--src/lib/libssl/man/SSL_set_shutdown.3138
-rw-r--r--src/lib/libssl/man/SSL_set_tmp_ecdh.3119
-rw-r--r--src/lib/libssl/man/SSL_set_verify_result.390
-rw-r--r--src/lib/libssl/man/SSL_shutdown.3253
-rw-r--r--src/lib/libssl/man/SSL_state_string.3110
-rw-r--r--src/lib/libssl/man/SSL_want.3161
-rw-r--r--src/lib/libssl/man/SSL_write.3249
-rw-r--r--src/lib/libssl/man/d2i_SSL_SESSION.3181
-rw-r--r--src/lib/libssl/man/ssl.3353
126 files changed, 0 insertions, 19883 deletions
diff --git a/src/lib/libssl/man/BIO_f_ssl.3 b/src/lib/libssl/man/BIO_f_ssl.3
deleted file mode 100644
index 3b74a3d6a4..0000000000
--- a/src/lib/libssl/man/BIO_f_ssl.3
+++ /dev/null
@@ -1,609 +0,0 @@
1.\" $OpenBSD: BIO_f_ssl.3,v 1.16 2024/01/13 18:37:51 tb Exp $
2.\" full merge up to: OpenSSL f672aee4 Feb 9 11:52:40 2016 -0500
3.\" selective merge up to: OpenSSL 61f805c1 Jan 16 01:01:46 2018 +0800
4.\"
5.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
6.\" Copyright (c) 2000, 2003, 2009, 2014-2016 The OpenSSL Project.
7.\" All rights reserved.
8.\"
9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions
11.\" are met:
12.\"
13.\" 1. Redistributions of source code must retain the above copyright
14.\" notice, this list of conditions and the following disclaimer.
15.\"
16.\" 2. Redistributions in binary form must reproduce the above copyright
17.\" notice, this list of conditions and the following disclaimer in
18.\" the documentation and/or other materials provided with the
19.\" distribution.
20.\"
21.\" 3. All advertising materials mentioning features or use of this
22.\" software must display the following acknowledgment:
23.\" "This product includes software developed by the OpenSSL Project
24.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
25.\"
26.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
27.\" endorse or promote products derived from this software without
28.\" prior written permission. For written permission, please contact
29.\" openssl-core@openssl.org.
30.\"
31.\" 5. Products derived from this software may not be called "OpenSSL"
32.\" nor may "OpenSSL" appear in their names without prior written
33.\" permission of the OpenSSL Project.
34.\"
35.\" 6. Redistributions of any form whatsoever must retain the following
36.\" acknowledgment:
37.\" "This product includes software developed by the OpenSSL Project
38.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
39.\"
40.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
41.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
42.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
43.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
44.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
45.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
46.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
47.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
49.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
50.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
51.\" OF THE POSSIBILITY OF SUCH DAMAGE.
52.\"
53.Dd $Mdocdate: January 13 2024 $
54.Dt BIO_F_SSL 3
55.Os
56.Sh NAME
57.Nm BIO_f_ssl ,
58.Nm BIO_set_ssl ,
59.Nm BIO_get_ssl ,
60.Nm BIO_set_ssl_mode ,
61.Nm BIO_set_ssl_renegotiate_bytes ,
62.Nm BIO_get_num_renegotiates ,
63.Nm BIO_set_ssl_renegotiate_timeout ,
64.Nm BIO_new_ssl ,
65.Nm BIO_new_ssl_connect ,
66.Nm BIO_new_buffer_ssl_connect ,
67.Nm BIO_ssl_copy_session_id ,
68.Nm BIO_ssl_shutdown ,
69.Nm BIO_do_handshake
70.Nd SSL BIO
71.Sh SYNOPSIS
72.In openssl/bio.h
73.In openssl/ssl.h
74.Ft const BIO_METHOD *
75.Fn BIO_f_ssl void
76.Ft long
77.Fo BIO_set_ssl
78.Fa "BIO *b"
79.Fa "SSL *ssl"
80.Fa "long c"
81.Fc
82.Ft long
83.Fo BIO_get_ssl
84.Fa "BIO *b"
85.Fa "SSL *sslp"
86.Fc
87.Ft long
88.Fo BIO_set_ssl_mode
89.Fa "BIO *b"
90.Fa "long client"
91.Fc
92.Ft long
93.Fo BIO_set_ssl_renegotiate_bytes
94.Fa "BIO *b"
95.Fa "long num"
96.Fc
97.Ft long
98.Fo BIO_set_ssl_renegotiate_timeout
99.Fa "BIO *b"
100.Fa "long seconds"
101.Fc
102.Ft long
103.Fo BIO_get_num_renegotiates
104.Fa "BIO *b"
105.Fc
106.Ft BIO *
107.Fn BIO_new_ssl "SSL_CTX *ctx" "int client"
108.Ft BIO *
109.Fn BIO_new_ssl_connect "SSL_CTX *ctx"
110.Ft BIO *
111.Fn BIO_new_buffer_ssl_connect "SSL_CTX *ctx"
112.Ft int
113.Fn BIO_ssl_copy_session_id "BIO *to" "BIO *from"
114.Ft void
115.Fn BIO_ssl_shutdown "BIO *bio"
116.Ft long
117.Fn BIO_do_handshake "BIO *b"
118.Sh DESCRIPTION
119.Fn BIO_f_ssl
120returns the
121.Vt SSL
122.Vt BIO
123method.
124This is a filter
125.Vt BIO
126which is a wrapper around the OpenSSL
127.Vt SSL
128routines adding a
129.Vt BIO
130.Dq flavor
131to SSL I/O.
132.Pp
133I/O performed on an
134.Vt SSL
135.Vt BIO
136communicates using the SSL protocol with
137the
138.Vt SSL Ns 's
139read and write
140.Vt BIO Ns s .
141If an SSL connection is not established then an attempt is made to establish
142one on the first I/O call.
143.Pp
144If a
145.Vt BIO
146is appended to an
147.Vt SSL
148.Vt BIO
149using
150.Xr BIO_push 3 ,
151it is automatically used as the
152.Vt SSL
153.Vt BIO Ns 's read and write
154.Vt BIO Ns s .
155.Pp
156Calling
157.Xr BIO_reset 3
158on an
159.Vt SSL
160.Vt BIO
161closes down any current SSL connection by calling
162.Xr SSL_shutdown 3 .
163.Xr BIO_reset 3
164is then sent to the next
165.Vt BIO
166in the chain; this will typically disconnect the underlying transport.
167The
168.Vt SSL
169.Vt BIO
170is then reset to the initial accept or connect state.
171.Pp
172If the close flag is set when an
173.Vt SSL
174.Vt BIO
175is freed then the internal
176.Vt SSL
177structure is also freed using
178.Xr SSL_free 3 .
179.Pp
180.Fn BIO_set_ssl
181sets the internal
182.Vt SSL
183pointer of
184.Vt BIO
185.Fa b
186to
187.Fa ssl
188using
189the close flag
190.Fa c .
191.Pp
192.Fn BIO_get_ssl
193retrieves the
194.Vt SSL
195pointer of
196.Vt BIO
197.Fa b ;
198it can then be manipulated using the standard SSL library functions.
199.Pp
200.Fn BIO_set_ssl_mode
201sets the
202.Vt SSL
203.Vt BIO
204mode to
205.Fa client .
206If
207.Fa client
208is 1, client mode is set.
209If
210.Fa client
211is 0, server mode is set.
212.Pp
213.Fn BIO_set_ssl_renegotiate_bytes
214sets the renegotiate byte count to
215.Fa num .
216When set, after every
217.Fa num
218bytes of I/O (read and write) the SSL session is automatically renegotiated.
219.Fa num
220must be at least 512 bytes.
221.Pp
222.Fn BIO_set_ssl_renegotiate_timeout
223sets the renegotiate timeout to
224.Fa seconds .
225When the renegotiate timeout elapses, the session is automatically renegotiated.
226.Pp
227.Fn BIO_get_num_renegotiates
228returns the total number of session renegotiations due to I/O or timeout.
229.Pp
230.Fn BIO_new_ssl
231allocates an
232.Vt SSL
233.Vt BIO
234using
235.Vt SSL_CTX
236.Va ctx
237and using client mode if
238.Fa client
239is nonzero.
240.Pp
241.Fn BIO_new_ssl_connect
242creates a new
243.Vt BIO
244chain consisting of an
245.Vt SSL
246.Vt BIO
247(using
248.Fa ctx )
249followed by a connect BIO.
250.Pp
251.Fn BIO_new_buffer_ssl_connect
252creates a new
253.Vt BIO
254chain consisting of a buffering
255.Vt BIO ,
256an
257.Vt SSL
258.Vt BIO
259(using
260.Fa ctx )
261and a connect
262.Vt BIO .
263.Pp
264.Fn BIO_ssl_copy_session_id
265copies an SSL session id between
266.Vt BIO
267chains
268.Fa from
269and
270.Fa to .
271It does this by locating the
272.Vt SSL
273.Vt BIO Ns s
274in each chain and calling
275.Xr SSL_copy_session_id 3
276on the internal
277.Vt SSL
278pointer.
279.Pp
280.Fn BIO_ssl_shutdown
281closes down an SSL connection on
282.Vt BIO
283chain
284.Fa bio .
285It does this by locating the
286.Vt SSL
287.Vt BIO
288in the
289chain and calling
290.Xr SSL_shutdown 3
291on its internal
292.Vt SSL
293pointer.
294.Pp
295.Fn BIO_do_handshake
296attempts to complete an SSL handshake on the supplied
297.Vt BIO
298and establish the SSL connection.
299It returns 1 if the connection was established successfully.
300A zero or negative value is returned if the connection could not be
301established; the call
302.Xr BIO_should_retry 3
303should be used for non blocking connect
304.Vt BIO Ns s
305to determine if the call should be retried.
306If an SSL connection has already been established, this call has no effect.
307.Pp
308When a chain containing an SSL BIO is copied with
309.Xr BIO_dup_chain 3 ,
310.Xr SSL_dup 3
311is called internally to copy the
312.Vt SSL
313object from the existing BIO object to the new BIO object,
314and the internal data related to
315.Fn BIO_set_ssl_renegotiate_bytes
316and
317.Fn BIO_set_ssl_renegotiate_timeout
318is also copied.
319.Pp
320.Vt SSL
321.Vt BIO Ns s
322are exceptional in that if the underlying transport is non-blocking they can
323still request a retry in exceptional circumstances.
324Specifically this will happen if a session renegotiation takes place during a
325.Xr BIO_read 3
326operation.
327One case where this happens is when step up occurs.
328.Pp
329In OpenSSL 0.9.6 and later the SSL flag
330.Dv SSL_AUTO_RETRY
331can be set to disable this behaviour.
332In other words, when this flag is set an
333.Vt SSL
334.Vt BIO
335using a blocking transport will never request a retry.
336.Pp
337Since unknown
338.Xr BIO_ctrl 3
339operations are sent through filter
340.Vt BIO Ns s ,
341the server name and port can be set using
342.Xr BIO_set_conn_hostname 3
343and
344.Xr BIO_set_conn_port 3
345on the
346.Vt BIO
347returned by
348.Fn BIO_new_ssl_connect
349without having to locate the connect
350.Vt BIO
351first.
352.Pp
353Applications do not have to call
354.Fn BIO_do_handshake
355but may wish to do so to separate the handshake process from other I/O
356processing.
357.Pp
358.Fn BIO_set_ssl ,
359.Fn BIO_get_ssl ,
360.Fn BIO_set_ssl_mode ,
361.Fn BIO_set_ssl_renegotiate_bytes ,
362.Fn BIO_set_ssl_renegotiate_timeout ,
363.Fn BIO_get_num_renegotiates ,
364and
365.Fn BIO_do_handshake
366are implemented as macros.
367.Sh RETURN VALUES
368.Fn BIO_f_ssl
369returns a pointer to a static
370.Vt BIO_METHOD
371structure.
372.Pp
373When called on an SSL BIO object,
374.Xr BIO_method_type 3
375returns the constant
376.Dv BIO_TYPE_SSL
377and
378.Xr BIO_method_name 3
379returns a pointer to the static string
380.Qq ssl .
381.Pp
382.Fn BIO_set_ssl ,
383.Fn BIO_get_ssl ,
384.Fn BIO_set_ssl_mode ,
385.Fn BIO_set_ssl_renegotiate_bytes ,
386.Fn BIO_set_ssl_renegotiate_timeout ,
387and
388.Fn BIO_get_num_renegotiates
389return 1 on success or a value less than or equal to 0
390if an error occurred.
391.Pp
392.Fn BIO_new_ssl ,
393.Fn BIO_new_ssl_connect ,
394and
395.Fn BIO_new_buffer_ssl_connect
396returns a pointer to a newly allocated
397.Vt BIO
398chain or
399.Dv NULL
400if an error occurred.
401.Pp
402.Fn BIO_ssl_copy_session_id
403returns 1 on success or 0 on error.
404.Pp
405.Fn BIO_do_handshake
406returns 1 if the connection was established successfully
407or a value less than or equal to 0 otherwise.
408.Sh EXAMPLES
409This SSL/TLS client example attempts to retrieve a page from an SSL/TLS web
410server.
411The I/O routines are identical to those of the unencrypted example in
412.Xr BIO_s_connect 3 .
413.Bd -literal
414BIO *sbio, *out;
415int len;
416char tmpbuf[1024];
417SSL_CTX *ctx;
418SSL *ssl;
419
420ERR_load_crypto_strings();
421ERR_load_SSL_strings();
422OpenSSL_add_all_algorithms();
423
424/*
425 * We would seed the PRNG here if the platform didn't do it automatically
426 */
427
428ctx = SSL_CTX_new(SSLv23_client_method());
429
430/*
431 * We'd normally set some stuff like the verify paths and mode here because
432 * as things stand this will connect to any server whose certificate is
433 * signed by any CA.
434 */
435
436sbio = BIO_new_ssl_connect(ctx);
437
438BIO_get_ssl(sbio, &ssl);
439
440if (!ssl) {
441 fprintf(stderr, "Can't locate SSL pointer\en");
442 /* whatever ... */
443}
444
445/* Don't want any retries */
446SSL_set_mode(ssl, SSL_MODE_AUTO_RETRY);
447
448/* We might want to do other things with ssl here */
449
450BIO_set_conn_hostname(sbio, "localhost:https");
451
452out = BIO_new_fp(stdout, BIO_NOCLOSE);
453if (BIO_do_connect(sbio) <= 0) {
454 fprintf(stderr, "Error connecting to server\en");
455 ERR_print_errors_fp(stderr);
456 /* whatever ... */
457}
458
459if (BIO_do_handshake(sbio) <= 0) {
460 fprintf(stderr, "Error establishing SSL connection\en");
461 ERR_print_errors_fp(stderr);
462 /* whatever ... */
463}
464
465/* Could examine ssl here to get connection info */
466
467BIO_puts(sbio, "GET / HTTP/1.0\en\en");
468for (;;) {
469 len = BIO_read(sbio, tmpbuf, 1024);
470 if(len <= 0) break;
471 BIO_write(out, tmpbuf, len);
472}
473BIO_free_all(sbio);
474BIO_free(out);
475.Ed
476.Pp
477Here is a simple server example.
478It makes use of a buffering
479.Vt BIO
480to allow lines to be read from the
481.Vt SSL
482.Vt BIO
483using
484.Xr BIO_gets 3 .
485It creates a pseudo web page containing the actual request from a client and
486also echoes the request to standard output.
487.Bd -literal
488BIO *sbio, *bbio, *acpt, *out;
489int len;
490char tmpbuf[1024];
491SSL_CTX *ctx;
492SSL *ssl;
493
494ctx = SSL_CTX_new(SSLv23_server_method());
495
496if (!SSL_CTX_use_certificate_file(ctx,"server.pem",SSL_FILETYPE_PEM)
497 || !SSL_CTX_use_PrivateKey_file(ctx,"server.pem",SSL_FILETYPE_PEM)
498 || !SSL_CTX_check_private_key(ctx)) {
499 fprintf(stderr, "Error setting up SSL_CTX\en");
500 ERR_print_errors_fp(stderr);
501 return 0;
502}
503
504/*
505 * Might do other things here like setting verify locations and DH and/or
506 * RSA temporary key callbacks
507 */
508
509/* New SSL BIO setup as server */
510sbio = BIO_new_ssl(ctx,0);
511
512BIO_get_ssl(sbio, &ssl);
513
514if (!ssl) {
515 fprintf(stderr, "Can't locate SSL pointer\en");
516 /* whatever ... */
517}
518
519/* Don't want any retries */
520SSL_set_mode(ssl, SSL_MODE_AUTO_RETRY);
521
522/* Create the buffering BIO */
523
524bbio = BIO_new(BIO_f_buffer());
525
526/* Add to chain */
527sbio = BIO_push(bbio, sbio);
528
529acpt = BIO_new_accept("4433");
530
531/*
532 * By doing this when a new connection is established we automatically
533 * have sbio inserted into it. The BIO chain is now 'swallowed' by the
534 * accept BIO and will be freed when the accept BIO is freed.
535 */
536
537BIO_set_accept_bios(acpt,sbio);
538
539out = BIO_new_fp(stdout, BIO_NOCLOSE);
540
541/* Wait for incoming connection */
542if (BIO_do_accept(acpt) <= 0) {
543 fprintf(stderr, "Error setting up accept BIO\en");
544 ERR_print_errors_fp(stderr);
545 return 0;
546}
547
548/* We only want one connection so remove and free accept BIO */
549
550sbio = BIO_pop(acpt);
551
552BIO_free_all(acpt);
553
554if (BIO_do_handshake(sbio) <= 0) {
555 fprintf(stderr, "Error in SSL handshake\en");
556 ERR_print_errors_fp(stderr);
557 return 0;
558}
559
560BIO_puts(sbio, "HTTP/1.0 200 OK\er\enContent-type: text/plain\er\en\er\en");
561BIO_puts(sbio, "\er\enConnection Established\er\enRequest headers:\er\en");
562BIO_puts(sbio, "--------------------------------------------------\er\en");
563
564for (;;) {
565 len = BIO_gets(sbio, tmpbuf, 1024);
566 if (len <= 0)
567 break;
568 BIO_write(sbio, tmpbuf, len);
569 BIO_write(out, tmpbuf, len);
570 /* Look for blank line signifying end of headers */
571 if ((tmpbuf[0] == '\er') || (tmpbuf[0] == '\en'))
572 break;
573}
574
575BIO_puts(sbio, "--------------------------------------------------\er\en");
576BIO_puts(sbio, "\er\en");
577
578/* Since there is a buffering BIO present we had better flush it */
579BIO_flush(sbio);
580
581BIO_free_all(sbio);
582.Ed
583.Sh SEE ALSO
584.Xr BIO_new 3 ,
585.Xr ssl 3
586.Sh HISTORY
587.Fn BIO_f_ssl ,
588.Fn BIO_set_ssl ,
589and
590.Fn BIO_get_ssl
591first appeared in SSLeay 0.6.0.
592.Fn BIO_set_ssl_mode ,
593.Fn BIO_new_ssl ,
594and
595.Fn BIO_ssl_copy_session_id
596first appeared in SSLeay 0.8.0.
597.Fn BIO_ssl_shutdown
598and
599.Fn BIO_do_handshake
600first appeared in SSLeay 0.8.1.
601.Fn BIO_set_ssl_renegotiate_bytes ,
602.Fn BIO_get_num_renegotiates ,
603.Fn BIO_set_ssl_renegotiate_timeout ,
604.Fn BIO_new_ssl_connect ,
605and
606.Fn BIO_new_buffer_ssl_connect
607first appeared in SSLeay 0.9.0.
608All these functions have been available since
609.Ox 2.4 .
diff --git a/src/lib/libssl/man/DTLSv1_listen.3 b/src/lib/libssl/man/DTLSv1_listen.3
deleted file mode 100644
index 047ec0a7ff..0000000000
--- a/src/lib/libssl/man/DTLSv1_listen.3
+++ /dev/null
@@ -1,187 +0,0 @@
1.\" $OpenBSD: DTLSv1_listen.3,v 1.4 2018/03/27 17:35:50 schwarze Exp $
2.\" OpenSSL 7795475f Dec 18 13:18:31 2015 -0500
3.\"
4.\" This file was written by Matt Caswell <matt@openssl.org>.
5.\" Copyright (c) 2015 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: March 27 2018 $
52.Dt DTLSV1_LISTEN 3
53.Os
54.Sh NAME
55.Nm DTLSv1_listen
56.Nd listen for incoming DTLS connections
57.Sh SYNOPSIS
58.In openssl/ssl.h
59.Ft int
60.Fo DTLSv1_listen
61.Fa "SSL *ssl"
62.Fa "struct sockaddr *peer"
63.Fc
64.Sh DESCRIPTION
65.Fn DTLSv1_listen
66listens for new incoming DTLS connections.
67If a ClientHello is received that does not contain a cookie, then
68.Fn DTLSv1_listen
69responds with a HelloVerifyRequest.
70If a ClientHello is received with a cookie that is verified, then
71control is returned to user code to enable the handshake to be
72completed (for example by using
73.Xr SSL_accept 3 ) .
74.Pp
75.Fn DTLSv1_listen
76is currently implemented as a macro.
77.Pp
78Datagram based protocols can be susceptible to Denial of Service
79attacks.
80A DTLS attacker could, for example, submit a series of handshake
81initiation requests that cause the server to allocate state (and
82possibly perform cryptographic operations) thus consuming server
83resources.
84The attacker could also (with UDP) quite simply forge the source IP
85address in such an attack.
86.Pp
87As a counter measure to that DTLS includes a stateless cookie mechanism.
88The idea is that when a client attempts to connect to a server it sends
89a ClientHello message.
90The server responds with a HelloVerifyRequest which contains a unique
91cookie.
92The client then resends the ClientHello, but this time includes the
93cookie in the message thus proving that the client is capable of
94receiving messages sent to that address.
95All of this can be done by the server without allocating any state, and
96thus without consuming expensive resources.
97.Pp
98OpenSSL implements this capability via the
99.Fn DTLSv1_listen
100function.
101The
102.Fa ssl
103parameter should be a newly allocated
104.Vt SSL
105object with its read and write BIOs set, in the same way as might
106be done for a call to
107.Xr SSL_accept 3 .
108Typically the read BIO will be in an "unconnected" state and thus
109capable of receiving messages from any peer.
110.Pp
111When a ClientHello is received that contains a cookie that has been
112verified, then
113.Fn DTLSv1_listen
114will return with the
115.Fa ssl
116parameter updated into a state where the handshake can be continued by a
117call to (for example)
118.Xr SSL_accept 3 .
119Additionally the
120.Vt struct sockaddr
121pointed to by
122.Fa peer
123will be filled in with details of the peer that sent the ClientHello.
124It is the calling code's responsibility to ensure that the
125.Fa peer
126location is sufficiently large to accommodate the addressing scheme in use.
127For example this might be done by allocating space for a
128.Vt struct sockaddr_storage
129and casting the pointer to it to a
130.Vt struct sockaddr *
131for the call to
132.Fn DTLSv1_listen .
133Typically user code is expected to "connect" the underlying socket
134to the peer and continue the handshake in a connected state.
135.Pp
136Prior to calling
137.Fn DTLSv1_listen
138user code must ensure that cookie generation and verification callbacks
139have been set up using
140.Fn SSL_CTX_set_cookie_generate_cb
141and
142.Fn SSL_CTX_set_cookie_verify_cb
143respectively.
144.Pp
145Since
146.Fn DTLSv1_listen
147operates entirely statelessly whilst processing incoming ClientHellos,
148it is unable to process fragmented messages (since this would require
149the allocation of state).
150An implication of this is that
151.Fn DTLSv1_listen
152only supports ClientHellos that fit inside a single datagram.
153.Sh RETURN VALUES
154From OpenSSL 1.1.0 a return value of >= 1 indicates success.
155In this instance the
156.Fa peer
157value will be filled in and the
158.Fa ssl
159object set up ready to continue the handshake.
160.Pp
161A return value of 0 indicates a non-fatal error.
162This could (for example) be because of non-blocking IO, or some invalid
163message having been received from a peer.
164Errors may be placed on the OpenSSL error queue with further information
165if appropriate.
166Typically user code is expected to retry the call to
167.Fn DTLSv1_listen
168in the event of a non-fatal error.
169Any old errors on the error queue will be cleared in the subsequent
170call.
171.Pp
172A return value of <0 indicates a fatal error.
173This could (for example) be because of a failure to allocate sufficient
174memory for the operation.
175.Pp
176Prior to OpenSSL 1.1.0 fatal and non-fatal errors both produce return
177codes <= 0 (in typical implementations user code treats all errors as
178non-fatal), whilst return codes >0 indicate success.
179.Sh SEE ALSO
180.Xr BIO_new 3 ,
181.Xr ssl 3 ,
182.Xr SSL_accept 3 ,
183.Xr SSL_get_error 3
184.Sh HISTORY
185.Fn DTLSv1_listen
186first appeared in OpenSSL 0.9.8m and has been available since
187.Ox 4.9 .
diff --git a/src/lib/libssl/man/Makefile b/src/lib/libssl/man/Makefile
deleted file mode 100644
index c8f6e28541..0000000000
--- a/src/lib/libssl/man/Makefile
+++ /dev/null
@@ -1,134 +0,0 @@
1# $OpenBSD: Makefile,v 1.77 2022/07/13 20:52:36 schwarze Exp $
2
3.include <bsd.own.mk>
4
5MAN = BIO_f_ssl.3 \
6 DTLSv1_listen.3 \
7 OPENSSL_init_ssl.3 \
8 PEM_read_SSL_SESSION.3 \
9 SSL_CIPHER_get_name.3 \
10 SSL_COMP_add_compression_method.3 \
11 SSL_CTX_add1_chain_cert.3 \
12 SSL_CTX_add_extra_chain_cert.3 \
13 SSL_CTX_add_session.3 \
14 SSL_CTX_ctrl.3 \
15 SSL_CTX_flush_sessions.3 \
16 SSL_CTX_free.3 \
17 SSL_CTX_get0_certificate.3 \
18 SSL_CTX_get_ex_new_index.3 \
19 SSL_CTX_get_verify_mode.3 \
20 SSL_CTX_load_verify_locations.3 \
21 SSL_CTX_new.3 \
22 SSL_CTX_sess_number.3 \
23 SSL_CTX_sess_set_cache_size.3 \
24 SSL_CTX_sess_set_get_cb.3 \
25 SSL_CTX_sessions.3 \
26 SSL_CTX_set1_groups.3 \
27 SSL_CTX_set_alpn_select_cb.3 \
28 SSL_CTX_set_cert_store.3 \
29 SSL_CTX_set_cert_verify_callback.3 \
30 SSL_CTX_set_cipher_list.3 \
31 SSL_CTX_set_client_CA_list.3 \
32 SSL_CTX_set_client_cert_cb.3 \
33 SSL_CTX_set_default_passwd_cb.3 \
34 SSL_CTX_set_generate_session_id.3 \
35 SSL_CTX_set_info_callback.3 \
36 SSL_CTX_set_keylog_callback.3 \
37 SSL_CTX_set_max_cert_list.3 \
38 SSL_CTX_set_min_proto_version.3 \
39 SSL_CTX_set_mode.3 \
40 SSL_CTX_set_msg_callback.3 \
41 SSL_CTX_set_options.3 \
42 SSL_CTX_set_quiet_shutdown.3 \
43 SSL_CTX_set_read_ahead.3 \
44 SSL_CTX_set_security_level.3 \
45 SSL_CTX_set_session_cache_mode.3 \
46 SSL_CTX_set_session_id_context.3 \
47 SSL_CTX_set_ssl_version.3 \
48 SSL_CTX_set_timeout.3 \
49 SSL_CTX_set_tlsext_servername_callback.3 \
50 SSL_CTX_set_tlsext_status_cb.3 \
51 SSL_CTX_set_tlsext_ticket_key_cb.3 \
52 SSL_CTX_set_tlsext_use_srtp.3 \
53 SSL_CTX_set_tmp_dh_callback.3 \
54 SSL_CTX_set_tmp_rsa_callback.3 \
55 SSL_CTX_set_verify.3 \
56 SSL_CTX_use_certificate.3 \
57 SSL_SESSION_free.3 \
58 SSL_SESSION_get0_cipher.3 \
59 SSL_SESSION_get0_peer.3 \
60 SSL_SESSION_get_compress_id.3 \
61 SSL_SESSION_get_ex_new_index.3 \
62 SSL_SESSION_get_id.3 \
63 SSL_SESSION_get_protocol_version.3 \
64 SSL_SESSION_get_time.3 \
65 SSL_SESSION_has_ticket.3 \
66 SSL_SESSION_is_resumable.3 \
67 SSL_SESSION_new.3 \
68 SSL_SESSION_print.3 \
69 SSL_SESSION_set1_id_context.3 \
70 SSL_accept.3 \
71 SSL_alert_type_string.3 \
72 SSL_clear.3 \
73 SSL_connect.3 \
74 SSL_copy_session_id.3 \
75 SSL_do_handshake.3 \
76 SSL_dup.3 \
77 SSL_dup_CA_list.3 \
78 SSL_export_keying_material.3 \
79 SSL_free.3 \
80 SSL_get_SSL_CTX.3 \
81 SSL_get_certificate.3 \
82 SSL_get_ciphers.3 \
83 SSL_get_client_CA_list.3 \
84 SSL_get_client_random.3 \
85 SSL_get_current_cipher.3 \
86 SSL_get_default_timeout.3 \
87 SSL_get_error.3 \
88 SSL_get_ex_data_X509_STORE_CTX_idx.3 \
89 SSL_get_ex_new_index.3 \
90 SSL_get_fd.3 \
91 SSL_get_finished.3 \
92 SSL_get_peer_cert_chain.3 \
93 SSL_get_peer_certificate.3 \
94 SSL_get_rbio.3 \
95 SSL_get_server_tmp_key.3 \
96 SSL_get_session.3 \
97 SSL_get_shared_ciphers.3 \
98 SSL_get_state.3 \
99 SSL_get_verify_result.3 \
100 SSL_get_version.3 \
101 SSL_library_init.3 \
102 SSL_load_client_CA_file.3 \
103 SSL_new.3 \
104 SSL_num_renegotiations.3 \
105 SSL_pending.3 \
106 SSL_read.3 \
107 SSL_read_early_data.3 \
108 SSL_renegotiate.3 \
109 SSL_rstate_string.3 \
110 SSL_session_reused.3 \
111 SSL_set1_host.3 \
112 SSL_set1_param.3 \
113 SSL_set_SSL_CTX.3 \
114 SSL_set_bio.3 \
115 SSL_set_connect_state.3 \
116 SSL_set_fd.3 \
117 SSL_set_max_send_fragment.3 \
118 SSL_set_psk_use_session_callback.3 \
119 SSL_set_session.3 \
120 SSL_set_shutdown.3 \
121 SSL_set_tmp_ecdh.3 \
122 SSL_set_verify_result.3 \
123 SSL_shutdown.3 \
124 SSL_state_string.3 \
125 SSL_want.3 \
126 SSL_write.3 \
127 d2i_SSL_SESSION.3 \
128 ssl.3
129
130all clean cleandir depend includes obj tags:
131
132install: maninstall
133
134.include <bsd.man.mk>
diff --git a/src/lib/libssl/man/OPENSSL_init_ssl.3 b/src/lib/libssl/man/OPENSSL_init_ssl.3
deleted file mode 100644
index f37dccfaac..0000000000
--- a/src/lib/libssl/man/OPENSSL_init_ssl.3
+++ /dev/null
@@ -1,76 +0,0 @@
1.\" $OpenBSD: OPENSSL_init_ssl.3,v 1.4 2019/06/14 13:41:31 schwarze Exp $
2.\" Copyright (c) 2018 Ingo Schwarze <schwarze@openbsd.org>
3.\"
4.\" Permission to use, copy, modify, and distribute this software for any
5.\" purpose with or without fee is hereby granted, provided that the above
6.\" copyright notice and this permission notice appear in all copies.
7.\"
8.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15.\"
16.Dd $Mdocdate: June 14 2019 $
17.Dt OPENSSL_INIT_SSL 3
18.Os
19.Sh NAME
20.Nm OPENSSL_init_ssl
21.Nd initialise the crypto and ssl libraries
22.Sh SYNOPSIS
23.In openssl/ssl.h
24.Ft int
25.Fo OPENSSL_init_ssl
26.Fa "uint64_t options"
27.Fa "const void *dummy"
28.Fc
29.Sh DESCRIPTION
30This function is deprecated.
31It is never useful for any application program to call it explicitly.
32The library automatically calls it internally with an
33.Fa options
34argument of 0 whenever needed.
35It is safest to assume that any function may do so.
36.Pp
37To enable or disable the standard configuration file, instead use
38.Xr OPENSSL_config 3
39or
40.Xr OPENSSL_no_config 3 ,
41respectively.
42To load a non-standard configuration file, refer to
43.Xr CONF_modules_load_file 3 .
44.Pp
45.Fn OPENSSL_init_ssl
46calls
47.Xr OPENSSL_init_crypto 3 ,
48.Xr SSL_load_error_strings 3 ,
49and
50.Xr SSL_library_init 3 .
51.Pp
52The
53.Fa options
54argument is passed on to
55.Xr OPENSSL_init_crypto 3
56and the
57.Fa dummy
58argument is ignored.
59.Pp
60If this function is called more than once,
61none of the calls except the first one have any effect.
62.Sh RETURN VALUES
63.Fn OPENSSL_init_ssl
64is intended to return 1 on success or 0 on error.
65.Sh SEE ALSO
66.Xr CONF_modules_load_file 3 ,
67.Xr OPENSSL_config 3 ,
68.Xr ssl 3
69.Sh HISTORY
70.Fn OPENSSL_init_ssl
71first appeared in OpenSSL 1.1.0 and has been available since
72.Ox 6.3 .
73.Sh BUGS
74.Fn OPENSSL_init_ssl
75silently ignores even more configuration failures than
76.Xr OPENSSL_init_crypto 3 .
diff --git a/src/lib/libssl/man/PEM_read_SSL_SESSION.3 b/src/lib/libssl/man/PEM_read_SSL_SESSION.3
deleted file mode 100644
index 3eb1414c62..0000000000
--- a/src/lib/libssl/man/PEM_read_SSL_SESSION.3
+++ /dev/null
@@ -1,147 +0,0 @@
1.\" $OpenBSD: PEM_read_SSL_SESSION.3,v 1.4 2019/06/12 09:36:30 schwarze Exp $
2.\" OpenSSL doc/man3/PEM_read_CMS.pod b97fdb57 Nov 11 09:33:09 2016 +0100
3.\"
4.\" This file was written by Rich Salz <rsalz@openssl.org>.
5.\" Copyright (c) 2016 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: June 12 2019 $
52.Dt PEM_READ_SSL_SESSION 3
53.Os
54.Sh NAME
55.Nm PEM_read_SSL_SESSION ,
56.Nm PEM_read_bio_SSL_SESSION ,
57.Nm PEM_write_SSL_SESSION ,
58.Nm PEM_write_bio_SSL_SESSION
59.Nd encode and decode SSL session objects in PEM format
60.Sh SYNOPSIS
61.In openssl/ssl.h
62.Ft SSL_SESSION *
63.Fo PEM_read_SSL_SESSION
64.Fa "FILE *fp"
65.Fa "SSL_SESSION **a"
66.Fa "pem_password_cb *cb"
67.Fa "void *u"
68.Fc
69.Ft SSL_SESSION *
70.Fo PEM_read_bio_SSL_SESSION
71.Fa "BIO *bp"
72.Fa "SSL_SESSION **a"
73.Fa "pem_password_cb *cb"
74.Fa "void *u"
75.Fc
76.Ft int
77.Fo PEM_write_SSL_SESSION
78.Fa "FILE *fp"
79.Fa "const SSL_SESSION *a"
80.Fc
81.Ft int
82.Fo PEM_write_bio_SSL_SESSION
83.Fa "BIO *bp"
84.Fa "const SSL_SESSION *a"
85.Fc
86.Sh DESCRIPTION
87These routines convert between local instances of ASN.1
88.Vt SSL_SESSION
89objects and the PEM encoding.
90.Pp
91.Fn PEM_read_SSL_SESSION
92reads a PEM-encoded
93.Vt SSL_SESSION
94object from the file
95.Fa fp
96and returns it.
97The
98.Fa cb
99and
100.Fa u
101parameters are as described in
102.Xr PEM_read_bio_PrivateKey 3 .
103.Pp
104.Fn PEM_read_bio_SSL_SESSION
105is similar to
106.Fn PEM_read_SSL_SESSION
107but reads from the BIO
108.Fa bp .
109.Pp
110.Fn PEM_write_SSL_SESSION
111writes the PEM encoding of the object
112.Fa a
113to the file
114.Fa fp .
115.Pp
116.Fn PEM_write_bio_SSL_SESSION
117similarly writes to the BIO
118.Fa bp .
119.Sh RETURN VALUES
120.Fn PEM_read_SSL_SESSION
121and
122.Fn PEM_read_bio_SSL_SESSION
123return a pointer to an allocated object, which should be released by
124calling
125.Xr SSL_SESSION_free 3 ,
126or
127.Dv NULL
128on error.
129.Pp
130.Fn PEM_write_SSL_SESSION
131and
132.Fn PEM_write_bio_SSL_SESSION
133return the number of bytes written or 0 on error.
134.Sh SEE ALSO
135.Xr PEM_read 3 ,
136.Xr ssl 3
137.Sh HISTORY
138.Fn PEM_read_SSL_SESSION
139and
140.Fn PEM_write_SSL_SESSION
141first appeared in SSLeay 0.5.2.
142.Fn PEM_read_bio_SSL_SESSION
143and
144.Fn PEM_write_bio_SSL_SESSION
145first appeared in SSLeay 0.6.0.
146These functions have been available since
147.Ox 2.4 .
diff --git a/src/lib/libssl/man/SSL_CIPHER_get_name.3 b/src/lib/libssl/man/SSL_CIPHER_get_name.3
deleted file mode 100644
index 86c1d3c0ba..0000000000
--- a/src/lib/libssl/man/SSL_CIPHER_get_name.3
+++ /dev/null
@@ -1,398 +0,0 @@
1.\" $OpenBSD: SSL_CIPHER_get_name.3,v 1.17 2024/07/16 10:19:38 tb Exp $
2.\" full merge up to: OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3.\" selective merge up to: OpenSSL 61f805c1 Jan 16 01:01:46 2018 +0800
4.\"
5.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>,
6.\" Dr. Stephen Henson <steve@openssl.org>, Todd Short <tshort@akamai.com>,
7.\" and Paul Yang <yang.yang@baishancloud.com>.
8.\" Copyright (c) 2000, 2005, 2009, 2013, 2014, 2015, 2016, 2017
9.\" The OpenSSL Project. All rights reserved.
10.\"
11.\" Redistribution and use in source and binary forms, with or without
12.\" modification, are permitted provided that the following conditions
13.\" are met:
14.\"
15.\" 1. Redistributions of source code must retain the above copyright
16.\" notice, this list of conditions and the following disclaimer.
17.\"
18.\" 2. Redistributions in binary form must reproduce the above copyright
19.\" notice, this list of conditions and the following disclaimer in
20.\" the documentation and/or other materials provided with the
21.\" distribution.
22.\"
23.\" 3. All advertising materials mentioning features or use of this
24.\" software must display the following acknowledgment:
25.\" "This product includes software developed by the OpenSSL Project
26.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
27.\"
28.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
29.\" endorse or promote products derived from this software without
30.\" prior written permission. For written permission, please contact
31.\" openssl-core@openssl.org.
32.\"
33.\" 5. Products derived from this software may not be called "OpenSSL"
34.\" nor may "OpenSSL" appear in their names without prior written
35.\" permission of the OpenSSL Project.
36.\"
37.\" 6. Redistributions of any form whatsoever must retain the following
38.\" acknowledgment:
39.\" "This product includes software developed by the OpenSSL Project
40.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
41.\"
42.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
43.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
44.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
45.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
46.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
47.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
48.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
49.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
50.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
51.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
52.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
53.\" OF THE POSSIBILITY OF SUCH DAMAGE.
54.\"
55.Dd $Mdocdate: July 16 2024 $
56.Dt SSL_CIPHER_GET_NAME 3
57.Os
58.Sh NAME
59.Nm SSL_CIPHER_get_name ,
60.Nm SSL_CIPHER_get_bits ,
61.Nm SSL_CIPHER_get_version ,
62.Nm SSL_CIPHER_get_cipher_nid ,
63.Nm SSL_CIPHER_get_digest_nid ,
64.Nm SSL_CIPHER_get_handshake_digest ,
65.Nm SSL_CIPHER_get_kx_nid ,
66.Nm SSL_CIPHER_get_auth_nid ,
67.Nm SSL_CIPHER_is_aead ,
68.Nm SSL_CIPHER_find ,
69.Nm SSL_CIPHER_get_id ,
70.Nm SSL_CIPHER_description
71.Nd get SSL_CIPHER properties
72.Sh SYNOPSIS
73.In openssl/ssl.h
74.Ft const char *
75.Fn SSL_CIPHER_get_name "const SSL_CIPHER *cipher"
76.Ft int
77.Fn SSL_CIPHER_get_bits "const SSL_CIPHER *cipher" "int *alg_bits"
78.Ft const char *
79.Fn SSL_CIPHER_get_version "const SSL_CIPHER *cipher"
80.Ft int
81.Fn SSL_CIPHER_get_cipher_nid "const SSL_CIPHER *cipher"
82.Ft int
83.Fn SSL_CIPHER_get_digest_nid "const SSL_CIPHER *cipher"
84.Ft "const EVP_MD *"
85.Fn SSL_CIPHER_get_handshake_digest "const SSL_CIPHER *cipher"
86.Ft int
87.Fn SSL_CIPHER_get_kx_nid "const SSL_CIPHER *cipher"
88.Ft int
89.Fn SSL_CIPHER_get_auth_nid "const SSL_CIPHER *cipher"
90.Ft int
91.Fn SSL_CIPHER_is_aead "const SSL_CIPHER *cipher"
92.Ft const SSL_CIPHER *
93.Fn SSL_CIPHER_find "SSL *ssl" "const unsigned char *ptr"
94.Ft unsigned long
95.Fn SSL_CIPHER_get_id "const SSL_CIPHER *cipher"
96.Ft char *
97.Fn SSL_CIPHER_description "const SSL_CIPHER *cipher" "char *buf" "int size"
98.Sh DESCRIPTION
99.Fn SSL_CIPHER_get_name
100returns a pointer to the name of
101.Fa cipher .
102.Pp
103.Fn SSL_CIPHER_get_bits
104returns the number of secret bits used for
105.Fa cipher .
106If
107.Fa alg_bits
108is not
109.Dv NULL ,
110the number of bits processed by the chosen algorithm is stored into it.
111.Pp
112.Fn SSL_CIPHER_get_version
113returns a string which indicates the SSL/TLS protocol version that first
114defined the cipher.
115This is currently
116.Qq TLSv1/SSLv3 .
117In some cases it should possibly return
118.Qq TLSv1.2
119but the function does not; use
120.Fn SSL_CIPHER_description
121instead.
122.Pp
123.Fn SSL_CIPHER_get_cipher_nid
124returns the cipher NID corresponding to the
125.Fa cipher .
126If there is no cipher (e.g. for cipher suites with no encryption), then
127.Dv NID_undef
128is returned.
129.Pp
130.Fn SSL_CIPHER_get_digest_nid
131returns the digest NID corresponding to the MAC used by the
132.Fa cipher
133during record encryption/decryption.
134If there is no digest (e.g. for AEAD cipher suites), then
135.Dv NID_undef
136is returned.
137.Pp
138.Fn SSL_CIPHER_get_handshake_digest
139returns the
140.Vt EVP_MD
141object representing the digest used during a TLS handshake with the cipher
142.Fa c ,
143which may be different to the digest used in the message authentication code
144for encrypted records.
145.Pp
146.Fn SSL_CIPHER_get_kx_nid
147returns the key exchange NID corresponding to the method used by the
148.Fa cipher .
149If there is no key exchange, then
150.Dv NID_undef
151is returned.
152Examples of possible return values include
153.Dv NID_kx_rsa ,
154.Dv NID_kx_dhe ,
155and
156.Dv NID_kx_ecdhe .
157.Pp
158.Fn SSL_CIPHER_get_auth_nid
159returns the authentication NID corresponding to the method used by the
160.Fa cipher .
161If there is no authentication,
162.Dv NID_undef
163is returned.
164Examples of possible return values include
165.Dv NID_auth_rsa
166and
167.Dv NID_auth_ecdsa .
168.Pp
169.Fn SSL_CIPHER_is_aead
170returns 1 if the
171.Fa cipher
172is AEAD (e.g. GCM or ChaCha20/Poly1305), or 0 if it is not AEAD.
173.Pp
174.Fn SSL_CIPHER_find
175returns a pointer to a
176.Vt SSL_CIPHER
177structure which has the cipher ID specified in
178.Fa ptr .
179The
180.Fa ptr
181parameter is an array of length two which stores the two-byte
182TLS cipher ID (as allocated by IANA) in network byte order.
183.Fa SSL_CIPHER_find
184returns
185.Dv NULL
186if an error occurs or the indicated cipher is not found.
187.Pp
188.Fn SSL_CIPHER_get_id
189returns the ID of the given
190.Fa cipher ,
191which must not be
192.Dv NULL .
193The ID here is an OpenSSL-specific concept, which stores a prefix
194of 0x0300 in the higher two bytes and the IANA-specified cipher
195suite ID in the lower two bytes.
196For instance, TLS_RSA_WITH_NULL_MD5 has IANA ID "0x00, 0x01", so
197.Fn SSL_CIPHER_get_id
198returns 0x03000001.
199.Pp
200.Fn SSL_CIPHER_description
201copies a textual description of
202.Fa cipher
203into the buffer
204.Fa buf ,
205which must be at least
206.Fa size
207bytes long.
208The
209.Fa cipher
210argument must not be a
211.Dv NULL
212pointer.
213If
214.Fa buf
215is
216.Dv NULL ,
217a buffer is allocated using
218.Xr asprintf 3 ;
219that buffer should be freed using the
220.Xr free 3
221function.
222If
223.Fa len
224is too small to hold the description, a pointer to the static string
225.Qq Buffer too small
226is returned.
227If memory allocation fails, which can happen even if a
228.Fa buf
229of sufficient size is provided, a pointer to the static string
230.Qq OPENSSL_malloc Error
231is returned and the content of
232.Fa buf
233remains unchanged.
234.Pp
235The string returned by
236.Fn SSL_CIPHER_description
237consists of several fields separated by whitespace:
238.Bl -tag -width Ds
239.It Aq Ar ciphername
240Textual representation of the cipher name.
241.It Aq Ar protocol version
242Protocol version:
243.Sy SSLv3 ,
244.Sy TLSv1.2 ,
245or
246.Sy TLSv1.3 .
247The TLSv1.0 ciphers are flagged with SSLv3.
248No new ciphers were added by TLSv1.1.
249.It Kx= Ns Aq Ar key exchange
250Key exchange method:
251.Sy DH ,
252.Sy ECDH ,
253.Sy GOST ,
254.Sy RSA ,
255or
256.Sy TLSv1.3 .
257.It Au= Ns Aq Ar authentication
258Authentication method:
259.Sy ECDSA ,
260.Sy GOST01 ,
261.Sy RSA ,
262.Sy TLSv1.3 ,
263or
264.Sy None .
265.Sy None
266is the representation of anonymous ciphers.
267.It Enc= Ns Aq Ar symmetric encryption method
268Encryption method with number of secret bits:
269.Sy 3DES(168) ,
270.Sy RC4(128) ,
271.Sy AES(128) ,
272.Sy AES(256) ,
273.Sy AESGCM(128) ,
274.Sy AESGCM(256) ,
275.Sy Camellia(128) ,
276.Sy Camellia(256) ,
277.Sy ChaCha20-Poly1305 ,
278.Sy GOST-28178-89-CNT ,
279or
280.Sy None .
281.It Mac= Ns Aq Ar message authentication code
282Message digest:
283.Sy MD5 ,
284.Sy SHA1 ,
285.Sy SHA256 ,
286.Sy SHA384 ,
287.Sy AEAD ,
288.Sy GOST94 ,
289.Sy GOST89IMIT ,
290or
291.Sy STREEBOG256 .
292.El
293.Sh RETURN VALUES
294.Fn SSL_CIPHER_get_name
295returns an internal pointer to a NUL-terminated string.
296.Fn SSL_CIPHER_get_version
297returns a pointer to a static NUL-terminated string.
298If
299.Fa cipher
300is a
301.Dv NULL
302pointer, both functions return a pointer to the static string
303.Qq Pq NONE .
304.Pp
305.Fn SSL_CIPHER_get_bits
306returns a positive integer representing the number of secret bits
307or 0 if
308.Fa cipher
309is a
310.Dv NULL
311pointer.
312.Pp
313.Fn SSL_CIPHER_get_cipher_nid ,
314.Fn SSL_CIPHER_get_digest_nid ,
315.Fn SSL_CIPHER_get_kx_nid ,
316and
317.Fn SSL_CIPHER_get_auth_nid
318return an NID constant or
319.Dv NID_undef
320if an error occurred.
321.Fn SSL_CIPHER_get_handshake_digest
322returns a valid
323.Vt EVP_MD
324object or
325.Dv NULL
326if an error occurred.
327.Pp
328.Fn SSL_CIPHER_is_aead
329returns 1 if the
330.Fa cipher
331is AEAD or 0 otherwise.
332.Pp
333.Fn SSL_CIPHER_find
334returns a pointer to a valid
335.Vt SSL_CIPHER
336structure or
337.Dv NULL
338if an error occurred.
339.Pp
340.Fn SSL_CIPHER_get_id
341returns a 32-bit unsigned integer.
342.Pp
343.Fn SSL_CIPHER_description
344returns
345.Fa buf
346or a newly allocated string on success or a pointer to a static
347string on error.
348.Sh EXAMPLES
349An example for the output of
350.Fn SSL_CIPHER_description :
351.Bd -literal
352ECDHE-RSA-AES256-GCM-SHA256 TLSv1.2 Kx=ECDH Au=RSA Enc=AESGCM(256) Mac=AEAD
353.Ed
354.Pp
355A complete list can be retrieved by invoking the following command:
356.Pp
357.Dl $ openssl ciphers -v ALL:COMPLEMENTOFALL
358.Sh SEE ALSO
359.Xr openssl 1 ,
360.Xr ssl 3 ,
361.Xr SSL_get_ciphers 3 ,
362.Xr SSL_get_current_cipher 3
363.Sh HISTORY
364.Fn SSL_CIPHER_description
365first appeared in SSLeay 0.8.0.
366.Fn SSL_CIPHER_get_name ,
367.Fn SSL_CIPHER_get_bits ,
368and
369.Fn SSL_CIPHER_get_version
370first appeared in SSLeay 0.8.1.
371These functions have been available since
372.Ox 2.4 .
373.Pp
374.Fn SSL_CIPHER_get_id
375first appeared in OpenSSL 1.0.1 and has been available since
376.Ox 5.3 .
377.Pp
378.Fn SSL_CIPHER_get_cipher_nid ,
379.Fn SSL_CIPHER_get_digest_nid ,
380.Fn SSL_CIPHER_get_kx_nid ,
381.Fn SSL_CIPHER_get_auth_nid ,
382and
383.Fn SSL_CIPHER_is_aead
384first appeared in OpenSSL 1.1.0 and have been available since
385.Ox 6.3 .
386.Fn SSL_CIPHER_find
387first appeared in OpenSSL 1.1.0 and has been available since
388.Ox 7.0 .
389.Fn SSL_CIPHER_get_handshake_digest
390first appeared in OpenSSL 1.1.1 and has been available since
391.Ox 7.6 .
392.Sh BUGS
393If
394.Fn SSL_CIPHER_description
395cannot handle a built-in cipher,
396the according description of the cipher property is
397.Qq unknown .
398This case should not occur.
diff --git a/src/lib/libssl/man/SSL_COMP_add_compression_method.3 b/src/lib/libssl/man/SSL_COMP_add_compression_method.3
deleted file mode 100644
index f9e25358d7..0000000000
--- a/src/lib/libssl/man/SSL_COMP_add_compression_method.3
+++ /dev/null
@@ -1,42 +0,0 @@
1.\" $OpenBSD: SSL_COMP_add_compression_method.3,v 1.7 2024/08/31 10:51:48 tb Exp $
2.\"
3.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd $Mdocdate: August 31 2024 $
18.Dt SSL_COMP_ADD_COMPRESSION_METHOD 3
19.Os
20.Sh NAME
21.Nm SSL_COMP_get_compression_methods
22.Nd handle SSL/TLS integrated compression methods
23.Sh SYNOPSIS
24.In openssl/ssl.h
25.Ft STACK_OF(SSL_COMP) *
26.Fn SSL_COMP_get_compression_methods void
27.Sh DESCRIPTION
28This function is deprecated and has no effect.
29It is provided purely for compatibility with legacy application code.
30.Pp
31.Fn SSL_COMP_get_compression_methods
32used to return a stack of available compression methods.
33.Sh RETURN VALUES
34.Fn SSL_COMP_get_compression_methods
35always returns
36.Dv NULL .
37.Sh SEE ALSO
38.Xr ssl 3
39.Sh HISTORY
40.Fn SSL_COMP_get_compression_methods
41first appeared in OpenSSL 0.9.8 and has been available since
42.Ox 4.5 .
diff --git a/src/lib/libssl/man/SSL_CTX_add1_chain_cert.3 b/src/lib/libssl/man/SSL_CTX_add1_chain_cert.3
deleted file mode 100644
index 86eb27a523..0000000000
--- a/src/lib/libssl/man/SSL_CTX_add1_chain_cert.3
+++ /dev/null
@@ -1,222 +0,0 @@
1.\" $OpenBSD: SSL_CTX_add1_chain_cert.3,v 1.2 2025/01/18 10:45:12 tb Exp $
2.\" selective merge up to: OpenSSL df75c2bf Dec 9 01:02:36 2018 +0100
3.\"
4.\" This file was written by Dr. Stephen Henson <steve@openssl.org>
5.\" and Rob Stradling <rob.stradling@comodo.com>.
6.\" Copyright (c) 2013 The OpenSSL Project. All rights reserved.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\"
12.\" 1. Redistributions of source code must retain the above copyright
13.\" notice, this list of conditions and the following disclaimer.
14.\"
15.\" 2. Redistributions in binary form must reproduce the above copyright
16.\" notice, this list of conditions and the following disclaimer in
17.\" the documentation and/or other materials provided with the
18.\" distribution.
19.\"
20.\" 3. All advertising materials mentioning features or use of this
21.\" software must display the following acknowledgment:
22.\" "This product includes software developed by the OpenSSL Project
23.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
24.\"
25.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
26.\" endorse or promote products derived from this software without
27.\" prior written permission. For written permission, please contact
28.\" openssl-core@openssl.org.
29.\"
30.\" 5. Products derived from this software may not be called "OpenSSL"
31.\" nor may "OpenSSL" appear in their names without prior written
32.\" permission of the OpenSSL Project.
33.\"
34.\" 6. Redistributions of any form whatsoever must retain the following
35.\" acknowledgment:
36.\" "This product includes software developed by the OpenSSL Project
37.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
38.\"
39.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
40.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
43.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50.\" OF THE POSSIBILITY OF SUCH DAMAGE.
51.\"
52.Dd $Mdocdate: January 18 2025 $
53.Dt SSL_CTX_ADD1_CHAIN_CERT 3
54.Os
55.Sh NAME
56.Nm SSL_CTX_set0_chain ,
57.Nm SSL_CTX_set1_chain ,
58.Nm SSL_CTX_add0_chain_cert ,
59.Nm SSL_CTX_add1_chain_cert ,
60.Nm SSL_CTX_get0_chain_certs ,
61.Nm SSL_CTX_clear_chain_certs ,
62.Nm SSL_set0_chain ,
63.Nm SSL_set1_chain ,
64.Nm SSL_add0_chain_cert ,
65.Nm SSL_add1_chain_cert ,
66.Nm SSL_get0_chain_certs ,
67.Nm SSL_clear_chain_certs
68.Nd extra chain certificate processing
69.Sh SYNOPSIS
70.In openssl/ssl.h
71.Ft int
72.Fo SSL_CTX_set0_chain
73.Fa "SSL_CTX *ctx"
74.Fa "STACK_OF(X509) *chain"
75.Fc
76.Ft int
77.Fo SSL_CTX_set1_chain
78.Fa "SSL_CTX *ctx"
79.Fa "STACK_OF(X509) *chain"
80.Fc
81.Ft int
82.Fo SSL_CTX_add0_chain_cert
83.Fa "SSL_CTX *ctx"
84.Fa "X509 *cert"
85.Fc
86.Ft int
87.Fo SSL_CTX_add1_chain_cert
88.Fa "SSL_CTX *ctx"
89.Fa "X509 *cert"
90.Fc
91.Ft int
92.Fo SSL_CTX_get0_chain_certs
93.Fa "SSL_CTX *ctx"
94.Fa "STACK_OF(X509) **chain"
95.Fc
96.Ft int
97.Fo SSL_CTX_clear_chain_certs
98.Fa "SSL_CTX *ctx"
99.Fc
100.Ft int
101.Fo SSL_set0_chain
102.Fa "SSL *ssl"
103.Fa "STACK_OF(X509) *chain"
104.Fc
105.Ft int
106.Fo SSL_set1_chain
107.Fa "SSL *ssl"
108.Fa "STACK_OF(X509) *chain"
109.Fc
110.Ft int
111.Fo SSL_add0_chain_cert
112.Fa "SSL *ssl"
113.Fa "X509 *cert"
114.Fc
115.Ft int
116.Fo SSL_add1_chain_cert
117.Fa "SSL *ssl"
118.Fa "X509 *cert"
119.Fc
120.Ft int
121.Fo SSL_get0_chain_certs
122.Fa "SSL *ssl"
123.Fa "STACK_OF(X509) **chain"
124.Fc
125.Ft int
126.Fo SSL_clear_chain_certs
127.Fa "SSL *ssl"
128.Fc
129.Sh DESCRIPTION
130.Fn SSL_CTX_set0_chain
131and
132.Fn SSL_CTX_set1_chain
133set the certificate chain associated with the current certificate of
134.Fa ctx
135to
136.Fa chain .
137The
138.Fa chain
139is not supposed to include the current certificate itself.
140.Pp
141.Fn SSL_CTX_add0_chain_cert
142and
143.Fn SSL_CTX_add1_chain_cert
144append the single certificate
145.Fa cert
146to the chain associated with the current certificate of
147.Fa ctx .
148.Pp
149.Fn SSL_CTX_get0_chain_certs
150retrieves the chain associated with the current certificate of
151.Fa ctx .
152.Pp
153.Fn SSL_CTX_clear_chain_certs
154clears the existing chain associated with the current certificate of
155.Fa ctx ,
156if any.
157This is equivalent to calling
158.Fn SSL_CTX_set0_chain
159with
160.Fa chain
161set to
162.Dv NULL .
163.Pp
164Each of these functions operates on the
165.Em current
166end entity (i.e. server or client) certificate.
167This is the last certificate loaded or selected on the corresponding
168.Fa ctx
169structure, for example using
170.Xr SSL_CTX_use_certificate 3 .
171.Pp
172.Fn SSL_set0_chain ,
173.Fn SSL_set1_chain ,
174.Fn SSL_add0_chain_cert ,
175.Fn SSL_add1_chain_cert ,
176.Fn SSL_get0_chain_certs ,
177and
178.Fn SSL_clear_chain_certs
179are similar except that they operate on the
180.Fa ssl
181connection.
182.Pp
183The functions containing a
184.Sy 1
185in their name increment the reference count of the supplied certificate
186or chain, so it must be freed at some point after the operation.
187Those containing a
188.Sy 0
189do not increment reference counts and the supplied certificate or chain
190must not be freed after the operation.
191.Pp
192The chains associated with an
193.Vt SSL_CTX
194structure are copied to the new
195.Vt SSL
196structure when
197.Xr SSL_new 3
198is called.
199Existing
200.Vt SSL
201structures are not affected by any chains subsequently changed
202in the parent
203.Vt SSL_CTX .
204.Pp
205One chain can be set for each key type supported by a server.
206So, for example, an RSA and an ECDSA certificate can have
207different chains.
208.Pp
209If any certificates are added using these functions, no certificates
210added using
211.Xr SSL_CTX_add_extra_chain_cert 3
212will be used.
213.Sh RETURN VALUES
214These functions return 1 for success or 0 for failure.
215.Sh SEE ALSO
216.Xr ssl 3 ,
217.Xr SSL_CTX_add_extra_chain_cert 3 ,
218.Xr SSL_CTX_use_certificate 3
219.Sh HISTORY
220These functions first appeared in OpenSSL 1.0.2
221and have been available since
222.Ox 6.5 .
diff --git a/src/lib/libssl/man/SSL_CTX_add_extra_chain_cert.3 b/src/lib/libssl/man/SSL_CTX_add_extra_chain_cert.3
deleted file mode 100644
index b9694b0cbc..0000000000
--- a/src/lib/libssl/man/SSL_CTX_add_extra_chain_cert.3
+++ /dev/null
@@ -1,160 +0,0 @@
1.\" $OpenBSD: SSL_CTX_add_extra_chain_cert.3,v 1.8 2025/01/18 10:45:12 tb Exp $
2.\" full merge up to: OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org> and
5.\" Dr. Stephen Henson <steve@openssl.org>.
6.\" Copyright (c) 2000, 2002, 2013, 2015 The OpenSSL Project.
7.\" All rights reserved.
8.\"
9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions
11.\" are met:
12.\"
13.\" 1. Redistributions of source code must retain the above copyright
14.\" notice, this list of conditions and the following disclaimer.
15.\"
16.\" 2. Redistributions in binary form must reproduce the above copyright
17.\" notice, this list of conditions and the following disclaimer in
18.\" the documentation and/or other materials provided with the
19.\" distribution.
20.\"
21.\" 3. All advertising materials mentioning features or use of this
22.\" software must display the following acknowledgment:
23.\" "This product includes software developed by the OpenSSL Project
24.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
25.\"
26.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
27.\" endorse or promote products derived from this software without
28.\" prior written permission. For written permission, please contact
29.\" openssl-core@openssl.org.
30.\"
31.\" 5. Products derived from this software may not be called "OpenSSL"
32.\" nor may "OpenSSL" appear in their names without prior written
33.\" permission of the OpenSSL Project.
34.\"
35.\" 6. Redistributions of any form whatsoever must retain the following
36.\" acknowledgment:
37.\" "This product includes software developed by the OpenSSL Project
38.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
39.\"
40.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
41.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
42.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
43.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
44.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
45.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
46.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
47.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
49.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
50.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
51.\" OF THE POSSIBILITY OF SUCH DAMAGE.
52.\"
53.Dd $Mdocdate: January 18 2025 $
54.Dt SSL_CTX_ADD_EXTRA_CHAIN_CERT 3
55.Os
56.Sh NAME
57.Nm SSL_CTX_add_extra_chain_cert ,
58.Nm SSL_CTX_get_extra_chain_certs_only ,
59.Nm SSL_CTX_get_extra_chain_certs ,
60.Nm SSL_CTX_clear_extra_chain_certs
61.Nd add, retrieve, and clear extra chain certificates
62.Sh SYNOPSIS
63.In openssl/ssl.h
64.Ft long
65.Fn SSL_CTX_add_extra_chain_cert "SSL_CTX *ctx" "X509 *x509"
66.Ft long
67.Fn SSL_CTX_get_extra_chain_certs_only "SSL_CTX *ctx" "STACK_OF(X509) **certs"
68.Ft long
69.Fn SSL_CTX_get_extra_chain_certs "SSL_CTX *ctx" "STACK_OF(X509) **certs"
70.Ft long
71.Fn SSL_CTX_clear_extra_chain_certs "SSL_CTX *ctx"
72.Sh DESCRIPTION
73.Fn SSL_CTX_add_extra_chain_cert
74adds the certificate
75.Fa x509
76to the extra chain certificates associated with
77.Fa ctx .
78Several certificates can be added one after another.
79.Pp
80.Fn SSL_CTX_get_extra_chain_certs_only
81retrieves an internal pointer to the stack of extra chain certificates
82associated with
83.Fa ctx ,
84or set
85.Pf * Fa certs
86to
87.Dv NULL
88if there are none.
89.Pp
90.Fn SSL_CTX_get_extra_chain_certs
91does the same except that it retrieves an internal pointer
92to the chain associated with the certificate
93if there are no extra chain certificates.
94.Pp
95.Fn SSL_CTX_clear_extra_chain_certs
96clears all extra chain certificates associated with
97.Fa ctx .
98.Pp
99These functions are implemented as macros.
100.Pp
101When sending a certificate chain, extra chain certificates are sent
102in order following the end entity certificate.
103.Pp
104If no chain is specified, the library will try to complete the chain from the
105available CA certificates in the trusted CA storage, see
106.Xr SSL_CTX_load_verify_locations 3 .
107.Pp
108The x509 certificate provided to
109.Fn SSL_CTX_add_extra_chain_cert
110will be freed by the library when the
111.Vt SSL_CTX
112is destroyed.
113An application should not free the
114.Fa x509
115object, nor the
116.Pf * Fa certs
117object retrieved by
118.Fn SSL_CTX_get_extra_chain_certs .
119.Sh RETURN VALUES
120These functions return 1 on success or 0 for failure.
121Check out the error stack to find out the reason for failure.
122.Sh SEE ALSO
123.Xr ssl 3 ,
124.Xr SSL_CTX_add1_chain_cert 3 ,
125.Xr SSL_CTX_ctrl 3 ,
126.Xr SSL_CTX_load_verify_locations 3 ,
127.Xr SSL_CTX_set_client_cert_cb 3 ,
128.Xr SSL_CTX_use_certificate 3
129.Sh HISTORY
130.Fn SSL_CTX_add_extra_chain_cert
131first appeared in SSLeay 0.9.1 and has been available since
132.Ox 2.6 .
133.Pp
134.Fn SSL_CTX_get_extra_chain_certs
135and
136.Fn SSL_CTX_clear_extra_chain_certs
137first appeared in OpenSSL 1.0.1 and have been available since
138.Ox 5.3 .
139.Pp
140.Fn SSL_CTX_get_extra_chain_certs_only
141first appeared in OpenSSL 1.0.2 and has been available since
142.Ox 6.7 .
143.Sh CAVEATS
144Certificates added with
145.Fn SSL_CTX_add_extra_chain_cert
146are ignored when certificates are also available that have been
147added using the functions documented in
148.Xr SSL_CTX_set1_chain 3 .
149.Pp
150Only one set of extra chain certificates can be specified per
151.Vt SSL_CTX
152structure using
153.Fn SSL_CTX_add_extra_chain_cert .
154Different chains for different certificates (for example if both
155RSA and ECDSA certificates are specified by the same server) or
156different SSL structures with the same parent
157.Vt SSL_CTX
158require using the functions documented in
159.Xr SSL_CTX_set1_chain 3
160instead.
diff --git a/src/lib/libssl/man/SSL_CTX_add_session.3 b/src/lib/libssl/man/SSL_CTX_add_session.3
deleted file mode 100644
index 443bdb542a..0000000000
--- a/src/lib/libssl/man/SSL_CTX_add_session.3
+++ /dev/null
@@ -1,132 +0,0 @@
1.\" $OpenBSD: SSL_CTX_add_session.3,v 1.5 2018/03/27 17:35:50 schwarze Exp $
2.\" OpenSSL SSL_CTX_add_session.pod 1722496f Jun 8 15:18:38 2017 -0400
3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org> and
5.\" Geoff Thorpe <geoff@openssl.org>.
6.\" Copyright (c) 2001, 2002, 2014 The OpenSSL Project. All rights reserved.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\"
12.\" 1. Redistributions of source code must retain the above copyright
13.\" notice, this list of conditions and the following disclaimer.
14.\"
15.\" 2. Redistributions in binary form must reproduce the above copyright
16.\" notice, this list of conditions and the following disclaimer in
17.\" the documentation and/or other materials provided with the
18.\" distribution.
19.\"
20.\" 3. All advertising materials mentioning features or use of this
21.\" software must display the following acknowledgment:
22.\" "This product includes software developed by the OpenSSL Project
23.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
24.\"
25.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
26.\" endorse or promote products derived from this software without
27.\" prior written permission. For written permission, please contact
28.\" openssl-core@openssl.org.
29.\"
30.\" 5. Products derived from this software may not be called "OpenSSL"
31.\" nor may "OpenSSL" appear in their names without prior written
32.\" permission of the OpenSSL Project.
33.\"
34.\" 6. Redistributions of any form whatsoever must retain the following
35.\" acknowledgment:
36.\" "This product includes software developed by the OpenSSL Project
37.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
38.\"
39.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
40.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
43.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50.\" OF THE POSSIBILITY OF SUCH DAMAGE.
51.\"
52.Dd $Mdocdate: March 27 2018 $
53.Dt SSL_CTX_ADD_SESSION 3
54.Os
55.Sh NAME
56.Nm SSL_CTX_add_session ,
57.Nm SSL_CTX_remove_session
58.Nd manipulate session cache
59.Sh SYNOPSIS
60.In openssl/ssl.h
61.Ft int
62.Fn SSL_CTX_add_session "SSL_CTX *ctx" "SSL_SESSION *c"
63.Ft int
64.Fn SSL_CTX_remove_session "SSL_CTX *ctx" "SSL_SESSION *c"
65.Sh DESCRIPTION
66.Fn SSL_CTX_add_session
67adds the session
68.Fa c
69to the context
70.Fa ctx .
71The reference count for session
72.Fa c
73is incremented by 1.
74If a session with the same session id already exists,
75the old session is removed by calling
76.Xr SSL_SESSION_free 3 .
77.Pp
78.Fn SSL_CTX_remove_session
79removes the session
80.Fa c
81from the context
82.Fa ctx
83and marks it as non-resumable.
84.Xr SSL_SESSION_free 3
85is called once for
86.Fa c .
87.Pp
88When adding a new session to the internal session cache, it is examined
89whether a session with the same session id already exists.
90In this case it is assumed that both sessions are identical.
91If the same session is stored in a different
92.Vt SSL_SESSION
93object, the old session is removed and replaced by the new session.
94If the session is actually identical (the
95.Vt SSL_SESSION
96object is identical),
97.Fn SSL_CTX_add_session
98is a no-op, and the return value is 0.
99.Pp
100If a server
101.Vt SSL_CTX
102is configured with the
103.Dv SSL_SESS_CACHE_NO_INTERNAL_STORE
104flag then the internal cache will not be populated automatically by new
105sessions negotiated by the SSL/TLS implementation, even though the internal
106cache will be searched automatically for session-resume requests (the
107latter can be suppressed by
108.Dv SSL_SESS_CACHE_NO_INTERNAL_LOOKUP ) .
109So the application can use
110.Fn SSL_CTX_add_session
111directly to have full control over the sessions that can be resumed if desired.
112.Sh RETURN VALUES
113The following values are returned by all functions:
114.Bl -tag -width Ds
115.It 0
116The operation failed.
117In case of the add operation, it was tried to add the same (identical) session
118twice.
119In case of the remove operation, the session was not found in the cache.
120.It 1
121The operation succeeded.
122.El
123.Sh SEE ALSO
124.Xr ssl 3 ,
125.Xr SSL_CTX_set_session_cache_mode 3 ,
126.Xr SSL_SESSION_free 3
127.Sh HISTORY
128.Fn SSL_CTX_add_session
129and
130.Fn SSL_CTX_remove_session
131first appeared in SSLeay 0.8.0 and have been available since
132.Ox 2.4 .
diff --git a/src/lib/libssl/man/SSL_CTX_ctrl.3 b/src/lib/libssl/man/SSL_CTX_ctrl.3
deleted file mode 100644
index c91ddff374..0000000000
--- a/src/lib/libssl/man/SSL_CTX_ctrl.3
+++ /dev/null
@@ -1,122 +0,0 @@
1.\" $OpenBSD: SSL_CTX_ctrl.3,v 1.7 2018/03/27 17:35:50 schwarze Exp $
2.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
5.\" Copyright (c) 2001 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: March 27 2018 $
52.Dt SSL_CTX_CTRL 3
53.Os
54.Sh NAME
55.Nm SSL_CTX_ctrl ,
56.Nm SSL_CTX_callback_ctrl ,
57.Nm SSL_ctrl ,
58.Nm SSL_callback_ctrl
59.Nd internal handling functions for SSL_CTX and SSL objects
60.Sh SYNOPSIS
61.In openssl/ssl.h
62.Ft long
63.Fn SSL_CTX_ctrl "SSL_CTX *ctx" "int cmd" "long larg" "void *parg"
64.Ft long
65.Fn SSL_CTX_callback_ctrl "SSL_CTX *" "int cmd" "void (*fp)()"
66.Ft long
67.Fn SSL_ctrl "SSL *ssl" "int cmd" "long larg" "void *parg"
68.Ft long
69.Fn SSL_callback_ctrl "SSL *" "int cmd" "void (*fp)()"
70.Sh DESCRIPTION
71The
72.Fn SSL_*_ctrl
73family of functions is used to manipulate settings of
74the
75.Vt SSL_CTX
76and
77.Vt SSL
78objects.
79Depending on the command
80.Fa cmd
81the arguments
82.Fa larg ,
83.Fa parg ,
84or
85.Fa fp
86are evaluated.
87These functions should never be called directly.
88All functionalities needed are made available via other functions or macros.
89.Sh RETURN VALUES
90The return values of the
91.Fn SSL*_ctrl
92functions depend on the command supplied via the
93.Fn cmd
94parameter.
95.Sh SEE ALSO
96.Xr ssl 3 ,
97.Xr SSL_CTX_add_extra_chain_cert 3 ,
98.Xr SSL_CTX_sess_number 3 ,
99.Xr SSL_CTX_sess_set_cache_size 3 ,
100.Xr SSL_CTX_set_max_cert_list 3 ,
101.Xr SSL_CTX_set_mode 3 ,
102.Xr SSL_CTX_set_options 3 ,
103.Xr SSL_CTX_set_session_cache_mode 3 ,
104.Xr SSL_CTX_set_tlsext_servername_callback 3 ,
105.Xr SSL_CTX_set_tlsext_status_cb 3 ,
106.Xr SSL_CTX_set_tlsext_ticket_key_cb 3 ,
107.Xr SSL_get_server_tmp_key 3 ,
108.Xr SSL_num_renegotiations 3 ,
109.Xr SSL_session_reused 3 ,
110.Xr SSL_set_max_send_fragment 3
111.Sh HISTORY
112.Fn SSL_CTX_ctrl
113and
114.Fn SSL_ctrl
115first appeared in SSLeay 0.8.0 and have been available since
116.Ox 2.4 .
117.Pp
118.Fn SSL_CTX_callback_ctrl
119and
120.Fn SSL_callback_ctrl
121first appeared in OpenSSL 0.9.5 and have been available since
122.Ox 2.7 .
diff --git a/src/lib/libssl/man/SSL_CTX_flush_sessions.3 b/src/lib/libssl/man/SSL_CTX_flush_sessions.3
deleted file mode 100644
index 2ef781cb4a..0000000000
--- a/src/lib/libssl/man/SSL_CTX_flush_sessions.3
+++ /dev/null
@@ -1,100 +0,0 @@
1.\" $OpenBSD: SSL_CTX_flush_sessions.3,v 1.5 2018/03/27 17:35:50 schwarze Exp $
2.\" OpenSSL SSL_CTX_flush_sessions.pod 1722496f Jun 8 15:18:38 2017 -0400
3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
5.\" Copyright (c) 2001 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: March 27 2018 $
52.Dt SSL_CTX_FLUSH_SESSIONS 3
53.Os
54.Sh NAME
55.Nm SSL_CTX_flush_sessions
56.Nd remove expired sessions
57.Sh SYNOPSIS
58.In openssl/ssl.h
59.Ft void
60.Fn SSL_CTX_flush_sessions "SSL_CTX *ctx" "long tm"
61.Sh DESCRIPTION
62.Fn SSL_CTX_flush_sessions
63causes a run through the session cache of
64.Fa ctx
65to remove sessions expired at time
66.Fa tm .
67.Pp
68If enabled, the internal session cache will collect all sessions established
69up to the specified maximum number (see
70.Xr SSL_CTX_sess_set_cache_size 3 ) .
71As sessions will not be reused once they are expired, they should be
72removed from the cache to save resources.
73This can either be done automatically whenever 255 new sessions were
74established (see
75.Xr SSL_CTX_set_session_cache_mode 3 )
76or manually by calling
77.Fn SSL_CTX_flush_sessions .
78.Pp
79The parameter
80.Fa tm
81specifies the time which should be used for the
82expiration test, in most cases the actual time given by
83.Fn time 0
84will be used.
85.Pp
86.Fn SSL_CTX_flush_sessions
87will only check sessions stored in the internal cache.
88When a session is found and removed, the
89.Va remove_session_cb
90is however called to synchronize with the external cache (see
91.Xr SSL_CTX_sess_set_get_cb 3 ) .
92.Sh SEE ALSO
93.Xr ssl 3 ,
94.Xr SSL_CTX_sess_set_get_cb 3 ,
95.Xr SSL_CTX_set_session_cache_mode 3 ,
96.Xr SSL_CTX_set_timeout 3
97.Sh HISTORY
98.Fn SSL_CTX_flush_sessions
99first appeared in SSLeay 0.8.0 and has been available since
100.Ox 2.4 .
diff --git a/src/lib/libssl/man/SSL_CTX_free.3 b/src/lib/libssl/man/SSL_CTX_free.3
deleted file mode 100644
index 47f247631b..0000000000
--- a/src/lib/libssl/man/SSL_CTX_free.3
+++ /dev/null
@@ -1,101 +0,0 @@
1.\" $OpenBSD: SSL_CTX_free.3,v 1.4 2018/03/27 17:35:50 schwarze Exp $
2.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
5.\" Copyright (c) 2000, 2001, 2003 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: March 27 2018 $
52.Dt SSL_CTX_FREE 3
53.Os
54.Sh NAME
55.Nm SSL_CTX_free
56.Nd free an allocated SSL_CTX object
57.Sh SYNOPSIS
58.In openssl/ssl.h
59.Ft void
60.Fn SSL_CTX_free "SSL_CTX *ctx"
61.Sh DESCRIPTION
62.Fn SSL_CTX_free
63decrements the reference count of
64.Fa ctx ,
65and removes the
66.Vt SSL_CTX
67object pointed to by
68.Fa ctx
69and frees up the allocated memory if the reference count has reached 0.
70If
71.Fa ctx
72is a
73.Dv NULL
74pointer, no action occurs.
75.Pp
76It also calls the
77.Xr free 3 Ns ing
78procedures for indirectly affected items, if applicable:
79the session cache, the list of ciphers, the list of Client CAs,
80the certificates and keys.
81.Sh WARNINGS
82If a session-remove callback is set
83.Pq Xr SSL_CTX_sess_set_remove_cb 3 ,
84this callback will be called for each session being freed from
85.Fa ctx Ns 's
86session cache.
87This implies that all corresponding sessions from an external session cache are
88removed as well.
89If this is not desired, the user should explicitly unset the callback by
90calling
91.Fn SSL_CTX_sess_set_remove_cb ctx NULL
92prior to calling
93.Fn SSL_CTX_free .
94.Sh SEE ALSO
95.Xr ssl 3 ,
96.Xr SSL_CTX_new 3 ,
97.Xr SSL_CTX_sess_set_get_cb 3
98.Sh HISTORY
99.Fn SSL_CTX_free
100first appeared in SSLeay 0.5.1 and has been available since
101.Ox 2.4 .
diff --git a/src/lib/libssl/man/SSL_CTX_get0_certificate.3 b/src/lib/libssl/man/SSL_CTX_get0_certificate.3
deleted file mode 100644
index 63c86bd5e0..0000000000
--- a/src/lib/libssl/man/SSL_CTX_get0_certificate.3
+++ /dev/null
@@ -1,51 +0,0 @@
1.\" $OpenBSD: SSL_CTX_get0_certificate.3,v 1.3 2019/06/12 09:36:30 schwarze Exp $
2.\"
3.\" Copyright (c) 2018 Ingo Schwarze <schwarze@openbsd.org>
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd $Mdocdate: June 12 2019 $
18.Dt SSL_CTX_GET0_CERTIFICATE 3
19.Os
20.Sh NAME
21.Nm SSL_CTX_get0_certificate
22.Nd get the active certificate from an SSL context
23.Sh SYNOPSIS
24.Ft X509 *
25.Fo SSL_CTX_get0_certificate
26.Fa "const SSL_CTX *ctx"
27.Fc
28.Sh DESCRIPTION
29The
30.Fn SSL_CTX_get0_certificate
31function returns an internal pointer
32to the ASN.1 certificate currently active in
33.Fa ctx
34or
35.Dv NULL
36if none was installed with
37.Xr SSL_CTX_use_certificate 3
38or similar functions.
39.Pp
40The returned pointer must not be freed by the caller.
41.Sh SEE ALSO
42.Xr ssl 3 ,
43.Xr SSL_CTX_new 3 ,
44.Xr SSL_CTX_use_certificate 3 ,
45.Xr X509_get_pubkey 3 ,
46.Xr X509_get_subject_name 3 ,
47.Xr X509_new 3
48.Sh HISTORY
49.Fn SSL_CTX_get0_certificate
50first appeared in OpenSSL 1.0.2 and have been available since
51.Ox 6.3 .
diff --git a/src/lib/libssl/man/SSL_CTX_get_ex_new_index.3 b/src/lib/libssl/man/SSL_CTX_get_ex_new_index.3
deleted file mode 100644
index 3dbaf2e981..0000000000
--- a/src/lib/libssl/man/SSL_CTX_get_ex_new_index.3
+++ /dev/null
@@ -1,124 +0,0 @@
1.\" $OpenBSD: SSL_CTX_get_ex_new_index.3,v 1.3 2018/03/21 08:06:34 schwarze Exp $
2.\" OpenSSL 9b86974e Aug 17 15:21:33 2015 -0400
3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
5.\" Copyright (c) 2001, 2005 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: March 21 2018 $
52.Dt SSL_CTX_GET_EX_NEW_INDEX 3
53.Os
54.Sh NAME
55.Nm SSL_CTX_get_ex_new_index ,
56.Nm SSL_CTX_set_ex_data ,
57.Nm SSL_CTX_get_ex_data
58.Nd internal application specific data functions
59.Sh SYNOPSIS
60.In openssl/ssl.h
61.Ft int
62.Fo SSL_CTX_get_ex_new_index
63.Fa "long argl"
64.Fa "void *argp"
65.Fa "CRYPTO_EX_new *new_func"
66.Fa "CRYPTO_EX_dup *dup_func"
67.Fa "CRYPTO_EX_free *free_func"
68.Fc
69.Ft int
70.Fn SSL_CTX_set_ex_data "SSL_CTX *ctx" "int idx" "void *arg"
71.Ft void *
72.Fn SSL_CTX_get_ex_data "const SSL_CTX *ctx" "int idx"
73.Bd -literal
74 typedef int new_func(void *parent, void *ptr, CRYPTO_EX_DATA *ad,
75 int idx, long argl, void *argp);
76 typedef void free_func(void *parent, void *ptr, CRYPTO_EX_DATA *ad,
77 int idx, long argl, void *argp);
78 typedef int dup_func(CRYPTO_EX_DATA *to, CRYPTO_EX_DATA *from, void *from_d,
79 int idx, long argl, void *argp);
80.Ed
81.Sh DESCRIPTION
82Several OpenSSL structures can have application specific data attached to them.
83These functions are used internally by OpenSSL to manipulate application
84specific data attached to a specific structure.
85.Pp
86.Fn SSL_CTX_get_ex_new_index
87is used to register a new index for application specific data.
88.Pp
89.Fn SSL_CTX_set_ex_data
90is used to store application data at
91.Fa arg
92for
93.Fa idx
94into the
95.Fa ctx
96object.
97.Pp
98.Fn SSL_CTX_get_ex_data
99is used to retrieve the information for
100.Fa idx
101from
102.Fa ctx .
103.Pp
104A detailed description for the
105.Fn *_get_ex_new_index
106functionality can be found in
107.Xr RSA_get_ex_new_index 3 .
108The
109.Fn *_get_ex_data
110and
111.Fn *_set_ex_data
112functionality is described in
113.Xr CRYPTO_set_ex_data 3 .
114.Sh SEE ALSO
115.Xr CRYPTO_set_ex_data 3 ,
116.Xr RSA_get_ex_new_index 3 ,
117.Xr ssl 3
118.Sh HISTORY
119.Fn SSL_CTX_get_ex_new_index ,
120.Fn SSL_CTX_set_ex_data ,
121and
122.Fn SSL_CTX_get_ex_data
123first appeared in SSLeay 0.9.0 and have been available since
124.Ox 2.4 .
diff --git a/src/lib/libssl/man/SSL_CTX_get_verify_mode.3 b/src/lib/libssl/man/SSL_CTX_get_verify_mode.3
deleted file mode 100644
index 7c87775069..0000000000
--- a/src/lib/libssl/man/SSL_CTX_get_verify_mode.3
+++ /dev/null
@@ -1,131 +0,0 @@
1.\" $OpenBSD: SSL_CTX_get_verify_mode.3,v 1.5 2018/03/27 17:35:50 schwarze Exp $
2.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
5.\" Copyright (c) 2000, 2005 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: March 27 2018 $
52.Dt SSL_CTX_GET_VERIFY_MODE 3
53.Os
54.Sh NAME
55.Nm SSL_CTX_get_verify_mode ,
56.Nm SSL_get_verify_mode ,
57.Nm SSL_CTX_get_verify_depth ,
58.Nm SSL_get_verify_depth ,
59.Nm SSL_get_verify_callback ,
60.Nm SSL_CTX_get_verify_callback
61.Nd get currently set verification parameters
62.Sh SYNOPSIS
63.In openssl/ssl.h
64.Ft int
65.Fn SSL_CTX_get_verify_mode "const SSL_CTX *ctx"
66.Ft int
67.Fn SSL_get_verify_mode "const SSL *ssl"
68.Ft int
69.Fn SSL_CTX_get_verify_depth "const SSL_CTX *ctx"
70.Ft int
71.Fn SSL_get_verify_depth "const SSL *ssl"
72.Ft int
73.Fo "(*SSL_CTX_get_verify_callback(const SSL_CTX *ctx))"
74.Fa int "X509_STORE_CTX *"
75.Fc
76.Ft int
77.Fo "(*SSL_get_verify_callback(const SSL *ssl))"
78.Fa int "X509_STORE_CTX *"
79.Fc
80.Sh DESCRIPTION
81.Fn SSL_CTX_get_verify_mode
82returns the verification mode currently set in
83.Fa ctx .
84.Pp
85.Fn SSL_get_verify_mode
86returns the verification mode currently set in
87.Fa ssl .
88.Pp
89.Fn SSL_CTX_get_verify_depth
90returns the verification depth limit currently set
91in
92.Fa ctx .
93If no limit has been explicitly set,
94\(mi1 is returned and the default value will be used.
95.Pp
96.Fn SSL_get_verify_depth
97returns the verification depth limit currently set in
98.Fa ssl .
99If no limit has been explicitly set,
100\(mi1 is returned and the default value will be used.
101.Pp
102.Fn SSL_CTX_get_verify_callback
103returns a function pointer to the verification callback currently set in
104.Fa ctx .
105If no callback was explicitly set, the
106.Dv NULL
107pointer is returned and the default callback will be used.
108.Pp
109.Fn SSL_get_verify_callback
110returns a function pointer to the verification callback currently set in
111.Fa ssl .
112If no callback was explicitly set, the
113.Dv NULL
114pointer is returned and the default callback will be used.
115.Sh SEE ALSO
116.Xr ssl 3 ,
117.Xr SSL_CTX_set_verify 3
118.Sh HISTORY
119.Fn SSL_CTX_get_verify_mode ,
120.Fn SSL_get_verify_mode ,
121.Fn SSL_get_verify_callback ,
122and
123.Fn SSL_CTX_get_verify_callback
124first appeared in SSLeay 0.8.0 and have been available since
125.Ox 2.4 .
126.Pp
127.Fn SSL_CTX_get_verify_depth
128and
129.Fn SSL_get_verify_depth
130first appeared in OpenSSL 0.9.3 and have been available since
131.Ox 2.6 .
diff --git a/src/lib/libssl/man/SSL_CTX_load_verify_locations.3 b/src/lib/libssl/man/SSL_CTX_load_verify_locations.3
deleted file mode 100644
index 373df2402e..0000000000
--- a/src/lib/libssl/man/SSL_CTX_load_verify_locations.3
+++ /dev/null
@@ -1,238 +0,0 @@
1.\" $OpenBSD: SSL_CTX_load_verify_locations.3,v 1.4 2018/03/27 17:35:50 schwarze Exp $
2.\" OpenSSL 9b86974e Aug 17 15:21:33 2015 -0400
3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
5.\" Copyright (c) 2000, 2001, 2015, 2016 The OpenSSL Project.
6.\" All rights reserved.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\"
12.\" 1. Redistributions of source code must retain the above copyright
13.\" notice, this list of conditions and the following disclaimer.
14.\"
15.\" 2. Redistributions in binary form must reproduce the above copyright
16.\" notice, this list of conditions and the following disclaimer in
17.\" the documentation and/or other materials provided with the
18.\" distribution.
19.\"
20.\" 3. All advertising materials mentioning features or use of this
21.\" software must display the following acknowledgment:
22.\" "This product includes software developed by the OpenSSL Project
23.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
24.\"
25.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
26.\" endorse or promote products derived from this software without
27.\" prior written permission. For written permission, please contact
28.\" openssl-core@openssl.org.
29.\"
30.\" 5. Products derived from this software may not be called "OpenSSL"
31.\" nor may "OpenSSL" appear in their names without prior written
32.\" permission of the OpenSSL Project.
33.\"
34.\" 6. Redistributions of any form whatsoever must retain the following
35.\" acknowledgment:
36.\" "This product includes software developed by the OpenSSL Project
37.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
38.\"
39.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
40.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
43.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50.\" OF THE POSSIBILITY OF SUCH DAMAGE.
51.\"
52.Dd $Mdocdate: March 27 2018 $
53.Dt SSL_CTX_LOAD_VERIFY_LOCATIONS 3
54.Os
55.Sh NAME
56.Nm SSL_CTX_load_verify_locations ,
57.Nm SSL_CTX_set_default_verify_paths
58.Nd set default locations for trusted CA certificates
59.Sh SYNOPSIS
60.In openssl/ssl.h
61.Ft int
62.Fo SSL_CTX_load_verify_locations
63.Fa "SSL_CTX *ctx" "const char *CAfile" "const char *CApath"
64.Fc
65.Ft int
66.Fo SSL_CTX_set_default_verify_paths
67.Fa "SSL_CTX *ctx"
68.Fc
69.Sh DESCRIPTION
70.Fn SSL_CTX_load_verify_locations
71specifies the locations for
72.Fa ctx ,
73at which CA certificates for verification purposes are located.
74The certificates available via
75.Fa CAfile
76and
77.Fa CApath
78are trusted.
79.Pp
80.Fn SSL_CTX_set_default_verify_paths
81specifies that the default locations from which CA certificates are
82loaded should be used.
83There is one default directory and one default file.
84The default CA certificates directory is called
85.Pa certs
86in the default OpenSSL directory.
87The default CA certificates file is called
88.Pa cert.pem
89in the default OpenSSL directory.
90.Pp
91If
92.Fa CAfile
93is not
94.Dv NULL ,
95it points to a file of CA certificates in PEM format.
96The file can contain several CA certificates identified by sequences of:
97.Bd -literal
98 -----BEGIN CERTIFICATE-----
99 ... (CA certificate in base64 encoding) ...
100 -----END CERTIFICATE-----
101.Ed
102.Pp
103Before, between, and after the certificates arbitrary text is allowed which can
104be used, e.g., for descriptions of the certificates.
105.Pp
106The
107.Fa CAfile
108is processed on execution of the
109.Fn SSL_CTX_load_verify_locations
110function.
111.Pp
112If
113.Fa CApath
114is not NULL, it points to a directory containing CA certificates in PEM format.
115The files each contain one CA certificate.
116The files are looked up by the CA subject name hash value,
117which must hence be available.
118If more than one CA certificate with the same name hash value exist,
119the extension must be different (e.g.,
120.Pa 9d66eef0.0 ,
121.Pa 9d66eef0.1 ,
122etc.).
123The search is performed in the ordering of the extension number,
124regardless of other properties of the certificates.
125.Pp
126The certificates in
127.Fa CApath
128are only looked up when required, e.g., when building the certificate chain or
129when actually performing the verification of a peer certificate.
130.Pp
131When looking up CA certificates, the OpenSSL library will first search the
132certificates in
133.Fa CAfile ,
134then those in
135.Fa CApath .
136Certificate matching is done based on the subject name, the key identifier (if
137present), and the serial number as taken from the certificate to be verified.
138If these data do not match, the next certificate will be tried.
139If a first certificate matching the parameters is found,
140the verification process will be performed;
141no other certificates for the same parameters will be searched in case of
142failure.
143.Pp
144In server mode, when requesting a client certificate, the server must send
145the list of CAs of which it will accept client certificates.
146This list is not influenced by the contents of
147.Fa CAfile
148or
149.Fa CApath
150and must explicitly be set using the
151.Xr SSL_CTX_set_client_CA_list 3
152family of functions.
153.Pp
154When building its own certificate chain, an OpenSSL client/server will try to
155fill in missing certificates from
156.Fa CAfile Ns / Fa CApath ,
157if the
158certificate chain was not explicitly specified (see
159.Xr SSL_CTX_add_extra_chain_cert 3
160and
161.Xr SSL_CTX_use_certificate 3 ) .
162.Sh RETURN VALUES
163For
164.Fn SSL_CTX_load_verify_locations ,
165the following return values can occur:
166.Bl -tag -width Ds
167.It 0
168The operation failed because
169.Fa CAfile
170and
171.Fa CApath
172are
173.Dv NULL
174or the processing at one of the locations specified failed.
175Check the error stack to find out the reason.
176.It 1
177The operation succeeded.
178.El
179.Pp
180.Fn SSL_CTX_set_default_verify_paths
181returns 1 on success or 0 on failure.
182A missing default location is still treated as a success.
183.Sh EXAMPLES
184Generate a CA certificate file with descriptive text from the CA certificates
185.Pa ca1.pem
186.Pa ca2.pem
187.Pa ca3.pem :
188.Bd -literal
189#!/bin/sh
190rm CAfile.pem
191for i in ca1.pem ca2.pem ca3.pem; do
192 openssl x509 -in $i -text >> CAfile.pem
193done
194.Ed
195.Pp
196Prepare the directory /some/where/certs containing several CA certificates
197for use as
198.Fa CApath :
199.Bd -literal
200$ cd /some/where/certs
201$ rm -f *.[0-9]* *.r[0-9]*
202$ for c in *.pem; do
203> [ "$c" = "*.pem" ] && continue
204> hash=$(openssl x509 -noout -hash -in "$c")
205> if egrep -q -- '-BEGIN( X509 | TRUSTED | )CERTIFICATE-' "$c"; then
206> suf=0
207> while [ -e $hash.$suf ]; do suf=$(( $suf + 1 )); done
208> ln -s "$c" $hash.$suf
209> fi
210> if egrep -q -- '-BEGIN X509 CRL-' "$c"; then
211> suf=0
212> while [ -e $hash.r$suf ]; do suf=$(( $suf + 1 )); done
213> ln -s "$c" $hash.r$suf
214> fi
215> done
216.Ed
217.Sh SEE ALSO
218.Xr ssl 3 ,
219.Xr SSL_CTX_add_extra_chain_cert 3 ,
220.Xr SSL_CTX_set_cert_store 3 ,
221.Xr SSL_CTX_set_client_CA_list 3 ,
222.Xr SSL_CTX_use_certificate 3 ,
223.Xr SSL_get_client_CA_list 3
224.Sh HISTORY
225.Fn SSL_CTX_load_verify_locations
226and
227.Fn SSL_CTX_set_default_verify_paths
228first appeared in SSLeay 0.8.0 and have been available since
229.Ox 2.4 .
230.Sh CAVEATS
231If several CA certificates matching the name, key identifier, and serial
232number condition are available, only the first one will be examined.
233This may lead to unexpected results if the same CA certificate is available
234with different expiration dates.
235If a
236.Dq certificate expired
237verification error occurs, no other certificate will be searched.
238Make sure to not have expired certificates mixed with valid ones.
diff --git a/src/lib/libssl/man/SSL_CTX_new.3 b/src/lib/libssl/man/SSL_CTX_new.3
deleted file mode 100644
index 4b50a03de4..0000000000
--- a/src/lib/libssl/man/SSL_CTX_new.3
+++ /dev/null
@@ -1,345 +0,0 @@
1.\" $OpenBSD: SSL_CTX_new.3,v 1.17 2022/07/13 22:05:53 schwarze Exp $
2.\" full merge up to: OpenSSL 21cd6e00 Oct 21 14:40:15 2015 +0100
3.\" selective merge up to: OpenSSL 8f75443f May 24 14:04:26 2019 +0200
4.\"
5.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
6.\" Copyright (c) 2000, 2005, 2012, 2013, 2015, 2016 The OpenSSL Project.
7.\" All rights reserved.
8.\"
9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions
11.\" are met:
12.\"
13.\" 1. Redistributions of source code must retain the above copyright
14.\" notice, this list of conditions and the following disclaimer.
15.\"
16.\" 2. Redistributions in binary form must reproduce the above copyright
17.\" notice, this list of conditions and the following disclaimer in
18.\" the documentation and/or other materials provided with the
19.\" distribution.
20.\"
21.\" 3. All advertising materials mentioning features or use of this
22.\" software must display the following acknowledgment:
23.\" "This product includes software developed by the OpenSSL Project
24.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
25.\"
26.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
27.\" endorse or promote products derived from this software without
28.\" prior written permission. For written permission, please contact
29.\" openssl-core@openssl.org.
30.\"
31.\" 5. Products derived from this software may not be called "OpenSSL"
32.\" nor may "OpenSSL" appear in their names without prior written
33.\" permission of the OpenSSL Project.
34.\"
35.\" 6. Redistributions of any form whatsoever must retain the following
36.\" acknowledgment:
37.\" "This product includes software developed by the OpenSSL Project
38.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
39.\"
40.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
41.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
42.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
43.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
44.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
45.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
46.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
47.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
49.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
50.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
51.\" OF THE POSSIBILITY OF SUCH DAMAGE.
52.\"
53.Dd $Mdocdate: July 13 2022 $
54.Dt SSL_CTX_NEW 3
55.Os
56.Sh NAME
57.Nm SSL_CTX_new ,
58.Nm SSL_CTX_up_ref ,
59.Nm TLS_method ,
60.Nm TLS_server_method ,
61.Nm TLS_client_method ,
62.Nm SSLv23_method ,
63.Nm SSLv23_server_method ,
64.Nm SSLv23_client_method ,
65.Nm TLSv1_method ,
66.Nm TLSv1_server_method ,
67.Nm TLSv1_client_method ,
68.Nm TLSv1_1_method ,
69.Nm TLSv1_1_server_method ,
70.Nm TLSv1_1_client_method ,
71.Nm TLSv1_2_method ,
72.Nm TLSv1_2_server_method ,
73.Nm TLSv1_2_client_method ,
74.Nm DTLS_method ,
75.Nm DTLS_server_method ,
76.Nm DTLS_client_method ,
77.Nm DTLSv1_method ,
78.Nm DTLSv1_server_method ,
79.Nm DTLSv1_client_method ,
80.Nm DTLSv1_2_method ,
81.Nm DTLSv1_2_server_method ,
82.Nm DTLSv1_2_client_method
83.Nd create a new SSL_CTX object as a framework for TLS enabled functions
84.Sh SYNOPSIS
85.In openssl/ssl.h
86.Ft SSL_CTX *
87.Fn SSL_CTX_new "const SSL_METHOD *method"
88.Ft int
89.Fn SSL_CTX_up_ref "SSL_CTX *ctx"
90.Ft const SSL_METHOD *
91.Fn TLS_method void
92.Ft const SSL_METHOD *
93.Fn TLS_server_method void
94.Ft const SSL_METHOD *
95.Fn TLS_client_method void
96.Ft const SSL_METHOD *
97.Fn SSLv23_method void
98.Ft const SSL_METHOD *
99.Fn SSLv23_server_method void
100.Ft const SSL_METHOD *
101.Fn SSLv23_client_method void
102.Ft const SSL_METHOD *
103.Fn TLSv1_method void
104.Ft const SSL_METHOD *
105.Fn TLSv1_server_method void
106.Ft const SSL_METHOD *
107.Fn TLSv1_client_method void
108.Ft const SSL_METHOD *
109.Fn TLSv1_1_method void
110.Ft const SSL_METHOD *
111.Fn TLSv1_1_server_method void
112.Ft const SSL_METHOD *
113.Fn TLSv1_1_client_method void
114.Ft const SSL_METHOD *
115.Fn TLSv1_2_method void
116.Ft const SSL_METHOD *
117.Fn TLSv1_2_server_method void
118.Ft const SSL_METHOD *
119.Fn TLSv1_2_client_method void
120.Ft const SSL_METHOD *
121.Fn DTLS_method void
122.Ft const SSL_METHOD *
123.Fn DTLS_server_method void
124.Ft const SSL_METHOD *
125.Fn DTLS_client_method void
126.Ft const SSL_METHOD *
127.Fn DTLSv1_method void
128.Ft const SSL_METHOD *
129.Fn DTLSv1_server_method void
130.Ft const SSL_METHOD *
131.Fn DTLSv1_client_method void
132.Ft const SSL_METHOD *
133.Fn DTLSv1_2_method void
134.Ft const SSL_METHOD *
135.Fn DTLSv1_2_server_method void
136.Ft const SSL_METHOD *
137.Fn DTLSv1_2_client_method void
138.Sh DESCRIPTION
139.Fn SSL_CTX_new
140creates a new
141.Vt SSL_CTX
142object as a framework to establish TLS or DTLS enabled connections.
143It initializes the list of ciphers, the session cache setting, the
144callbacks, the keys and certificates, the options, and the security
145level to its default values.
146.Pp
147An
148.Vt SSL_CTX
149object is reference counted.
150Creating a new
151.Vt SSL_CTX
152object sets its reference count to 1.
153Calling
154.Fn SSL_CTX_up_ref
155on it increments the reference count by 1.
156Calling
157.Xr SSL_CTX_free 3
158on it decrements the reference count by 1.
159When the reference count drops to zero,
160any memory or resources allocated to the
161.Vt SSL_CTX
162object are freed.
163.Pp
164The
165.Vt SSL_CTX
166object uses
167.Fa method
168as its connection method, which can be:
169.Bl -tag -width Ds
170.It Fn TLS_method
171The general-purpose version-flexible TLS method.
172The protocol version used will be negotiated to the highest
173version mutually supported by the client and the server.
174The supported protocols are TLSv1, TLSv1.1, TLSv1.2, and TLSv1.3.
175.It Fn DTLS_method
176The version-flexible DTLS method.
177The currently supported protocols are DTLSv1 and DTLSv1.2.
178.El
179.Pp
180The following
181.Fa method
182arguments are deprecated:
183.Bl -tag -width Ds
184.It Xo
185.Fn TLS_server_method ,
186.Fn TLS_client_method ,
187.Fn SSLv23_method ,
188.Fn SSLv23_server_method ,
189.Fn SSLv23_client_method
190.Xc
191Deprecated aliases for
192.Fn TLS_method .
193.It Xo
194.Fn DTLS_server_method ,
195.Fn DTLS_client_method
196.Xc
197Deprecated aliases for
198.Fn DTLS_method .
199.It Xo
200.Fn TLSv1_method ,
201.Fn TLSv1_server_method ,
202.Fn TLSv1_client_method
203.Xc
204A connection established with these methods will only
205understand the TLSv1 protocol.
206.It Xo
207.Fn TLSv1_1_method ,
208.Fn TLSv1_1_server_method ,
209.Fn TLSv1_1_client_method
210.Xc
211A connection established with these methods will only
212understand the TLSv1.1 protocol.
213.It Xo
214.Fn TLSv1_2_method ,
215.Fn TLSv1_2_server_method ,
216.Fn TLSv1_2_client_method
217.Xc
218A connection established with these methods will only
219understand the TLSv1.2 protocol.
220.It Xo
221.Fn DTLSv1_method ,
222.Fn DTLSv1_server_method ,
223.Fn DTLSv1_client_method
224.Xc
225These are the version-specific methods for DTLSv1.
226.It Xo
227.Fn DTLSv1_2_method ,
228.Fn DTLSv1_2_server_method ,
229.Fn DTLSv1_2_client_method
230These are the version-specific methods for DTLSv1.2.
231.Xc
232.El
233.Pp
234In LibreSSL, the methods containing the substrings
235.Dq _server
236or
237.Dq _client
238in their names return the same objects
239as the methods without these substrings.
240.Pp
241The list of protocols available can also be limited using the
242.Dv SSL_OP_NO_TLSv1 ,
243.Dv SSL_OP_NO_TLSv1_1 ,
244and
245.Dv SSL_OP_NO_TLSv1_2
246options of the
247.Xr SSL_CTX_set_options 3
248or
249.Xr SSL_set_options 3
250functions, but this approach is not recommended.
251Clients should avoid creating "holes" in the set of protocols they support.
252When disabling a protocol, make sure that you also disable either
253all previous or all subsequent protocol versions.
254In clients, when a protocol version is disabled without disabling
255all previous protocol versions, the effect is to also disable all
256subsequent protocol versions.
257.Pp
258DTLSv1 and DTLSv1.2 can be disabled with
259.Xr SSL_CTX_set_options 3
260or
261.Xr SSL_set_options 3
262using the
263.Dv SSL_OP_NO_DTLSv1
264and
265.Dv SSL_OP_NO_DTLSv1_2
266options, respectively.
267.Sh RETURN VALUES
268.Fn SSL_CTX_new
269returns a pointer to the newly allocated object or
270.Dv NULL
271on failure.
272Check the error stack to find out the reason for failure.
273.Pp
274.Fn SSL_CTX_up_ref
275returns 1 for success or 0 for failure.
276.Pp
277.Fn TLS_method
278and the other
279.Fn *_method
280functions return pointers to constant static objects.
281.Sh SEE ALSO
282.Xr ssl 3 ,
283.Xr SSL_accept 3 ,
284.Xr SSL_CTX_free 3 ,
285.Xr SSL_CTX_set_min_proto_version 3 ,
286.Xr SSL_CTX_set_options 3 ,
287.Xr SSL_CTX_set_security_level 3 ,
288.Xr SSL_set_connect_state 3
289.Sh HISTORY
290.Fn SSL_CTX_new
291first appeared in SSLeay 0.5.1.
292.Fn SSLv23_method ,
293.Fn SSLv23_server_method ,
294and
295.Fn SSLv23_client_method
296first appeared in SSLeay 0.8.0.
297.Fn TLSv1_method ,
298.Fn TLSv1_server_method ,
299and
300.Fn TLSv1_client_method
301first appeared in SSLeay 0.9.0.
302All these functions have been available since
303.Ox 2.4 .
304.Pp
305.Fn DTLSv1_method ,
306.Fn DTLSv1_server_method ,
307and
308.Fn DTLSv1_client_method
309first appeared in OpenSSL 0.9.8 and have been available since
310.Ox 4.5 .
311.Pp
312.Fn TLSv1_1_method ,
313.Fn TLSv1_1_server_method ,
314.Fn TLSv1_1_client_method ,
315.Fn TLSv1_2_method ,
316.Fn TLSv1_2_server_method ,
317and
318.Fn TLSv1_2_client_method
319first appeared in OpenSSL 1.0.1 and have been available since
320.Ox 5.3 .
321.Pp
322.Fn DTLS_method ,
323.Fn DTLS_server_method ,
324and
325.Fn DTLS_client_method
326first appeared in OpenSSL 1.0.2 and have been available since
327.Ox 6.5 .
328.Pp
329.Fn TLS_method ,
330.Fn TLS_server_method ,
331and
332.Fn TLS_client_method
333first appeared in OpenSSL 1.1.0 and have been available since
334.Ox 5.8 .
335.Pp
336.Fn SSL_CTX_up_ref
337first appeared in OpenSSL 1.1.0 and has been available since
338.Ox 6.3 .
339.Pp
340.Fn DTLSv1_2_method ,
341.Fn DTLSv1_2_server_method ,
342and
343.Fn DTLSv1_2_client_method
344first appeared in OpenSSL 1.1.0 and have been available since
345.Ox 6.9 .
diff --git a/src/lib/libssl/man/SSL_CTX_sess_number.3 b/src/lib/libssl/man/SSL_CTX_sess_number.3
deleted file mode 100644
index 76d436cd17..0000000000
--- a/src/lib/libssl/man/SSL_CTX_sess_number.3
+++ /dev/null
@@ -1,168 +0,0 @@
1.\" $OpenBSD: SSL_CTX_sess_number.3,v 1.9 2019/06/12 09:36:30 schwarze Exp $
2.\" OpenSSL SSL_CTX_sess_number.pod 7bd27895 Mar 29 11:45:29 2017 +1000
3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
5.\" Copyright (c) 2001 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: June 12 2019 $
52.Dt SSL_CTX_SESS_NUMBER 3
53.Os
54.Sh NAME
55.Nm SSL_CTX_sess_number ,
56.Nm SSL_CTX_sess_connect ,
57.Nm SSL_CTX_sess_connect_good ,
58.Nm SSL_CTX_sess_connect_renegotiate ,
59.Nm SSL_CTX_sess_accept ,
60.Nm SSL_CTX_sess_accept_good ,
61.Nm SSL_CTX_sess_accept_renegotiate ,
62.Nm SSL_CTX_sess_hits ,
63.Nm SSL_CTX_sess_cb_hits ,
64.Nm SSL_CTX_sess_misses ,
65.Nm SSL_CTX_sess_timeouts ,
66.Nm SSL_CTX_sess_cache_full
67.Nd obtain session cache statistics
68.Sh SYNOPSIS
69.In openssl/ssl.h
70.Ft long
71.Fn SSL_CTX_sess_number "SSL_CTX *ctx"
72.Ft long
73.Fn SSL_CTX_sess_connect "SSL_CTX *ctx"
74.Ft long
75.Fn SSL_CTX_sess_connect_good "SSL_CTX *ctx"
76.Ft long
77.Fn SSL_CTX_sess_connect_renegotiate "SSL_CTX *ctx"
78.Ft long
79.Fn SSL_CTX_sess_accept "SSL_CTX *ctx"
80.Ft long
81.Fn SSL_CTX_sess_accept_good "SSL_CTX *ctx"
82.Ft long
83.Fn SSL_CTX_sess_accept_renegotiate "SSL_CTX *ctx"
84.Ft long
85.Fn SSL_CTX_sess_hits "SSL_CTX *ctx"
86.Ft long
87.Fn SSL_CTX_sess_cb_hits "SSL_CTX *ctx"
88.Ft long
89.Fn SSL_CTX_sess_misses "SSL_CTX *ctx"
90.Ft long
91.Fn SSL_CTX_sess_timeouts "SSL_CTX *ctx"
92.Ft long
93.Fn SSL_CTX_sess_cache_full "SSL_CTX *ctx"
94.Sh DESCRIPTION
95.Fn SSL_CTX_sess_number
96returns the current number of sessions in the internal session cache.
97.Pp
98.Fn SSL_CTX_sess_connect
99returns the number of started SSL/TLS handshakes in client mode.
100.Pp
101.Fn SSL_CTX_sess_connect_good
102returns the number of successfully established SSL/TLS sessions in client mode.
103.Pp
104.Fn SSL_CTX_sess_connect_renegotiate
105returns the number of started renegotiations in client mode.
106.Pp
107.Fn SSL_CTX_sess_accept
108returns the number of started SSL/TLS handshakes in server mode.
109.Pp
110.Fn SSL_CTX_sess_accept_good
111returns the number of successfully established SSL/TLS sessions in server mode.
112.Pp
113.Fn SSL_CTX_sess_accept_renegotiate
114returns the number of started renegotiations in server mode.
115.Pp
116.Fn SSL_CTX_sess_hits
117returns the number of successfully reused sessions.
118In client mode a session set with
119.Xr SSL_set_session 3
120successfully reused is counted as a hit.
121In server mode a session successfully retrieved from internal or external cache
122is counted as a hit.
123.Pp
124.Fn SSL_CTX_sess_cb_hits
125returns the number of successfully retrieved sessions from the external session
126cache in server mode.
127.Pp
128.Fn SSL_CTX_sess_misses
129returns the number of sessions proposed by clients that were not found in the
130internal session cache in server mode.
131.Pp
132.Fn SSL_CTX_sess_timeouts
133returns the number of sessions proposed by clients and either found in the
134internal or external session cache in server mode,
135but that were invalid due to timeout.
136These sessions are not included in the
137.Fn SSL_CTX_sess_hits
138count.
139.Pp
140.Fn SSL_CTX_sess_cache_full
141returns the number of sessions that were removed because the maximum session
142cache size was exceeded.
143.Sh SEE ALSO
144.Xr ssl 3 ,
145.Xr SSL_CTX_ctrl 3 ,
146.Xr SSL_CTX_sess_set_cache_size 3 ,
147.Xr SSL_CTX_set_session_cache_mode 3 ,
148.Xr SSL_set_session 3
149.Sh HISTORY
150.Fn SSL_CTX_sess_number ,
151.Fn SSL_CTX_sess_connect ,
152.Fn SSL_CTX_sess_connect_good ,
153.Fn SSL_CTX_sess_accept ,
154.Fn SSL_CTX_sess_accept_good ,
155.Fn SSL_CTX_sess_hits ,
156.Fn SSL_CTX_sess_misses ,
157and
158.Fn SSL_CTX_sess_timeouts
159first appeared in SSLeay 0.5.2.
160.Fn SSL_CTX_sess_cb_hits
161first appeared in SSLeay 0.6.0.
162.Fn SSL_CTX_sess_connect_renegotiate ,
163.Fn SSL_CTX_sess_accept_renegotiate ,
164and
165.Fn SSL_CTX_sess_cache_full
166first appeared in SSLeay 0.9.0.
167All these functions have been available since
168.Ox 2.4 .
diff --git a/src/lib/libssl/man/SSL_CTX_sess_set_cache_size.3 b/src/lib/libssl/man/SSL_CTX_sess_set_cache_size.3
deleted file mode 100644
index 6d5fede0b6..0000000000
--- a/src/lib/libssl/man/SSL_CTX_sess_set_cache_size.3
+++ /dev/null
@@ -1,109 +0,0 @@
1.\" $OpenBSD: SSL_CTX_sess_set_cache_size.3,v 1.5 2019/06/12 09:36:30 schwarze Exp $
2.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
5.\" Copyright (c) 2001, 2002, 2014 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: June 12 2019 $
52.Dt SSL_CTX_SESS_SET_CACHE_SIZE 3
53.Os
54.Sh NAME
55.Nm SSL_CTX_sess_set_cache_size ,
56.Nm SSL_CTX_sess_get_cache_size
57.Nd manipulate session cache size
58.Sh SYNOPSIS
59.In openssl/ssl.h
60.Ft long
61.Fn SSL_CTX_sess_set_cache_size "SSL_CTX *ctx" "long t"
62.Ft long
63.Fn SSL_CTX_sess_get_cache_size "SSL_CTX *ctx"
64.Sh DESCRIPTION
65.Fn SSL_CTX_sess_set_cache_size
66sets the size of the internal session cache of context
67.Fa ctx
68to
69.Fa t .
70.Pp
71.Fn SSL_CTX_sess_get_cache_size
72returns the currently valid session cache size.
73.Pp
74The internal session cache size is
75.Dv SSL_SESSION_CACHE_MAX_SIZE_DEFAULT ,
76currently 1024\(mu20, so that up to 20000 sessions can be held.
77This size can be modified using the
78.Fn SSL_CTX_sess_set_cache_size
79call.
80A special case is the size 0, which is used for unlimited size.
81.Pp
82If adding the session makes the cache exceed its size, then unused
83sessions are dropped from the end of the cache.
84Cache space may also be reclaimed by calling
85.Xr SSL_CTX_flush_sessions 3
86to remove expired sessions.
87.Pp
88If the size of the session cache is reduced and more sessions are already in
89the session cache,
90old session will be removed the next time a session shall be added.
91This removal is not synchronized with the expiration of sessions.
92.Sh RETURN VALUES
93.Fn SSL_CTX_sess_set_cache_size
94returns the previously valid size.
95.Pp
96.Fn SSL_CTX_sess_get_cache_size
97returns the currently valid size.
98.Sh SEE ALSO
99.Xr ssl 3 ,
100.Xr SSL_CTX_ctrl 3 ,
101.Xr SSL_CTX_flush_sessions 3 ,
102.Xr SSL_CTX_sess_number 3 ,
103.Xr SSL_CTX_set_session_cache_mode 3
104.Sh HISTORY
105.Fn SSL_CTX_sess_set_cache_size
106and
107.Fn SSL_CTX_sess_get_cache_size
108first appeared in SSLeay 0.9.0 and have been available since
109.Ox 2.4 .
diff --git a/src/lib/libssl/man/SSL_CTX_sess_set_get_cb.3 b/src/lib/libssl/man/SSL_CTX_sess_set_get_cb.3
deleted file mode 100644
index e99f2be671..0000000000
--- a/src/lib/libssl/man/SSL_CTX_sess_set_get_cb.3
+++ /dev/null
@@ -1,221 +0,0 @@
1.\" $OpenBSD: SSL_CTX_sess_set_get_cb.3,v 1.7 2022/03/29 18:15:52 naddy Exp $
2.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
5.\" Copyright (c) 2001, 2002, 2003, 2016 The OpenSSL Project.
6.\" All rights reserved.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\"
12.\" 1. Redistributions of source code must retain the above copyright
13.\" notice, this list of conditions and the following disclaimer.
14.\"
15.\" 2. Redistributions in binary form must reproduce the above copyright
16.\" notice, this list of conditions and the following disclaimer in
17.\" the documentation and/or other materials provided with the
18.\" distribution.
19.\"
20.\" 3. All advertising materials mentioning features or use of this
21.\" software must display the following acknowledgment:
22.\" "This product includes software developed by the OpenSSL Project
23.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
24.\"
25.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
26.\" endorse or promote products derived from this software without
27.\" prior written permission. For written permission, please contact
28.\" openssl-core@openssl.org.
29.\"
30.\" 5. Products derived from this software may not be called "OpenSSL"
31.\" nor may "OpenSSL" appear in their names without prior written
32.\" permission of the OpenSSL Project.
33.\"
34.\" 6. Redistributions of any form whatsoever must retain the following
35.\" acknowledgment:
36.\" "This product includes software developed by the OpenSSL Project
37.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
38.\"
39.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
40.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
43.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50.\" OF THE POSSIBILITY OF SUCH DAMAGE.
51.\"
52.Dd $Mdocdate: March 29 2022 $
53.Dt SSL_CTX_SESS_SET_GET_CB 3
54.Os
55.Sh NAME
56.Nm SSL_CTX_sess_set_new_cb ,
57.Nm SSL_CTX_sess_set_remove_cb ,
58.Nm SSL_CTX_sess_set_get_cb ,
59.Nm SSL_CTX_sess_get_new_cb ,
60.Nm SSL_CTX_sess_get_remove_cb ,
61.Nm SSL_CTX_sess_get_get_cb
62.Nd provide callback functions for server side external session caching
63.Sh SYNOPSIS
64.In openssl/ssl.h
65.Ft void
66.Fo SSL_CTX_sess_set_new_cb
67.Fa "SSL_CTX *ctx"
68.Fa "int (*new_session_cb)(SSL *, SSL_SESSION *)"
69.Fc
70.Ft void
71.Fo SSL_CTX_sess_set_remove_cb
72.Fa "SSL_CTX *ctx"
73.Fa "void (*remove_session_cb)(SSL_CTX *ctx, SSL_SESSION *)"
74.Fc
75.Ft void
76.Fo SSL_CTX_sess_set_get_cb
77.Fa "SSL_CTX *ctx"
78.Fa "SSL_SESSION (*get_session_cb)(SSL *, const unsigned char *, int, int *)"
79.Fc
80.Ft int
81.Fo "(*SSL_CTX_sess_get_new_cb(SSL_CTX *ctx))"
82.Fa "SSL *ssl"
83.Fa "SSL_SESSION *sess"
84.Fc
85.Ft void
86.Fo "(*SSL_CTX_sess_get_remove_cb(SSL_CTX *ctx))"
87.Fa "SSL_CTX *ctx"
88.Fa "SSL_SESSION *sess"
89.Fc
90.Ft SSL_SESSION *
91.Fo "(*SSL_CTX_sess_get_get_cb(SSL_CTX *ctx))"
92.Fa "SSL *ssl"
93.Fa "const unsigned char *data"
94.Fa "int len"
95.Fa "int *copy"
96.Fc
97.Ft int
98.Fo "(*new_session_cb)"
99.Fa "SSL *ssl"
100.Fa "SSL_SESSION *sess"
101.Fc
102.Ft void
103.Fo "(*remove_session_cb)"
104.Fa "SSL_CTX *ctx"
105.Fa "SSL_SESSION *sess"
106.Fc
107.Ft SSL_SESSION *
108.Fo "(*get_session_cb)"
109.Fa "SSL *ssl"
110.Fa "unsigned char *data"
111.Fa "int len"
112.Fa "int *copy"
113.Fc
114.Sh DESCRIPTION
115.Fn SSL_CTX_sess_set_new_cb
116sets the callback function which is automatically called whenever a new session
117was negotiated.
118.Pp
119.Fn SSL_CTX_sess_set_remove_cb
120sets the callback function which is automatically called whenever a session is
121removed by the SSL engine (because it is considered faulty or the session has
122become obsolete because of exceeding the timeout value).
123.Pp
124.Fn SSL_CTX_sess_set_get_cb
125sets the callback function which is called whenever a SSL/TLS client proposes
126to resume a session but the session cannot be found in the internal session
127cache (see
128.Xr SSL_CTX_set_session_cache_mode 3 ) .
129(SSL/TLS server only.)
130.Pp
131.Fn SSL_CTX_sess_get_new_cb ,
132.Fn SSL_CTX_sess_get_remove_cb ,
133and
134.Fn SSL_CTX_sess_get_get_cb
135retrieve the function pointers of the provided callback functions.
136If a callback function has not been set, the
137.Dv NULL
138pointer is returned.
139.Pp
140In order to allow external session caching, synchronization with the internal
141session cache is realized via callback functions.
142Inside these callback functions, session can be saved to disk or put into a
143database using the
144.Xr d2i_SSL_SESSION 3
145interface.
146.Pp
147The
148.Fn new_session_cb
149function is called whenever a new session has been negotiated and session
150caching is enabled (see
151.Xr SSL_CTX_set_session_cache_mode 3 ) .
152The
153.Fn new_session_cb
154function is passed the
155.Fa ssl
156connection and the ssl session
157.Fa sess .
158If the callback returns 0, the session will be immediately removed again.
159.Pp
160The
161.Fn remove_session_cb
162function is called whenever the SSL engine removes a session from the
163internal cache.
164This happens when the session is removed because it is expired or when a
165connection was not shut down cleanly.
166It also happens for all sessions in the internal session cache when
167.Xr SSL_CTX_free 3
168is called.
169The
170.Fn remove_session_cb
171function is passed the
172.Fa ctx
173and the
174.Vt ssl
175session
176.Fa sess .
177It does not provide any feedback.
178.Pp
179The
180.Fn get_session_cb
181function is only called on SSL/TLS servers with the session id proposed by the
182client.
183The
184.Fn get_session_cb
185function is always called, also when session caching was disabled.
186The
187.Fn get_session_cb
188function is passed the
189.Fa ssl
190connection, the session id of length
191.Fa length
192at the memory location
193.Fa data .
194With the parameter
195.Fa copy
196the callback can require the SSL engine to increment the reference count of the
197.Vt SSL_SESSION
198object,
199Normally the reference count is not incremented and therefore the session must
200not be explicitly freed with
201.Xr SSL_SESSION_free 3 .
202.Sh SEE ALSO
203.Xr d2i_SSL_SESSION 3 ,
204.Xr ssl 3 ,
205.Xr SSL_CTX_flush_sessions 3 ,
206.Xr SSL_CTX_free 3 ,
207.Xr SSL_CTX_set_session_cache_mode 3 ,
208.Xr SSL_SESSION_free 3
209.Sh HISTORY
210.Fn SSL_CTX_sess_set_new_cb ,
211.Fn SSL_CTX_sess_set_get_cb ,
212.Fn SSL_CTX_sess_get_new_cb ,
213and
214.Fn SSL_CTX_sess_get_get_cb
215first appeared in SSLeay 0.6.0.
216.Fn SSL_CTX_sess_set_remove_cb
217and
218.Fn SSL_CTX_sess_get_remove_cb
219first appeared in SSLeay 0.8.0.
220These functions have been available since
221.Ox 2.4 .
diff --git a/src/lib/libssl/man/SSL_CTX_sessions.3 b/src/lib/libssl/man/SSL_CTX_sessions.3
deleted file mode 100644
index 964d1a7346..0000000000
--- a/src/lib/libssl/man/SSL_CTX_sessions.3
+++ /dev/null
@@ -1,86 +0,0 @@
1.\" $OpenBSD: SSL_CTX_sessions.3,v 1.5 2018/04/25 14:19:39 schwarze Exp $
2.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
5.\" Copyright (c) 2001 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: April 25 2018 $
52.Dt SSL_CTX_SESSIONS 3
53.Os
54.Sh NAME
55.Nm SSL_CTX_sessions
56.Nd access internal session cache
57.Sh SYNOPSIS
58.In openssl/ssl.h
59.Ft LHASH_OF(SSL_SESSION) *
60.Fn SSL_CTX_sessions "SSL_CTX *ctx"
61.Sh DESCRIPTION
62.Fn SSL_CTX_sessions
63returns a pointer to the lhash databases containing the internal session cache
64for
65.Fa ctx .
66.Pp
67The sessions in the internal session cache are kept in an
68lhash-type database
69(see
70.Xr lh_new 3 ) .
71It is possible to directly access this database, e.g., for searching.
72In parallel,
73the sessions form a linked list which is maintained separately from the
74lhash operations,
75so that the database must not be modified directly but by using the
76.Xr SSL_CTX_add_session 3
77family of functions.
78.Sh SEE ALSO
79.Xr lh_new 3 ,
80.Xr ssl 3 ,
81.Xr SSL_CTX_add_session 3 ,
82.Xr SSL_CTX_set_session_cache_mode 3
83.Sh HISTORY
84.Fn SSL_CTX_sessions
85first appeared in SSLeay 0.5.2 and has been available since
86.Ox 2.4 .
diff --git a/src/lib/libssl/man/SSL_CTX_set1_groups.3 b/src/lib/libssl/man/SSL_CTX_set1_groups.3
deleted file mode 100644
index 0d1eb36ea7..0000000000
--- a/src/lib/libssl/man/SSL_CTX_set1_groups.3
+++ /dev/null
@@ -1,163 +0,0 @@
1.\" $OpenBSD: SSL_CTX_set1_groups.3,v 1.2 2017/08/19 19:36:39 schwarze Exp $
2.\" OpenSSL SSL_CTX_set1_curves.pod de4d764e Nov 9 14:51:06 2016 +0000
3.\"
4.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
5.\" Copyright (c) 2013, 2014, 2016 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: August 19 2017 $
52.Dt SSL_CTX_SET1_GROUPS 3
53.Os
54.Sh NAME
55.Nm SSL_CTX_set1_groups ,
56.Nm SSL_CTX_set1_groups_list ,
57.Nm SSL_set1_groups ,
58.Nm SSL_set1_groups_list ,
59.Nm SSL_CTX_set1_curves ,
60.Nm SSL_CTX_set1_curves_list ,
61.Nm SSL_set1_curves ,
62.Nm SSL_set1_curves_list
63.Nd choose supported EC groups
64.Sh SYNOPSIS
65.In openssl/ssl.h
66.Ft int
67.Fo SSL_CTX_set1_groups
68.Fa "SSL_CTX *ctx"
69.Fa "const int *glist"
70.Fa "size_t glistlen"
71.Fc
72.Ft int
73.Fo SSL_CTX_set1_groups_list
74.Fa "SSL_CTX *ctx"
75.Fa "const char *list"
76.Fc
77.Ft int
78.Fo SSL_set1_groups
79.Fa "SSL *ssl"
80.Fa "const int *glist"
81.Fa "size_t glistlen"
82.Fc
83.Ft int
84.Fo SSL_set1_groups_list
85.Fa "SSL *ssl"
86.Fa "const char *list"
87.Fc
88.Ft int
89.Fo SSL_CTX_set1_curves
90.Fa "SSL_CTX *ctx"
91.Fa "const int *clist"
92.Fa "size_t clistlen"
93.Fc
94.Ft int
95.Fo SSL_CTX_set1_curves_list
96.Fa "SSL_CTX *ctx"
97.Fa "const char *list"
98.Fc
99.Ft int
100.Fo SSL_set1_curves
101.Fa "SSL *ssl"
102.Fa "const int *clist"
103.Fa "size_t clistlen"
104.Fc
105.Ft int
106.Fo SSL_set1_curves_list
107.Fa "SSL *ssl"
108.Fa "const char *list"
109.Fc
110.Sh DESCRIPTION
111.Fn SSL_CTX_set1_groups
112sets the supported groups for
113.Fa ctx
114to the
115.Fa glistlen
116groups in the array
117.Fa glist .
118The array consists of group NIDs in preference order.
119For a TLS client, the groups are used directly in the supported groups
120extension.
121For a TLS server, the groups are used to determine the set of shared
122groups.
123.Pp
124.Fn SSL_CTX_set1_groups_list
125sets the supported groups for
126.Fa ctx
127to the
128.Fa list
129represented as a colon separated list of group NIDs or names, for example
130"P-521:P-384:P-256".
131.Pp
132.Fn SSL_set1_groups
133and
134.Fn SSL_set1_groups_list
135are similar except that they set supported groups for the SSL structure
136.Fa ssl
137only.
138.Pp
139The curve functions are deprecated synonyms for the equivalently
140named group functions and are identical in every respect except
141that they are implemented as macros.
142They exist because prior to TLS1.3, there was only the concept of
143supported curves.
144In TLS1.3, this was renamed to supported groups and extended to include
145Diffie Hellman groups.
146.Pp
147If an application wishes to make use of several of these functions for
148configuration purposes either on a command line or in a file, it should
149consider using the SSL_CONF interface instead of manually parsing
150options.
151.Sh RETURN VALUES
152All these functions return 1 for success or 0 for failure.
153.Sh SEE ALSO
154.Xr ssl 3 ,
155.Xr SSL_CTX_add_extra_chain_cert 3 ,
156.Xr SSL_CTX_set_cipher_list 3 ,
157.Xr SSL_CTX_set_options 3 ,
158.Xr SSL_new 3
159.Sh HISTORY
160The curve functions first appeared in OpenSSL 1.0.2
161and the group functions in OpenSSL 1.1.1.
162Both have been available since
163.Ox 6.1 .
diff --git a/src/lib/libssl/man/SSL_CTX_set_alpn_select_cb.3 b/src/lib/libssl/man/SSL_CTX_set_alpn_select_cb.3
deleted file mode 100644
index 2317c57af4..0000000000
--- a/src/lib/libssl/man/SSL_CTX_set_alpn_select_cb.3
+++ /dev/null
@@ -1,305 +0,0 @@
1.\" $OpenBSD: SSL_CTX_set_alpn_select_cb.3,v 1.11 2025/02/04 14:00:05 tb Exp $
2.\" OpenSSL 87b81496 Apr 19 12:38:27 2017 -0400
3.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
4.\"
5.\" This file was written by Todd Short <tshort@akamai.com>.
6.\" Copyright (c) 2016 The OpenSSL Project. All rights reserved.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\"
12.\" 1. Redistributions of source code must retain the above copyright
13.\" notice, this list of conditions and the following disclaimer.
14.\"
15.\" 2. Redistributions in binary form must reproduce the above copyright
16.\" notice, this list of conditions and the following disclaimer in
17.\" the documentation and/or other materials provided with the
18.\" distribution.
19.\"
20.\" 3. All advertising materials mentioning features or use of this
21.\" software must display the following acknowledgment:
22.\" "This product includes software developed by the OpenSSL Project
23.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
24.\"
25.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
26.\" endorse or promote products derived from this software without
27.\" prior written permission. For written permission, please contact
28.\" openssl-core@openssl.org.
29.\"
30.\" 5. Products derived from this software may not be called "OpenSSL"
31.\" nor may "OpenSSL" appear in their names without prior written
32.\" permission of the OpenSSL Project.
33.\"
34.\" 6. Redistributions of any form whatsoever must retain the following
35.\" acknowledgment:
36.\" "This product includes software developed by the OpenSSL Project
37.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
38.\"
39.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
40.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
43.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50.\" OF THE POSSIBILITY OF SUCH DAMAGE.
51.\"
52.Dd $Mdocdate: February 4 2025 $
53.Dt SSL_CTX_SET_ALPN_SELECT_CB 3
54.Os
55.Sh NAME
56.Nm SSL_CTX_set_alpn_protos ,
57.Nm SSL_set_alpn_protos ,
58.Nm SSL_CTX_set_alpn_select_cb ,
59.Nm SSL_select_next_proto ,
60.Nm SSL_get0_alpn_selected
61.Nd handle application layer protocol negotiation (ALPN)
62.Sh SYNOPSIS
63.In openssl/ssl.h
64.Ft int
65.Fo SSL_CTX_set_alpn_protos
66.Fa "SSL_CTX *ctx"
67.Fa "const unsigned char *protos"
68.Fa "unsigned int protos_len"
69.Fc
70.Ft int
71.Fo SSL_set_alpn_protos
72.Fa "SSL *ssl"
73.Fa "const unsigned char *protos"
74.Fa "unsigned int protos_len"
75.Fc
76.Ft void
77.Fo SSL_CTX_set_alpn_select_cb
78.Fa "SSL_CTX *ctx"
79.Fa "int (*cb)(SSL *ssl, const unsigned char **out,\
80 unsigned char *outlen, const unsigned char *in,\
81 unsigned int inlen, void *arg)"
82.Fa "void *arg"
83.Fc
84.Ft int
85.Fo SSL_select_next_proto
86.Fa "unsigned char **out"
87.Fa "unsigned char *outlen"
88.Fa "const unsigned char *peer_list"
89.Fa "unsigned int peer_list_len"
90.Fa "const unsigned char *supported_list"
91.Fa "unsigned int supported_list_len"
92.Fc
93.Ft void
94.Fo SSL_get0_alpn_selected
95.Fa "const SSL *ssl"
96.Fa "const unsigned char **data"
97.Fa "unsigned int *len"
98.Fc
99.Sh DESCRIPTION
100.Fn SSL_CTX_set_alpn_protos
101and
102.Fn SSL_set_alpn_protos
103are used by the client to set the list of protocols available to be
104negotiated.
105The
106.Fa protos
107must be in protocol-list format, described below.
108The length of
109.Fa protos
110is specified in
111.Fa protos_len .
112.Pp
113.Fn SSL_CTX_set_alpn_select_cb
114sets the application callback
115.Fa cb
116used by a server to select which protocol to use for the incoming
117connection.
118When
119.Fa cb
120is
121.Dv NULL ,
122ALPN is not used.
123The
124.Fa arg
125value is a pointer which is passed to the application callback.
126.Pp
127.Fa cb
128is the application defined callback.
129The
130.Fa in ,
131.Fa inlen
132parameters are a vector in protocol-list format.
133The value of the
134.Fa out ,
135.Fa outlen
136vector should be set to the value of a single protocol selected from the
137.Fa in ,
138.Fa inlen
139vector.
140The
141.Fa out
142buffer may point directly into
143.Fa in ,
144or to a buffer that outlives the handshake.
145The
146.Fa arg
147parameter is the pointer set via
148.Fn SSL_CTX_set_alpn_select_cb .
149.Pp
150.Fn SSL_select_next_proto
151is a helper function used to select protocols.
152It is expected that this function is called from the application
153callback
154.Fa cb .
155If
156.Fn SSL_select_next_proto
157returns
158.Dv OPENSSL_NPN_NO_OVERLAP ,
159.Fa cb
160should ignore
161.Fa out
162and fail by returning
163.Dv SSL_TLSEXT_ERR_ALERT_FATAL .
164The protocol data in
165.Fa peer_list ,
166.Fa peer_list_len
167and
168.Fa supported_list ,
169.Fa supported_list_len
170must be two non-empty lists, validly encoded
171in the protocol-list format described below.
172The first item in the
173.Fa peer_list
174that matches an item in the
175.Fa supported_list
176is selected, and returned in
177.Fa out ,
178.Fa outlen .
179The
180.Fa out
181value will point into either
182.Fa peer_list
183or
184.Fa supported_list ,
185so it must not be modified and
186should be copied immediately.
187If no match is found, the first item in
188.Fa supported_list
189is returned in
190.Fa out ,
191.Fa outlen .
192.Pp
193.Fn SSL_get0_alpn_selected
194returns a pointer to the selected protocol in
195.Fa data
196with length
197.Fa len .
198It is not NUL-terminated.
199.Fa data
200is set to
201.Dv NULL
202and
203.Fa len
204is set to 0 if no protocol has been selected.
205.Fa data
206must not be freed.
207.Pp
208The protocol-lists must be in wire-format, which is defined as a vector
209of non-empty, 8-bit length-prefixed byte strings.
210The length-prefix byte is not included in the length.
211Each string is limited to 255 bytes.
212A byte-string length of 0 is invalid.
213The length of the vector is not in the vector itself, but in a separate
214variable.
215.Pp
216For example:
217.Bd -literal
218const unsigned char *vector = "\ex06" "spdy/1" "\ex08" "http/1.1";
219unsigned int length = strlen(vector);
220.Ed
221.Pp
222The ALPN callback is executed after the servername callback; as that
223servername callback may update the SSL_CTX, and subsequently, the ALPN
224callback.
225.Pp
226If there is no ALPN proposed in the ClientHello, the ALPN callback is
227not invoked.
228.Sh RETURN VALUES
229.Fn SSL_CTX_set_alpn_protos
230and
231.Fn SSL_set_alpn_protos
232return 0 on success or non-zero on failure.
233WARNING: these functions reverse the return value convention.
234.Pp
235.Fn SSL_select_next_proto
236returns one of the following:
237.Bl -tag -width Ds
238.It OPENSSL_NPN_NEGOTIATED
239A match was found and is returned in
240.Fa out ,
241.Fa outlen .
242.It OPENSSL_NPN_NO_OVERLAP
243No match was found.
244The first item in
245.Fa supported_list ,
246.Fa supported_list_len
247is returned in
248.Fa out ,
249.Fa outlen .
250.El
251.Pp
252The ALPN select callback
253.Fa cb
254must return one of the following:
255.Bl -tag -width Ds
256.It SSL_TLSEXT_ERR_OK
257ALPN protocol selected.
258.It SSL_TLSEXT_ERR_ALERT_FATAL
259There was no overlap between the client's supplied list and the
260server configuration.
261.It SSL_TLSEXT_ERR_NOACK
262ALPN protocol not selected, e.g., because no ALPN protocols are
263configured for this connection.
264.El
265.Sh SEE ALSO
266.Xr ssl 3 ,
267.Xr SSL_CTX_set_tlsext_servername_arg 3 ,
268.Xr SSL_CTX_set_tlsext_servername_callback 3
269.Sh STANDARDS
270.Rs
271.%T TLS Application-Layer Protocol Negotiation Extension
272.%R RFC 7301
273.Re
274.Pp
275.Rs
276.%T TLS Next Protocol Negotiation Extension
277.%U https://datatracker.ietf.org/doc/html/draft-agl-tls-nextprotoneg
278.Re
279.Sh HISTORY
280.Fn SSL_select_next_proto
281first appeared in OpenSSL 1.0.1 and has been available since
282.Ox 5.3 .
283.Pp
284.Fn SSL_CTX_set_alpn_protos ,
285.Fn SSL_set_alpn_protos ,
286.Fn SSL_CTX_set_alpn_select_cb ,
287and
288.Fn SSL_get0_alpn_selected
289first appeared in OpenSSL 1.0.2 and have been available since
290.Ox 5.7 .
291.Sh CAVEATS
292The fallback to the first supported protocol in
293.Fn SSL_select_next_proto
294comes from the opportunistic fallback mechanism in the NPN extension.
295This behavior does not make sense for ALPN,
296where missing protocol overlap should result in a handshake failure.
297To avoid accidental selection of a protocol that the server does not
298support, it is recommended to pass the locally configured protocols
299as second pair of protocols in the ALPN callback.
300.Sh BUGS
301The
302.Fa out
303argument of
304.Fn SSL_select_next_proto
305should have been const.
diff --git a/src/lib/libssl/man/SSL_CTX_set_cert_store.3 b/src/lib/libssl/man/SSL_CTX_set_cert_store.3
deleted file mode 100644
index 1be1ba2f68..0000000000
--- a/src/lib/libssl/man/SSL_CTX_set_cert_store.3
+++ /dev/null
@@ -1,146 +0,0 @@
1.\" $OpenBSD: SSL_CTX_set_cert_store.3,v 1.8 2024/08/03 04:53:01 tb Exp $
2.\" OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400
3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
5.\" Copyright (c) 2001, 2002, 2005 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: August 3 2024 $
52.Dt SSL_CTX_SET_CERT_STORE 3
53.Os
54.Sh NAME
55.Nm SSL_CTX_set_cert_store ,
56.Nm SSL_CTX_set1_cert_store ,
57.Nm SSL_CTX_get_cert_store
58.Nd manipulate X509 certificate verification storage
59.Sh SYNOPSIS
60.In openssl/ssl.h
61.Ft void
62.Fn SSL_CTX_set_cert_store "SSL_CTX *ctx" "X509_STORE *store"
63.Ft void
64.Fn SSL_CTX_set1_cert_store "SSL_CTX *ctx" "X509_STORE *store"
65.Ft X509_STORE *
66.Fn SSL_CTX_get_cert_store "const SSL_CTX *ctx"
67.Sh DESCRIPTION
68.Fn SSL_CTX_set_cert_store
69sets the verification storage of
70.Fa ctx
71to or replaces it with
72.Fa store .
73If another
74.Vt X509_STORE
75object is currently set in
76.Fa ctx ,
77it will be freed.
78.Pp
79.Fn SSL_CTX_set1_cert_store
80sets the verification storage of
81.Fa ctx
82to or replaces it with
83.Fa store .
84The
85.Fa store Ns 's
86reference count is incremented.
87.Pp
88.Fn SSL_CTX_get_cert_store
89returns a pointer to the current certificate verification storage.
90.Pp
91In order to verify the certificates presented by the peer, trusted CA
92certificates must be accessed.
93These CA certificates are made available via lookup methods, handled inside the
94.Vt X509_STORE .
95From the
96.Vt X509_STORE
97the
98.Vt X509_STORE_CTX
99used when verifying certificates is created.
100.Pp
101Typically the trusted certificate store is handled indirectly via using
102.Xr SSL_CTX_load_verify_locations 3 .
103Using the
104.Fn SSL_CTX_set_cert_store
105and
106.Fn SSL_CTX_get_cert_store
107functions it is possible to manipulate the
108.Vt X509_STORE
109object beyond the
110.Xr SSL_CTX_load_verify_locations 3
111call.
112.Pp
113Currently no detailed documentation on how to use the
114.Vt X509_STORE
115object is available.
116Not all members of the
117.Vt X509_STORE
118are used when the verification takes place.
119So will, for example, the
120.Fn verify_callback
121be overridden with the
122.Fn verify_callback
123set via the
124.Xr SSL_CTX_set_verify 3
125family of functions.
126This document must therefore be updated when documentation about the
127.Vt X509_STORE
128object and its handling becomes available.
129.Sh RETURN VALUES
130.Fn SSL_CTX_get_cert_store
131returns the current setting.
132.Sh SEE ALSO
133.Xr ssl 3 ,
134.Xr SSL_CTX_load_verify_locations 3 ,
135.Xr SSL_CTX_set_verify 3 ,
136.Xr X509_STORE_new 3
137.Sh HISTORY
138.Fn SSL_CTX_set_cert_store
139and
140.Fn SSL_CTX_get_cert_store
141first appeared in SSLeay 0.8.1 and have been available since
142.Ox 2.4 .
143.Pp
144.Fn SSL_CTX_set1_cert_store
145first appeared in OpenSSL 1.1.1 and has been available since
146.Ox 7.6 .
diff --git a/src/lib/libssl/man/SSL_CTX_set_cert_verify_callback.3 b/src/lib/libssl/man/SSL_CTX_set_cert_verify_callback.3
deleted file mode 100644
index 0e12b48c78..0000000000
--- a/src/lib/libssl/man/SSL_CTX_set_cert_verify_callback.3
+++ /dev/null
@@ -1,163 +0,0 @@
1.\" $OpenBSD: SSL_CTX_set_cert_verify_callback.3,v 1.5 2019/06/08 15:25:43 schwarze Exp $
2.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
5.\" Copyright (c) 2001, 2002 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: June 8 2019 $
52.Dt SSL_CTX_SET_CERT_VERIFY_CALLBACK 3
53.Os
54.Sh NAME
55.Nm SSL_CTX_set_cert_verify_callback
56.Nd set peer certificate verification procedure
57.Sh SYNOPSIS
58.In openssl/ssl.h
59.Ft void
60.Fo SSL_CTX_set_cert_verify_callback
61.Fa "SSL_CTX *ctx"
62.Fa "int (*callback)(X509_STORE_CTX *, void *)"
63.Fa "void *arg"
64.Fc
65.Sh DESCRIPTION
66.Fn SSL_CTX_set_cert_verify_callback
67sets the verification callback function for
68.Fa ctx .
69.Vt SSL
70objects that are created from
71.Fa ctx
72inherit the setting valid at the time when
73.Xr SSL_new 3
74is called.
75.Pp
76Whenever a certificate is verified during a SSL/TLS handshake,
77a verification function is called.
78If the application does not explicitly specify a verification callback
79function, the built-in verification function is used.
80If a verification callback
81.Fa callback
82is specified via
83.Fn SSL_CTX_set_cert_verify_callback ,
84the supplied callback function is called instead.
85By setting
86.Fa callback
87to
88.Dv NULL ,
89the default behaviour is restored.
90.Pp
91When the verification must be performed,
92.Fa callback
93will be called with the arguments
94.Fn callback "X509_STORE_CTX *x509_store_ctx" "void *arg" .
95The argument
96.Fa arg
97is specified by the application when setting
98.Fa callback .
99.Pp
100.Fa callback
101should return 1 to indicate verification success and 0 to indicate verification
102failure.
103If
104.Dv SSL_VERIFY_PEER
105is set and
106.Fa callback
107returns 0, the handshake will fail.
108As the verification procedure may allow the connection to continue in case of
109failure (by always returning 1) the verification result must be set in any case
110using the
111.Fa error
112member of
113.Fa x509_store_ctx
114so that the calling application will be informed about the detailed result of
115the verification procedure!
116.Pp
117Within
118.Fa x509_store_ctx ,
119.Fa callback
120has access to the
121.Fa verify_callback
122function set using
123.Xr SSL_CTX_set_verify 3 .
124.Sh SEE ALSO
125.Xr ssl 3 ,
126.Xr SSL_CTX_load_verify_locations 3 ,
127.Xr SSL_CTX_set_verify 3 ,
128.Xr SSL_get_verify_result 3
129.Sh HISTORY
130.Fn SSL_CTX_set_cert_verify_callback
131first appeared in SSLeay 0.6.1 and has been available since
132.Ox 2.4 .
133.Pp
134Previous to OpenSSL 0.9.7, the
135.Fa arg
136argument to
137.Fn SSL_CTX_set_cert_verify_callback
138was ignored, and
139.Fa callback
140was called
141simply as
142.Ft int
143.Fn (*callback) "X509_STORE_CTX *" .
144To compile software written for previous versions of OpenSSL,
145a dummy argument will have to be added to
146.Fa callback .
147.Sh CAVEATS
148Do not mix the verification callback described in this function with the
149.Fa verify_callback
150function called during the verification process.
151The latter is set using the
152.Xr SSL_CTX_set_verify 3
153family of functions.
154.Pp
155Providing a complete verification procedure including certificate purpose
156settings, etc., is a complex task.
157The built-in procedure is quite powerful and in most cases it should be
158sufficient to modify its behaviour using the
159.Fa verify_callback
160function.
161.Sh BUGS
162.Fn SSL_CTX_set_cert_verify_callback
163does not provide diagnostic information.
diff --git a/src/lib/libssl/man/SSL_CTX_set_cipher_list.3 b/src/lib/libssl/man/SSL_CTX_set_cipher_list.3
deleted file mode 100644
index b3f0dc3541..0000000000
--- a/src/lib/libssl/man/SSL_CTX_set_cipher_list.3
+++ /dev/null
@@ -1,375 +0,0 @@
1.\" $OpenBSD: SSL_CTX_set_cipher_list.3,v 1.18 2025/01/18 12:20:02 tb Exp $
2.\" full merge up to: OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3.\"
4.\" This file is a derived work.
5.\" The changes are covered by the following Copyright and license:
6.\"
7.\" Copyright (c) 2018, 2020 Ingo Schwarze <schwarze@openbsd.org>
8.\"
9.\" Permission to use, copy, modify, and distribute this software for any
10.\" purpose with or without fee is hereby granted, provided that the above
11.\" copyright notice and this permission notice appear in all copies.
12.\"
13.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
14.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
15.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
16.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
17.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
18.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
19.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20.\"
21.\" The original file was written by Lutz Jaenicke <jaenicke@openssl.org>.
22.\" Copyright (c) 2000, 2001, 2013 The OpenSSL Project. All rights reserved.
23.\"
24.\" Redistribution and use in source and binary forms, with or without
25.\" modification, are permitted provided that the following conditions
26.\" are met:
27.\"
28.\" 1. Redistributions of source code must retain the above copyright
29.\" notice, this list of conditions and the following disclaimer.
30.\"
31.\" 2. Redistributions in binary form must reproduce the above copyright
32.\" notice, this list of conditions and the following disclaimer in
33.\" the documentation and/or other materials provided with the
34.\" distribution.
35.\"
36.\" 3. All advertising materials mentioning features or use of this
37.\" software must display the following acknowledgment:
38.\" "This product includes software developed by the OpenSSL Project
39.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
40.\"
41.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
42.\" endorse or promote products derived from this software without
43.\" prior written permission. For written permission, please contact
44.\" openssl-core@openssl.org.
45.\"
46.\" 5. Products derived from this software may not be called "OpenSSL"
47.\" nor may "OpenSSL" appear in their names without prior written
48.\" permission of the OpenSSL Project.
49.\"
50.\" 6. Redistributions of any form whatsoever must retain the following
51.\" acknowledgment:
52.\" "This product includes software developed by the OpenSSL Project
53.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
54.\"
55.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
56.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
57.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
58.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
59.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
60.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
61.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
62.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
63.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
64.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
65.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
66.\" OF THE POSSIBILITY OF SUCH DAMAGE.
67.\"
68.Dd $Mdocdate: January 18 2025 $
69.Dt SSL_CTX_SET_CIPHER_LIST 3
70.Os
71.Sh NAME
72.Nm SSL_CTX_set_cipher_list ,
73.Nm SSL_set_cipher_list
74.Nd choose list of available SSL_CIPHERs
75.Sh SYNOPSIS
76.In openssl/ssl.h
77.Ft int
78.Fn SSL_CTX_set_cipher_list "SSL_CTX *ctx" "const char *control"
79.Ft int
80.Fn SSL_set_cipher_list "SSL *ssl" "const char *control"
81.Sh DESCRIPTION
82.Fn SSL_CTX_set_cipher_list
83sets the list of available cipher suites for
84.Fa ctx
85using the
86.Fa control
87string.
88The list of cipher suites is inherited by all
89.Fa ssl
90objects created from
91.Fa ctx .
92.Pp
93.Fn SSL_set_cipher_list
94sets the list of cipher suites only for
95.Fa ssl .
96.Pp
97The control string consists of one or more control words
98separated by colon characters
99.Pq Ql \&: .
100Space
101.Pq Ql \ \& ,
102semicolon
103.Pq Ql \&; ,
104and comma
105.Pq Ql \&,
106characters can also be used as separators.
107Each control words selects a set of cipher suites
108and can take one of the following optional prefix characters:
109.Bl -tag -width Ds
110.It \&No prefix:
111Those of the selected cipher suites that have not been made available
112yet are added to the end of the list of available cipher suites,
113preserving their order.
114.It Prefixed minus sign Pq Ql \- :
115Those of the selected cipher suites that have been made available
116earlier are moved back from the list of available cipher suites to
117the beginning of the list of unavailable cipher suites,
118also preserving their order.
119.It Prefixed plus sign Pq Ql + :
120Those of the selected cipher suites have been made available earlier
121are moved to end of the list of available cipher suites, reducing
122their priority, but preserving the order among themselves.
123.It Prefixed exclamation mark Pq Ql \&! :
124The selected cipher suites are permanently deleted, no matter whether
125they had earlier been made available or not, and can no longer
126be added or re-added by later words.
127.El
128.Pp
129The following special words can only be used without a prefix:
130.Bl -tag -width Ds
131.It Cm DEFAULT
132An alias for
133.Sm off
134.Cm ALL No :! Cm aNULL No :! Cm eNULL .
135.Sm on
136It can only be used as the first word.
137The
138.Cm DEFAULT
139cipher list can be displayed with the
140.Xr openssl 1
141.Cm ciphers
142command.
143.It Cm @SECLEVEL=n
144Set the security level to n, which should be a number between
145zero and five.
146See
147.Xr SSL_CTX_set_security_level 3
148for details.
149.It Cm @STRENGTH
150Sort the list by decreasing encryption strength,
151preserving the order of cipher suites that have the same strength.
152It is usually given as the last word.
153.El
154.Pp
155The following words can be used to select groups of cipher suites,
156with or without a prefix character.
157If two or more of these words are joined with plus signs
158.Pq Ql +
159to form a longer word, only the intersection of the specified sets
160is selected.
161.Bl -tag -width Ds
162.It Cm ADH
163Cipher suites using ephemeral DH for key exchange
164without doing any server authentication.
165Equivalent to
166.Cm DH Ns + Ns Cm aNULL .
167.It Cm AEAD
168Cipher suites using Authenticated Encryption with Additional Data.
169.It Cm AECDH
170Cipher suites using ephemeral ECDH for key exchange
171without doing any server authentication.
172Equivalent to
173.Cm ECDH Ns + Ns Cm aNULL .
174.It Cm aECDSA
175Cipher suites using ECDSA server authentication.
176.It Cm AES
177Cipher suites using AES or AESGCM for symmetric encryption.
178.It Cm AES128
179Cipher suites using AES(128) or AESGCM(128) for symmetric encryption.
180.It Cm AES256
181Cipher suites using AES(256) or AESGCM(256) for symmetric encryption.
182.It Cm AESGCM
183Cipher suites using AESGCM for symmetric encryption.
184.It Cm aGOST
185An alias for
186.Cm aGOST01 .
187.It Cm aGOST01
188Cipher suites using GOST R 34.10-2001 server authentication.
189.It Cm ALL
190All cipher suites except those selected by
191.Cm eNULL .
192.It Cm aNULL
193Cipher suites that don't do any server authentication.
194Not enabled by
195.Cm DEFAULT .
196Beware of man-in-the-middle attacks.
197.It Cm aRSA
198Cipher suites using RSA server authentication.
199.It Cm CAMELLIA
200Cipher suites using Camellia for symmetric encryption.
201.It Cm CAMELLIA128
202Cipher suites using Camellia(128) for symmetric encryption.
203.It Cm CAMELLIA256
204Cipher suites using Camellia(256) for symmetric encryption.
205.It Cm CHACHA20
206Cipher suites using ChaCha20-Poly1305 for symmetric encryption.
207.It Cm COMPLEMENTOFALL
208Cipher suites that are not included in
209.Cm ALL .
210Currently an alias for
211.Cm eNULL .
212.It Cm COMPLEMENTOFDEFAULT
213Cipher suites that are included in
214.Cm ALL ,
215but not included in
216.Cm DEFAULT .
217Currently similar to
218.Cm aNULL Ns :! Ns Cm eNULL
219except for the order of the cipher suites which are
220.Em not
221selected.
222.It Cm 3DES
223Cipher suites using triple DES for symmetric encryption.
224.It Cm DH
225Cipher suites using ephemeral DH for key exchange.
226.It Cm DHE
227Cipher suites using ephemeral DH for key exchange,
228but excluding those that don't do any server authentication.
229Similar to
230.Cm DH Ns :! Ns Cm aNULL
231except for the order of the cipher suites which are
232.Em not
233selected.
234.It Cm ECDH
235Cipher suites using ephemeral ECDH for key exchange.
236.It Cm ECDHE
237Cipher suites using ephemeral ECDH for key exchange,
238but excluding those that don't do any server authentication.
239Similar to
240.Cm ECDH Ns :! Ns Cm aNULL
241except for the order of the cipher suites which are
242.Em not
243selected.
244.It Cm ECDSA
245An alias for
246.Cm aECDSA .
247.It Cm eNULL
248Cipher suites that do not use any encryption.
249Not enabled by
250.Cm DEFAULT ,
251and not even included in
252.Cm ALL .
253.It Cm GOST89MAC
254Cipher suites using GOST 28147-89 for message authentication
255instead of HMAC.
256.It Cm GOST94
257Cipher suites using HMAC based on GOST R 34.11-94
258for message authentication.
259.It Cm HIGH
260Cipher suites of high strength.
261.It Cm kGOST
262Cipher suites using VKO 34.10 key exchange, specified in RFC 4357.
263.It Cm kRSA
264Cipher suites using RSA key exchange.
265.It Cm LOW
266Cipher suites of low strength.
267.It Cm MD5
268Cipher suites using MD5 for message authentication.
269.It Cm MEDIUM
270Cipher suites of medium strength.
271.It Cm NULL
272An alias for
273.Cm eNULL .
274.It Cm RC4
275Cipher suites using RC4 for symmetric encryption.
276.It Cm RSA
277Cipher suites using RSA for both key exchange and server authentication.
278Equivalent to
279.Cm kRSA Ns + Ns Cm aRSA .
280.It Cm SHA
281An alias for
282.Cm SHA1 .
283.It Cm SHA1
284Cipher suites using SHA1 for message authentication.
285.It Cm SHA256
286Cipher suites using SHA256 for message authentication.
287.It Cm SHA384
288Cipher suites using SHA384 for message authentication.
289.It Cm SSLv3
290An alias for
291.Cm TLSv1 .
292.It Cm STREEBOG256
293Cipher suites using STREEBOG256 for message authentication.
294.It Cm TLSv1
295Cipher suites usable with the TLSv1.0, TLSv1.1, and TLSv1.2 protocols.
296.It Cm TLSv1.2
297Cipher suites for the TLSv1.2 protocol.
298.It Cm TLSv1.3
299Cipher suites for the TLSv1.3 protocol.
300If the
301.Fa control
302string selects at least one cipher suite but neither contains the word
303.Cm TLSv1.3
304nor specifically includes nor excludes any TLSv1.3 cipher suites, all the
305.Cm TLSv1.3
306cipher suites are made available, too.
307.El
308.Pp
309The full words returned by the
310.Xr openssl 1
311.Cm ciphers
312command can be used to select individual cipher suites.
313.Pp
314The following are deprecated aliases:
315.Pp
316.Bl -column kEECDH ECDHE -compact -offset indent
317.It avoid: Ta use:
318.It Cm EDH Ta Cm DHE
319.It Cm EECDH Ta Cm ECDHE
320.It Cm kEDH Ta Cm DH
321.It Cm kEECDH Ta Cm ECDH
322.El
323.Pp
324Unknown words are silently ignored, selecting no cipher suites.
325Failure is only flagged if the
326.Fa control
327string contains invalid bytes
328or if no matching cipher suites are available at all.
329.Pp
330On the client side, including a cipher suite into the list of
331available cipher suites is sufficient for using it.
332On the server side, all cipher suites have additional requirements.
333ADH ciphers don't need a certificate, but DH-parameters must have been set.
334All other cipher suites need a corresponding certificate and key.
335.Pp
336A RSA cipher can only be chosen when an RSA certificate is available.
337RSA ciphers using DHE need a certificate and key and additional DH-parameters
338(see
339.Xr SSL_CTX_set_tmp_dh_callback 3 ) .
340.Pp
341When these conditions are not met
342for any cipher suite in the list (for example, a
343client only supports export RSA ciphers with an asymmetric key length of 512
344bits and the server is not configured to use temporary RSA keys), the
345.Dq no shared cipher
346.Pq Dv SSL_R_NO_SHARED_CIPHER
347error is generated and the handshake will fail.
348.Sh RETURN VALUES
349.Fn SSL_CTX_set_cipher_list
350and
351.Fn SSL_set_cipher_list
352return 1 if any cipher suite could be selected and 0 on complete failure.
353.Sh SEE ALSO
354.Xr ssl 3 ,
355.Xr SSL_CTX_set1_groups 3 ,
356.Xr SSL_CTX_set_tmp_dh_callback 3 ,
357.Xr SSL_CTX_use_certificate 3 ,
358.Xr SSL_get_ciphers 3
359.Sh HISTORY
360.Fn SSL_CTX_set_cipher_list
361and
362.Fn SSL_set_cipher_list
363first appeared in SSLeay 0.5.2 and have been available since
364.Ox 2.4 .
365.Sh CAVEATS
366In LibreSSL,
367.Fn SSL_CTX_set_cipher_list
368and
369.Fn SSL_set_cipher_list
370can be used to configure the list of available cipher suites for
371all versions of the TLS protocol, whereas in OpenSSL, they only
372control cipher suites for protocols up to TLSv1.2.
373If compatibility with OpenSSL is required, the list of
374available TLSv1.3 cipher suites can only be changed with
375.Fn SSL_set_ciphersuites .
diff --git a/src/lib/libssl/man/SSL_CTX_set_client_CA_list.3 b/src/lib/libssl/man/SSL_CTX_set_client_CA_list.3
deleted file mode 100644
index d19fb93ed0..0000000000
--- a/src/lib/libssl/man/SSL_CTX_set_client_CA_list.3
+++ /dev/null
@@ -1,183 +0,0 @@
1.\" $OpenBSD: SSL_CTX_set_client_CA_list.3,v 1.6 2020/03/30 10:28:59 schwarze Exp $
2.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
5.\" Copyright (c) 2000, 2001, 2013 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: March 30 2020 $
52.Dt SSL_CTX_SET_CLIENT_CA_LIST 3
53.Os
54.Sh NAME
55.Nm SSL_CTX_set_client_CA_list ,
56.Nm SSL_set_client_CA_list ,
57.Nm SSL_CTX_add_client_CA ,
58.Nm SSL_add_client_CA
59.Nd set list of CAs sent to the client when requesting a client certificate
60.Sh SYNOPSIS
61.In openssl/ssl.h
62.Ft void
63.Fn SSL_CTX_set_client_CA_list "SSL_CTX *ctx" "STACK_OF(X509_NAME) *list"
64.Ft void
65.Fn SSL_set_client_CA_list "SSL *s" "STACK_OF(X509_NAME) *list"
66.Ft int
67.Fn SSL_CTX_add_client_CA "SSL_CTX *ctx" "X509 *cacert"
68.Ft int
69.Fn SSL_add_client_CA "SSL *ssl" "X509 *cacert"
70.Sh DESCRIPTION
71.Fn SSL_CTX_set_client_CA_list
72sets the
73.Fa list
74of CAs sent to the client when requesting a client certificate for
75.Fa ctx .
76.Pp
77.Fn SSL_set_client_CA_list
78sets the
79.Fa list
80of CAs sent to the client when requesting a client certificate for the chosen
81.Fa ssl ,
82overriding the setting valid for
83.Fa ssl Ns 's
84.Vt SSL_CTX
85object.
86.Pp
87.Fn SSL_CTX_add_client_CA
88adds the CA name extracted from
89.Fa cacert
90to the list of CAs sent to the client when requesting a client certificate for
91.Fa ctx .
92.Pp
93.Fn SSL_add_client_CA
94adds the CA name extracted from
95.Fa cacert
96to the list of CAs sent to the client when requesting a client certificate for
97the chosen
98.Fa ssl ,
99overriding the setting valid for
100.Fa ssl Ns 's
101.Va SSL_CTX
102object.
103.Pp
104When a TLS/SSL server requests a client certificate (see
105.Fn SSL_CTX_set_verify ) ,
106it sends a list of CAs for which it will accept certificates to the client.
107.Pp
108This list must explicitly be set using
109.Fn SSL_CTX_set_client_CA_list
110for
111.Fa ctx
112and
113.Fn SSL_set_client_CA_list
114for the specific
115.Fa ssl .
116The list specified overrides the previous setting.
117The CAs listed do not become trusted
118.Po
119.Fa list
120only contains the names, not the complete certificates
121.Pc ;
122use
123.Xr SSL_CTX_load_verify_locations 3
124to additionally load them for verification.
125.Pp
126If the list of acceptable CAs is compiled in a file, the
127.Xr SSL_load_client_CA_file 3
128function can be used to help importing the necessary data.
129.Pp
130.Fn SSL_CTX_add_client_CA
131and
132.Fn SSL_add_client_CA
133can be used to add additional items the list of client CAs.
134If no list was specified before using
135.Fn SSL_CTX_set_client_CA_list
136or
137.Fn SSL_set_client_CA_list ,
138a new client CA list for
139.Fa ctx
140or
141.Fa ssl
142(as appropriate) is opened.
143.Pp
144These functions are only useful for TLS/SSL servers.
145.Sh RETURN VALUES
146.Fn SSL_CTX_add_client_CA
147and
148.Fn SSL_add_client_CA
149have the following return values:
150.Bl -tag -width Ds
151.It 0
152A failure while manipulating the
153.Dv STACK_OF Ns
154.Pq Vt X509_NAME
155object occurred or the
156.Vt X509_NAME
157could not be extracted from
158.Fa cacert .
159Check the error stack to find out the reason.
160.It 1
161The operation succeeded.
162.El
163.Sh EXAMPLES
164Scan all certificates in
165.Fa CAfile
166and list them as acceptable CAs:
167.Bd -literal
168SSL_CTX_set_client_CA_list(ctx, SSL_load_client_CA_file(CAfile));
169.Ed
170.Sh SEE ALSO
171.Xr ssl 3 ,
172.Xr SSL_CTX_load_verify_locations 3 ,
173.Xr SSL_get_client_CA_list 3 ,
174.Xr SSL_load_client_CA_file 3 ,
175.Xr X509_NAME_new 3
176.Sh HISTORY
177.Fn SSL_CTX_set_client_CA_list ,
178.Fn SSL_set_client_CA_list ,
179.Fn SSL_CTX_add_client_CA ,
180and
181.Fn SSL_add_client_CA
182first appeared in SSLeay 0.8.0 and have been available since
183.Ox 2.4 .
diff --git a/src/lib/libssl/man/SSL_CTX_set_client_cert_cb.3 b/src/lib/libssl/man/SSL_CTX_set_client_cert_cb.3
deleted file mode 100644
index a2433b5e92..0000000000
--- a/src/lib/libssl/man/SSL_CTX_set_client_cert_cb.3
+++ /dev/null
@@ -1,191 +0,0 @@
1.\" $OpenBSD: SSL_CTX_set_client_cert_cb.3,v 1.4 2018/03/27 17:35:50 schwarze Exp $
2.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
5.\" Copyright (c) 2002 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: March 27 2018 $
52.Dt SSL_CTX_SET_CLIENT_CERT_CB 3
53.Os
54.Sh NAME
55.Nm SSL_CTX_set_client_cert_cb ,
56.Nm SSL_CTX_get_client_cert_cb
57.Nd handle client certificate callback function
58.Sh SYNOPSIS
59.In openssl/ssl.h
60.Ft void
61.Fo SSL_CTX_set_client_cert_cb
62.Fa "SSL_CTX *ctx"
63.Fa "int (*client_cert_cb)(SSL *ssl, X509 **x509, EVP_PKEY **pkey)"
64.Fc
65.Ft int
66.Fo "(*SSL_CTX_get_client_cert_cb(SSL_CTX *ctx))"
67.Fa "SSL *ssl" "X509 **x509" "EVP_PKEY **pkey"
68.Fc
69.Ft int
70.Fn "(*client_cert_cb)" "SSL *ssl" "X509 **x509" "EVP_PKEY **pkey"
71.Sh DESCRIPTION
72.Fn SSL_CTX_set_client_cert_cb
73sets the
74.Fa client_cert_cb()
75callback that is called when a client certificate is requested by a server and
76no certificate was yet set for the SSL object.
77.Pp
78When
79.Fa client_cert_cb
80is
81.Dv NULL ,
82no callback function is used.
83.Pp
84.Fn SSL_CTX_get_client_cert_cb
85returns a pointer to the currently set callback function.
86.Pp
87.Fn client_cert_cb
88is the application-defined callback.
89If it wants to set a certificate,
90a certificate/private key combination must be set using the
91.Fa x509
92and
93.Fa pkey
94arguments and 1 must be returned.
95The certificate will be installed into
96.Fa ssl .
97If no certificate should be set,
980 has to be returned and no certificate will be sent.
99A negative return value will suspend the handshake and the handshake function
100will return immediately.
101.Xr SSL_get_error 3
102will return
103.Dv SSL_ERROR_WANT_X509_LOOKUP
104to indicate that the handshake was suspended.
105The next call to the handshake function will again lead to the call of
106.Fa client_cert_cb() .
107It is the job of the
108.Fa client_cert_cb()
109to store information
110about the state of the last call, if required to continue.
111.Pp
112During a handshake (or renegotiation)
113a server may request a certificate from the client.
114A client certificate must only be sent when the server did send the request.
115.Pp
116When a certificate has been set using the
117.Xr SSL_CTX_use_certificate 3
118family of functions,
119it will be sent to the server.
120The TLS standard requires that only a certificate is sent if it matches the
121list of acceptable CAs sent by the server.
122This constraint is violated by the default behavior of the OpenSSL library.
123Using the callback function it is possible to implement a proper selection
124routine or to allow a user interaction to choose the certificate to be sent.
125.Pp
126If a callback function is defined and no certificate was yet defined for the
127.Vt SSL
128object, the callback function will be called.
129If the callback function returns a certificate, the OpenSSL library
130will try to load the private key and certificate data into the
131.Vt SSL
132object using the
133.Fn SSL_use_certificate
134and
135.Fn SSL_use_private_key
136functions.
137Thus it will permanently install the certificate and key for this SSL object.
138It will not be reset by calling
139.Xr SSL_clear 3 .
140If the callback returns no certificate, the OpenSSL library will not send a
141certificate.
142.Sh SEE ALSO
143.Xr ssl 3 ,
144.Xr SSL_clear 3 ,
145.Xr SSL_CTX_add_extra_chain_cert 3 ,
146.Xr SSL_CTX_use_certificate 3 ,
147.Xr SSL_free 3 ,
148.Xr SSL_get_client_CA_list 3
149.Sh HISTORY
150.Fn SSL_CTX_set_client_cert_cb
151and
152.Fn SSL_CTX_get_client_cert_cb
153first appeared in SSLeay 0.6.6 and have been available since
154.Ox 2.4 .
155.Sh BUGS
156The
157.Fa client_cert_cb()
158cannot return a complete certificate chain;
159it can only return one client certificate.
160If the chain only has a length of 2,
161the root CA certificate may be omitted according to the TLS standard and
162thus a standard conforming answer can be sent to the server.
163For a longer chain, the client must send the complete chain
164(with the option to leave out the root CA certificate).
165This can be accomplished only by either adding the intermediate CA certificates
166into the trusted certificate store for the
167.Vt SSL_CTX
168object (resulting in having to add CA certificates that otherwise maybe would
169not be trusted), or by adding the chain certificates using the
170.Xr SSL_CTX_add_extra_chain_cert 3
171function, which is only available for the
172.Vt SSL_CTX
173object as a whole and that therefore probably can only apply for one client
174certificate, making the concept of the callback function
175(to allow the choice from several certificates) questionable.
176.Pp
177Once the
178.Vt SSL
179object has been used in conjunction with the callback function,
180the certificate will be set for the
181.Vt SSL
182object and will not be cleared even when
183.Xr SSL_clear 3
184is called.
185It is therefore
186.Em mandatory
187to destroy the
188.Vt SSL
189object using
190.Xr SSL_free 3
191and create a new one to return to the previous state.
diff --git a/src/lib/libssl/man/SSL_CTX_set_default_passwd_cb.3 b/src/lib/libssl/man/SSL_CTX_set_default_passwd_cb.3
deleted file mode 100644
index 94b4ea543d..0000000000
--- a/src/lib/libssl/man/SSL_CTX_set_default_passwd_cb.3
+++ /dev/null
@@ -1,216 +0,0 @@
1.\" $OpenBSD: SSL_CTX_set_default_passwd_cb.3,v 1.9 2023/09/19 09:40:35 schwarze Exp $
2.\" full merge up to: OpenSSL 9b86974e Aug 17 15:21:33 2015 -0400
3.\" selective merge up to: OpenSSL 18bad535 Apr 9 15:13:55 2019 +0100
4.\"
5.\" This file is a derived work.
6.\" The changes are covered by the following Copyright and license:
7.\"
8.\" Copyright (c) 2023 Ingo Schwarze <schwarze@openbsd.org>
9.\"
10.\" Permission to use, copy, modify, and distribute this software for any
11.\" purpose with or without fee is hereby granted, provided that the above
12.\" copyright notice and this permission notice appear in all copies.
13.\"
14.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
15.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
16.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
17.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
18.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
19.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
20.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
21.\"
22.\" The original file was written by Lutz Jaenicke <jaenicke@openssl.org>
23.\" and Christian Heimes <cheimes@redhat.com>.
24.\" Copyright (c) 2000, 2001, 2016 The OpenSSL Project. All rights reserved.
25.\"
26.\" Redistribution and use in source and binary forms, with or without
27.\" modification, are permitted provided that the following conditions
28.\" are met:
29.\"
30.\" 1. Redistributions of source code must retain the above copyright
31.\" notice, this list of conditions and the following disclaimer.
32.\"
33.\" 2. Redistributions in binary form must reproduce the above copyright
34.\" notice, this list of conditions and the following disclaimer in
35.\" the documentation and/or other materials provided with the
36.\" distribution.
37.\"
38.\" 3. All advertising materials mentioning features or use of this
39.\" software must display the following acknowledgment:
40.\" "This product includes software developed by the OpenSSL Project
41.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
42.\"
43.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
44.\" endorse or promote products derived from this software without
45.\" prior written permission. For written permission, please contact
46.\" openssl-core@openssl.org.
47.\"
48.\" 5. Products derived from this software may not be called "OpenSSL"
49.\" nor may "OpenSSL" appear in their names without prior written
50.\" permission of the OpenSSL Project.
51.\"
52.\" 6. Redistributions of any form whatsoever must retain the following
53.\" acknowledgment:
54.\" "This product includes software developed by the OpenSSL Project
55.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
56.\"
57.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
58.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
59.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
60.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
61.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
62.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
63.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
64.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
65.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
66.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
67.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
68.\" OF THE POSSIBILITY OF SUCH DAMAGE.
69.\"
70.Dd $Mdocdate: September 19 2023 $
71.Dt SSL_CTX_SET_DEFAULT_PASSWD_CB 3
72.Os
73.Sh NAME
74.Nm SSL_CTX_set_default_passwd_cb ,
75.Nm SSL_CTX_set_default_passwd_cb_userdata ,
76.Nm SSL_CTX_get_default_passwd_cb ,
77.Nm SSL_CTX_get_default_passwd_cb_userdata
78.Nd set or get passwd callback for encrypted PEM file handling
79.Sh SYNOPSIS
80.In openssl/ssl.h
81.Ft void
82.Fn SSL_CTX_set_default_passwd_cb "SSL_CTX *ctx" "pem_password_cb *cb"
83.Ft void
84.Fn SSL_CTX_set_default_passwd_cb_userdata "SSL_CTX *ctx" "void *userdata"
85.Ft pem_password_cb *
86.Fn SSL_CTX_get_default_passwd_cb "SSL_CTX *ctx"
87.Ft void *
88.Fn SSL_CTX_get_default_passwd_cb_userdata "SSL_CTX *ctx"
89.Sh DESCRIPTION
90.Fn SSL_CTX_set_default_passwd_cb
91sets the password callback for loading a certificate or private key
92from encrypted PEM format.
93In particular, the callback is used by
94.Xr SSL_CTX_use_certificate_file 3 ,
95.Xr SSL_use_certificate_file 3 ,
96.Xr SSL_CTX_use_certificate_chain_file 3 ,
97.Xr SSL_use_certificate_chain_file 3 ,
98.Xr SSL_CTX_use_certificate_chain_mem 3 ,
99.Xr SSL_CTX_use_PrivateKey_file 3 ,
100.Xr SSL_use_PrivateKey_file 3 ,
101.Xr SSL_CTX_use_RSAPrivateKey_file 3 ,
102and
103.Xr SSL_use_RSAPrivateKey_file 3 .
104.Pp
105The function pointer type of the
106.Fa cb
107argument is documented in the
108.Xr pem_password_cb 3
109manual page.
110If
111.Fn SSL_CTX_set_default_passwd_cb
112is not called on
113.Fa ctx
114or if it is called with a
115.Fa cb
116argument of
117.Dv NULL ,
118.Xr PEM_def_callback 3
119is used instead.
120.Pp
121.Fn SSL_CTX_set_default_passwd_cb_userdata
122sets a pointer to the
123.Fa userdata
124which will be provided to the password callback on invocation.
125.Pp
126Since the
127.Fa cb
128passed to
129.Fn SSL_CTX_set_default_passwd_cb
130will only be used for reading and decryption and not for writing and
131encryption, the library will only call it with a
132.Fa verify
133argument of 0.
134.Pp
135If an application program only needs to read and decrypt
136one single private key, it can be practical to have the
137callback handle the password dialog interactively.
138This happens by default if neither
139.Fn SSL_CTX_set_default_passwd_cb
140nor
141.Fn SSL_CTX_set_default_passwd_cb_userdata
142is called.
143In that case, the library uses
144.Xr PEM_def_callback 3
145with a
146.Fa userdata
147argument of
148.Dv NULL .
149.Pp
150If several keys have to be handled, it can be practical
151to ask for the password once, for example using
152.Xr UI_UTIL_read_pw_string 3 ,
153then keep it in memory and use it several times by passing a pointer to it to
154.Fn SSL_CTX_set_default_passwd_cb_userdata .
155.Xr PEM_def_callback 3
156is able to handle this case, too, so calling
157.Fn SSL_CTX_set_default_passwd_cb
158is not needed in this case either.
159.Pp
160Other items in PEM formatting (certificates) can also be encrypted; it is
161however atypical, as certificate information is considered public.
162.Sh RETURN VALUES
163.Fn SSL_CTX_get_default_passwd_cb
164returns a function pointer to the password callback currently set in
165.Fa ctx ,
166or
167.Dv NULL
168if none is set.
169.Pp
170.Fn SSL_CTX_get_default_passwd_cb_userdata
171returns a pointer to the userdata currently set in
172.Fa ctx ,
173or
174.Dv NULL
175if none is set.
176.Sh EXAMPLES
177The following example provides a subset of the functionality of
178.Xr PEM_def_callback 3 ,
179except that
180.Xr PEM_def_callback 3
181does not NUL-terminate and copies up to
182.Fa size
183rather than
184.Fa size No \- 1
185bytes.
186It interprets
187.Fa userdata
188as a NUL-terminated string and copies it to the
189.Fa password
190buffer, truncating the copy if it does not fit.
191.Bd -literal
192int
193trivial_passwd_cb(char *password, int size, int verify, void *userdata)
194{
195 strlcpy(password, userdata, size);
196 return strlen(password);
197}
198.Ed
199.Sh SEE ALSO
200.Xr pem_password_cb 3 ,
201.Xr ssl 3 ,
202.Xr SSL_CTX_use_certificate 3
203.Sh HISTORY
204.Fn SSL_CTX_set_default_passwd_cb
205first appeared in SSLeay 0.6.2 and has been available since
206.Ox 2.4 .
207.Pp
208.Fn SSL_CTX_set_default_passwd_cb_userdata
209first appeared in OpenSSL 0.9.4 and has been available since
210.Ox 2.6 .
211.Pp
212.Fn SSL_CTX_get_default_passwd_cb
213and
214.Fn SSL_CTX_get_default_passwd_cb_userdata
215first appeared in OpenSSL 1.1.0 and have been available since
216.Ox 6.3 .
diff --git a/src/lib/libssl/man/SSL_CTX_set_generate_session_id.3 b/src/lib/libssl/man/SSL_CTX_set_generate_session_id.3
deleted file mode 100644
index d85383d776..0000000000
--- a/src/lib/libssl/man/SSL_CTX_set_generate_session_id.3
+++ /dev/null
@@ -1,221 +0,0 @@
1.\" $OpenBSD: SSL_CTX_set_generate_session_id.3,v 1.5 2018/03/22 21:09:18 schwarze Exp $
2.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
5.\" Copyright (c) 2001, 2014 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: March 22 2018 $
52.Dt SSL_CTX_SET_GENERATE_SESSION_ID 3
53.Os
54.Sh NAME
55.Nm SSL_CTX_set_generate_session_id ,
56.Nm SSL_set_generate_session_id ,
57.Nm SSL_has_matching_session_id ,
58.Nm GEN_SESSION_CB
59.Nd manipulate generation of SSL session IDs (server only)
60.Sh SYNOPSIS
61.In openssl/ssl.h
62.Ft typedef int
63.Fo (*GEN_SESSION_CB)
64.Fa "const SSL *ssl"
65.Fa "unsigned char *id"
66.Fa "unsigned int *id_len"
67.Fc
68.Ft int
69.Fn SSL_CTX_set_generate_session_id "SSL_CTX *ctx" "GEN_SESSION_CB cb"
70.Ft int
71.Fn SSL_set_generate_session_id "SSL *ssl" "GEN_SESSION_CB cb"
72.Ft int
73.Fo SSL_has_matching_session_id
74.Fa "const SSL *ssl" "const unsigned char *id" "unsigned int id_len"
75.Fc
76.Sh DESCRIPTION
77.Fn SSL_CTX_set_generate_session_id
78sets the callback function for generating new session ids for SSL/TLS sessions
79for
80.Fa ctx
81to be
82.Fa cb .
83.Pp
84.Fn SSL_set_generate_session_id
85sets the callback function for generating new session ids for SSL/TLS sessions
86for
87.Fa ssl
88to be
89.Fa cb .
90.Pp
91.Fn SSL_has_matching_session_id
92checks, whether a session with id
93.Fa id
94(of length
95.Fa id_len )
96is already contained in the internal session cache
97of the parent context of
98.Fa ssl .
99.Pp
100When a new session is established between client and server,
101the server generates a session id.
102The session id is an arbitrary sequence of bytes.
103The length of the session id is between 1 and 32 bytes.
104The session id is not security critical but must be unique for the server.
105Additionally, the session id is transmitted in the clear when reusing the
106session so it must not contain sensitive information.
107.Pp
108Without a callback being set, an OpenSSL server will generate a unique session
109id from pseudo random numbers of the maximum possible length.
110Using the callback function, the session id can be changed to contain
111additional information like, e.g., a host id in order to improve load balancing
112or external caching techniques.
113.Pp
114The callback function receives a pointer to the memory location to put
115.Fa id
116into and a pointer to the maximum allowed length
117.Fa id_len .
118The buffer at location
119.Fa id
120is only guaranteed to have the size
121.Fa id_len .
122The callback is only allowed to generate a shorter id and reduce
123.Fa id_len ;
124the callback
125.Em must never
126increase
127.Fa id_len
128or write to the location
129.Fa id
130exceeding the given limit.
131.Pp
132The location
133.Fa id
134is filled with 0x00 before the callback is called,
135so the callback may only fill part of the possible length and leave
136.Fa id_len
137untouched while maintaining reproducibility.
138.Pp
139Since the sessions must be distinguished, session ids must be unique.
140Without the callback a random number is used,
141so that the probability of generating the same session id is extremely small
142(2^256 for TLSv1).
143In order to ensure the uniqueness of the generated session id,
144the callback must call
145.Fn SSL_has_matching_session_id
146and generate another id if a conflict occurs.
147If an id conflict is not resolved, the handshake will fail.
148If the application codes, e.g., a unique host id, a unique process number, and
149a unique sequence number into the session id, uniqueness could easily be
150achieved without randomness added (it should however be taken care that
151no confidential information is leaked this way).
152If the application cannot guarantee uniqueness,
153it is recommended to use the maximum
154.Fa id_len
155and fill in the bytes not used to code special information with random data to
156avoid collisions.
157.Pp
158.Fn SSL_has_matching_session_id
159will only query the internal session cache, not the external one.
160Since the session id is generated before the handshake is completed,
161it is not immediately added to the cache.
162If another thread is using the same internal session cache,
163a race condition can occur in that another thread generates the same session id.
164Collisions can also occur when using an external session cache,
165since the external cache is not tested with
166.Fn SSL_has_matching_session_id
167and the same race condition applies.
168.Pp
169The callback must return 0 if it cannot generate a session id for whatever
170reason and return 1 on success.
171.Sh RETURN VALUES
172.Fn SSL_CTX_set_generate_session_id
173and
174.Fn SSL_set_generate_session_id
175always return 1.
176.Pp
177.Fn SSL_has_matching_session_id
178returns 1 if another session with the same id is already in the cache.
179.Sh EXAMPLES
180The callback function listed will generate a session id with the server id
181given, and will fill the rest with pseudo random bytes:
182.Bd -literal
183const char session_id_prefix = "www-18";
184
185#define MAX_SESSION_ID_ATTEMPTS 10
186static int
187generate_session_id(const SSL *ssl, unsigned char *id,
188 unsigned int *id_len)
189{
190 unsigned int count = 0;
191
192 do {
193 RAND_pseudo_bytes(id, *id_len);
194 /*
195 * Prefix the session_id with the required prefix. NB: If
196 * our prefix is too long, clip it \(en but there will be
197 * worse effects anyway, e.g., the server could only
198 * possibly create one session ID (the prefix!) so all
199 * future session negotiations will fail due to conflicts.
200 */
201 memcpy(id, session_id_prefix,
202 (strlen(session_id_prefix) < *id_len) ?
203 strlen(session_id_prefix) : *id_len);
204 } while (SSL_has_matching_session_id(ssl, id, *id_len) &&
205 (++count < MAX_SESSION_ID_ATTEMPTS));
206
207 if (count >= MAX_SESSION_ID_ATTEMPTS)
208 return 0;
209 return 1;
210}
211.Ed
212.Sh SEE ALSO
213.Xr ssl 3 ,
214.Xr SSL_get_version 3
215.Sh HISTORY
216.Fn SSL_CTX_set_generate_session_id ,
217.Fn SSL_set_generate_session_id
218and
219.Fn SSL_has_matching_session_id
220first appeared in OpenSSL 0.9.7 and have been available since
221.Ox 3.2 .
diff --git a/src/lib/libssl/man/SSL_CTX_set_info_callback.3 b/src/lib/libssl/man/SSL_CTX_set_info_callback.3
deleted file mode 100644
index 76eb8bee61..0000000000
--- a/src/lib/libssl/man/SSL_CTX_set_info_callback.3
+++ /dev/null
@@ -1,233 +0,0 @@
1.\" $OpenBSD: SSL_CTX_set_info_callback.3,v 1.4 2018/03/27 17:35:50 schwarze Exp $
2.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
5.\" Copyright (c) 2001, 2005, 2014 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: March 27 2018 $
52.Dt SSL_CTX_SET_INFO_CALLBACK 3
53.Os
54.Sh NAME
55.Nm SSL_CTX_set_info_callback ,
56.Nm SSL_CTX_get_info_callback ,
57.Nm SSL_set_info_callback ,
58.Nm SSL_get_info_callback
59.Nd handle information callback for SSL connections
60.Sh SYNOPSIS
61.In openssl/ssl.h
62.Ft void
63.Fo SSL_CTX_set_info_callback
64.Fa "SSL_CTX *ctx"
65.Fa "void (*callback)(const SSL *ssl, int where, int ret)"
66.Fc
67.Ft void
68.Fo "(*SSL_CTX_get_info_callback(const SSL_CTX *ctx))"
69.Fa "const SSL *ssl"
70.Fa "int where"
71.Fa "int ret"
72.Fc
73.Ft void
74.Fo SSL_set_info_callback
75.Fa "SSL *ssl"
76.Fa "void (*callback)(const SSL *ssl, int where, int ret)"
77.Fc
78.Ft void
79.Fo "(*SSL_get_info_callback(const SSL *ssl))"
80.Fa "const SSL *ssl"
81.Fa "int where"
82.Fa "int ret"
83.Fc
84.Sh DESCRIPTION
85.Fn SSL_CTX_set_info_callback
86sets the
87.Fa callback
88function that can be used to obtain state information for SSL objects created
89from
90.Fa ctx
91during connection setup and use.
92The setting for
93.Fa ctx
94is overridden from the setting for a specific SSL object, if specified.
95When
96.Fa callback
97is
98.Dv NULL ,
99no callback function is used.
100.Pp
101.Fn SSL_set_info_callback
102sets the
103.Fa callback
104function that can be used to
105obtain state information for
106.Fa ssl
107during connection setup and use.
108When
109.Fa callback
110is
111.Dv NULL ,
112the callback setting currently valid for
113.Fa ctx
114is used.
115.Pp
116.Fn SSL_CTX_get_info_callback
117returns a pointer to the currently set information callback function for
118.Fa ctx .
119.Pp
120.Fn SSL_get_info_callback
121returns a pointer to the currently set information callback function for
122.Fa ssl .
123.Pp
124When setting up a connection and during use,
125it is possible to obtain state information from the SSL/TLS engine.
126When set, an information callback function is called whenever the state changes,
127an alert appears, or an error occurs.
128.Pp
129The callback function is called as
130.Fn callback "SSL *ssl" "int where" "int ret" .
131The
132.Fa where
133argument specifies information about where (in which context)
134the callback function was called.
135If
136.Fa ret
137is 0, an error condition occurred.
138If an alert is handled,
139.Dv SSL_CB_ALERT
140is set and
141.Fa ret
142specifies the alert information.
143.Pp
144.Fa where
145is a bitmask made up of the following bits:
146.Bl -tag -width Ds
147.It Dv SSL_CB_LOOP
148Callback has been called to indicate state change inside a loop.
149.It Dv SSL_CB_EXIT
150Callback has been called to indicate error exit of a handshake function.
151(May be soft error with retry option for non-blocking setups.)
152.It Dv SSL_CB_READ
153Callback has been called during read operation.
154.It Dv SSL_CB_WRITE
155Callback has been called during write operation.
156.It Dv SSL_CB_ALERT
157Callback has been called due to an alert being sent or received.
158.It Dv SSL_CB_READ_ALERT
159.It Dv SSL_CB_WRITE_ALERT
160.It Dv SSL_CB_ACCEPT_LOOP
161.It Dv SSL_CB_ACCEPT_EXIT
162.It Dv SSL_CB_CONNECT_LOOP
163.It Dv SSL_CB_CONNECT_EXIT
164.It Dv SSL_CB_HANDSHAKE_START
165Callback has been called because a new handshake is started.
166.It Dv SSL_CB_HANDSHAKE_DONE
167Callback has been called because a handshake is finished.
168.El
169.Pp
170The current state information can be obtained using the
171.Xr SSL_state_string 3
172family of functions.
173.Pp
174The
175.Fa ret
176information can be evaluated using the
177.Xr SSL_alert_type_string 3
178family of functions.
179.Sh RETURN VALUES
180.Fn SSL_CTX_get_info_callback
181and
182.Fn SSL_get_info_callback
183return a pointer to the current callback or
184.Dv NULL
185if none is set.
186.Sh EXAMPLES
187The following example callback function prints state strings,
188information about alerts being handled and error messages to the
189.Va bio_err
190.Vt BIO .
191.Bd -literal
192void
193apps_ssl_info_callback(SSL *s, int where, int ret)
194{
195 const char *str;
196 int w;
197
198 w = where & ~SSL_ST_MASK;
199
200 if (w & SSL_ST_CONNECT)
201 str = "SSL_connect";
202 else if (w & SSL_ST_ACCEPT)
203 str = "SSL_accept";
204 else
205 str = "undefined";
206
207 if (where & SSL_CB_LOOP) {
208 BIO_printf(bio_err, "%s:%s\en", str,
209 SSL_state_string_long(s));
210 } else if (where & SSL_CB_ALERT) {
211 str = (where & SSL_CB_READ) ? "read" : "write";
212 BIO_printf(bio_err, "SSL3 alert %s:%s:%s\en", str,
213 SSL_alert_type_string_long(ret),
214 SSL_alert_desc_string_long(ret));
215 } else if (where & SSL_CB_EXIT) {
216 if (ret == 0)
217 BIO_printf(bio_err, "%s:failed in %s\en",
218 str, SSL_state_string_long(s));
219 else if (ret < 0) {
220 BIO_printf(bio_err, "%s:error in %s\en",
221 str, SSL_state_string_long(s));
222 }
223 }
224}
225.Ed
226.Sh SEE ALSO
227.Xr ssl 3 ,
228.Xr SSL_alert_type_string 3 ,
229.Xr SSL_state_string 3
230.Sh HISTORY
231These functions first appeared in SSLeay 0.6.0
232and have been available since
233.Ox 2.4 .
diff --git a/src/lib/libssl/man/SSL_CTX_set_keylog_callback.3 b/src/lib/libssl/man/SSL_CTX_set_keylog_callback.3
deleted file mode 100644
index 24b8f9992f..0000000000
--- a/src/lib/libssl/man/SSL_CTX_set_keylog_callback.3
+++ /dev/null
@@ -1,56 +0,0 @@
1.\" $OpenBSD: SSL_CTX_set_keylog_callback.3,v 1.3 2024/05/16 08:39:30 tb Exp $
2.\" OpenSSL pod checked up to: 61f805c1 Jan 16 01:01:46 2018 +0800
3.\"
4.\" Copyright (c) 2021 Bob Beck <beck@openbsd.org>
5.\"
6.\" Permission to use, copy, modify, and distribute this software for any
7.\" purpose with or without fee is hereby granted, provided that the above
8.\" copyright notice and this permission notice appear in all copies.
9.\"
10.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17.\"
18.Dd $Mdocdate: May 16 2024 $
19.Dt SSL_CTX_SET_KEYLOG_CALLBACK 3
20.Os
21.Sh NAME
22.Nm SSL_CTX_set_keylog_callback ,
23.Nm SSL_CTX_get_keylog_callback
24.Nd set and get the unused key logging callback
25.Sh SYNOPSIS
26.In openssl/ssl.h
27.Ft typedef void
28.Fo (*SSL_CTX_keylog_cb_func)
29.Fa "const SSL *ssl"
30.Fa "const char *line"
31.Fc
32.Ft void
33.Fn SSL_CTX_set_keylog_callback "SSL_CTX *ctx" "SSL_CTX_keylog_cb_func cb"
34.Ft SSL_CTX_keylog_cb_func
35.Fn SSL_CTX_get_keylog_callback "const SSL_CTX *ctx"
36.Sh DESCRIPTION
37.Fn SSL_CTX_set_keylog_callback
38sets the TLS key logging callback.
39This callback is never called in LibreSSL.
40.Pp
41.Fn SSL_CTX_get_keylog_callback
42retrieves the previously set TLS key logging callback.
43.Pp
44These functions are provided only for compatibility with OpenSSL.
45.Sh RETURN VALUES
46.Fn SSL_CTX_get_keylog_callback
47returns the previously set TLS key logging callback, or
48.Dv NULL
49if no callback has been set.
50.Sh SEE ALSO
51.Xr ssl 3 ,
52.Xr SSL_CTX_new 3
53.Sh HISTORY
54These function first appeared in OpenSSL 1.1.1
55and have been available since
56.Ox 7.1 .
diff --git a/src/lib/libssl/man/SSL_CTX_set_max_cert_list.3 b/src/lib/libssl/man/SSL_CTX_set_max_cert_list.3
deleted file mode 100644
index 89513b1006..0000000000
--- a/src/lib/libssl/man/SSL_CTX_set_max_cert_list.3
+++ /dev/null
@@ -1,154 +0,0 @@
1.\" $OpenBSD: SSL_CTX_set_max_cert_list.3,v 1.6 2019/06/12 09:36:30 schwarze Exp $
2.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
5.\" Copyright (c) 2001 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: June 12 2019 $
52.Dt SSL_CTX_SET_MAX_CERT_LIST 3
53.Os
54.Sh NAME
55.Nm SSL_CTX_set_max_cert_list ,
56.Nm SSL_CTX_get_max_cert_list ,
57.Nm SSL_set_max_cert_list ,
58.Nm SSL_get_max_cert_list
59.Nd manipulate allowed size for the peer's certificate chain
60.Sh SYNOPSIS
61.In openssl/ssl.h
62.Ft long
63.Fn SSL_CTX_set_max_cert_list "SSL_CTX *ctx" "long size"
64.Ft long
65.Fn SSL_CTX_get_max_cert_list "SSL_CTX *ctx"
66.Ft long
67.Fn SSL_set_max_cert_list "SSL *ssl" "long size"
68.Ft long
69.Fn SSL_get_max_cert_list "SSL *ctx"
70.Sh DESCRIPTION
71.Fn SSL_CTX_set_max_cert_list
72sets the maximum size allowed for the peer's certificate chain for all
73.Vt SSL
74objects created from
75.Fa ctx
76to be
77.Fa size
78bytes.
79The
80.Vt SSL
81objects inherit the setting valid for
82.Fa ctx
83at the time
84.Xr SSL_new 3
85is being called.
86.Pp
87.Fn SSL_CTX_get_max_cert_list
88returns the currently set maximum size for
89.Fa ctx .
90.Pp
91.Fn SSL_set_max_cert_list
92sets the maximum size allowed for the peer's certificate chain for
93.Fa ssl
94to be
95.Fa size
96bytes.
97This setting stays valid until a new value is set.
98.Pp
99.Fn SSL_get_max_cert_list
100returns the currently set maximum size for
101.Fa ssl .
102.Pp
103During the handshake process, the peer may send a certificate chain.
104The TLS/SSL standard does not give any maximum size of the certificate chain.
105The OpenSSL library handles incoming data by a dynamically allocated buffer.
106In order to prevent this buffer from growing without bound due to data
107received from a faulty or malicious peer, a maximum size for the certificate
108chain is set.
109.Pp
110The default value for the maximum certificate chain size is 100kB (30kB
111on the 16bit DOS platform).
112This should be sufficient for usual certificate chains
113(OpenSSL's default maximum chain length is 10, see
114.Xr SSL_CTX_set_verify 3 ,
115and certificates without special extensions have a typical size of 1-2kB).
116.Pp
117For special applications it can be necessary to extend the maximum certificate
118chain size allowed to be sent by the peer.
119See for example the work on
120.%T "Internet X.509 Public Key Infrastructure Proxy Certificate Profile"
121and
122.%T "TLS Delegation Protocol"
123at
124.Lk https://www.ietf.org/
125and
126.Lk http://www.globus.org/ .
127.Pp
128Under normal conditions it should never be necessary to set a value smaller
129than the default, as the buffer is handled dynamically and only uses the
130memory actually required by the data sent by the peer.
131.Pp
132If the maximum certificate chain size allowed is exceeded, the handshake will
133fail with a
134.Dv SSL_R_EXCESSIVE_MESSAGE_SIZE
135error.
136.Sh RETURN VALUES
137.Fn SSL_CTX_set_max_cert_list
138and
139.Fn SSL_set_max_cert_list
140return the previously set value.
141.Pp
142.Fn SSL_CTX_get_max_cert_list
143and
144.Fn SSL_get_max_cert_list
145return the currently set value.
146.Sh SEE ALSO
147.Xr ssl 3 ,
148.Xr SSL_CTX_ctrl 3 ,
149.Xr SSL_CTX_set_verify 3 ,
150.Xr SSL_new 3
151.Sh HISTORY
152These functions first appeared in OpenSSL 0.9.7
153and have been available since
154.Ox 3.2 .
diff --git a/src/lib/libssl/man/SSL_CTX_set_min_proto_version.3 b/src/lib/libssl/man/SSL_CTX_set_min_proto_version.3
deleted file mode 100644
index a2597cda83..0000000000
--- a/src/lib/libssl/man/SSL_CTX_set_min_proto_version.3
+++ /dev/null
@@ -1,156 +0,0 @@
1.\" $OpenBSD: SSL_CTX_set_min_proto_version.3,v 1.5 2021/04/15 16:40:32 tb Exp $
2.\" full merge up to: OpenSSL 3edabd3c Sep 14 09:28:39 2017 +0200
3.\"
4.\" This file was written by Kurt Roeckx <kurt@roeckx.be> and
5.\" Christian Heimes <christian@python.org>.
6.\" Copyright (c) 2015, 2017 The OpenSSL Project. All rights reserved.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\"
12.\" 1. Redistributions of source code must retain the above copyright
13.\" notice, this list of conditions and the following disclaimer.
14.\"
15.\" 2. Redistributions in binary form must reproduce the above copyright
16.\" notice, this list of conditions and the following disclaimer in
17.\" the documentation and/or other materials provided with the
18.\" distribution.
19.\"
20.\" 3. All advertising materials mentioning features or use of this
21.\" software must display the following acknowledgment:
22.\" "This product includes software developed by the OpenSSL Project
23.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
24.\"
25.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
26.\" endorse or promote products derived from this software without
27.\" prior written permission. For written permission, please contact
28.\" openssl-core@openssl.org.
29.\"
30.\" 5. Products derived from this software may not be called "OpenSSL"
31.\" nor may "OpenSSL" appear in their names without prior written
32.\" permission of the OpenSSL Project.
33.\"
34.\" 6. Redistributions of any form whatsoever must retain the following
35.\" acknowledgment:
36.\" "This product includes software developed by the OpenSSL Project
37.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
38.\"
39.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
40.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
43.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50.\" OF THE POSSIBILITY OF SUCH DAMAGE.
51.\"
52.Dd $Mdocdate: April 15 2021 $
53.Dt SSL_CTX_SET_MIN_PROTO_VERSION 3
54.Os
55.Sh NAME
56.Nm SSL_CTX_set_min_proto_version ,
57.Nm SSL_CTX_set_max_proto_version ,
58.Nm SSL_CTX_get_min_proto_version ,
59.Nm SSL_CTX_get_max_proto_version ,
60.Nm SSL_set_min_proto_version ,
61.Nm SSL_set_max_proto_version ,
62.Nm SSL_get_min_proto_version ,
63.Nm SSL_get_max_proto_version
64.Nd get and set minimum and maximum supported protocol version
65.Sh SYNOPSIS
66.In openssl/ssl.h
67.Ft int
68.Fo SSL_CTX_set_min_proto_version
69.Fa "SSL_CTX *ctx"
70.Fa "uint16_t version"
71.Fc
72.Ft int
73.Fo SSL_CTX_set_max_proto_version
74.Fa "SSL_CTX *ctx"
75.Fa "uint16_t version"
76.Fc
77.Ft int
78.Fo SSL_CTX_get_min_proto_version
79.Fa "SSL_CTX *ctx"
80.Fc
81.Ft int
82.Fo SSL_CTX_get_max_proto_version
83.Fa "SSL_CTX *ctx"
84.Fc
85.Ft int
86.Fo SSL_set_min_proto_version
87.Fa "SSL *ssl"
88.Fa "uint16_t version"
89.Fc
90.Ft int
91.Fo SSL_set_max_proto_version
92.Fa "SSL *ssl"
93.Fa "uint16_t version"
94.Fc
95.Ft int
96.Fo SSL_get_min_proto_version
97.Fa "SSL *ssl"
98.Fc
99.Ft int
100.Fo SSL_get_max_proto_version
101.Fa "SSL *ssl"
102.Fc
103.Sh DESCRIPTION
104These functions get or set the minimum and maximum supported protocol
105versions for
106.Fa ctx
107or
108.Fa ssl .
109This works in combination with the options set via
110.Xr SSL_CTX_set_options 3
111that also make it possible to disable specific protocol versions.
112Use these functions instead of disabling specific protocol versions.
113.Pp
114Setting the minimum or maximum version to 0 will enable protocol
115versions down to the lowest or up to the highest version supported
116by the library, respectively.
117.Pp
118Currently supported versions are
119.Dv TLS1_VERSION ,
120.Dv TLS1_1_VERSION ,
121and
122.Dv TLS1_2_VERSION
123for TLS and
124.Dv DTLS1_VERSION
125and
126.Dv DTLS1_2_VERSION
127for DTLS.
128.Pp
129In other implementations, these functions may be implemented as macros.
130.Sh RETURN VALUES
131The setter functions return 1 on success or 0 on failure.
132.Pp
133The getter functions return the configured version or 0 if
134.Fa ctx
135or
136.Fa ssl
137has been configured to automatically use the lowest or highest
138version supported by the library.
139.Sh SEE ALSO
140.Xr ssl 3 ,
141.Xr SSL_CTX_new 3 ,
142.Xr SSL_CTX_set_options 3
143.Sh HISTORY
144The setter functions first appeared in BoringSSL in December 2014,
145with shorter names without the
146.Sy proto_
147part.
148Two years later, OpenSSL included them in their 1.1.0 release,
149gratuitously changing the names; Google shrugged and adopted
150the longer names one month later.
151They have been available since
152.Ox 6.2 .
153.Pp
154The getter functions first appeared in OpenSSL 1.1.0g
155and have been available since
156.Ox 6.3 .
diff --git a/src/lib/libssl/man/SSL_CTX_set_mode.3 b/src/lib/libssl/man/SSL_CTX_set_mode.3
deleted file mode 100644
index fca1a977d0..0000000000
--- a/src/lib/libssl/man/SSL_CTX_set_mode.3
+++ /dev/null
@@ -1,204 +0,0 @@
1.\" $OpenBSD: SSL_CTX_set_mode.3,v 1.7 2020/10/08 16:02:38 tb Exp $
2.\" full merge up to: OpenSSL 8671b898 Jun 3 02:48:34 2008 +0000
3.\" selective merge up to: OpenSSL df75c2bf Dec 9 01:02:36 2018 +0100
4.\"
5.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org> and
6.\" Ben Laurie <ben@openssl.org>.
7.\" Copyright (c) 2001, 2008 The OpenSSL Project. All rights reserved.
8.\"
9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions
11.\" are met:
12.\"
13.\" 1. Redistributions of source code must retain the above copyright
14.\" notice, this list of conditions and the following disclaimer.
15.\"
16.\" 2. Redistributions in binary form must reproduce the above copyright
17.\" notice, this list of conditions and the following disclaimer in
18.\" the documentation and/or other materials provided with the
19.\" distribution.
20.\"
21.\" 3. All advertising materials mentioning features or use of this
22.\" software must display the following acknowledgment:
23.\" "This product includes software developed by the OpenSSL Project
24.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
25.\"
26.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
27.\" endorse or promote products derived from this software without
28.\" prior written permission. For written permission, please contact
29.\" openssl-core@openssl.org.
30.\"
31.\" 5. Products derived from this software may not be called "OpenSSL"
32.\" nor may "OpenSSL" appear in their names without prior written
33.\" permission of the OpenSSL Project.
34.\"
35.\" 6. Redistributions of any form whatsoever must retain the following
36.\" acknowledgment:
37.\" "This product includes software developed by the OpenSSL Project
38.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
39.\"
40.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
41.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
42.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
43.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
44.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
45.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
46.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
47.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
49.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
50.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
51.\" OF THE POSSIBILITY OF SUCH DAMAGE.
52.\"
53.Dd $Mdocdate: October 8 2020 $
54.Dt SSL_CTX_SET_MODE 3
55.Os
56.Sh NAME
57.Nm SSL_CTX_set_mode ,
58.Nm SSL_set_mode ,
59.Nm SSL_CTX_clear_mode ,
60.Nm SSL_clear_mode ,
61.Nm SSL_CTX_get_mode ,
62.Nm SSL_get_mode
63.Nd manipulate SSL engine mode
64.Sh SYNOPSIS
65.In openssl/ssl.h
66.Ft long
67.Fn SSL_CTX_set_mode "SSL_CTX *ctx" "long mode"
68.Ft long
69.Fn SSL_set_mode "SSL *ssl" "long mode"
70.Ft long
71.Fn SSL_CTX_clear_mode "SSL_CTX *ctx" "long mode"
72.Ft long
73.Fn SSL_clear_mode "SSL *ssl" "long mode"
74.Ft long
75.Fn SSL_CTX_get_mode "SSL_CTX *ctx"
76.Ft long
77.Fn SSL_get_mode "SSL *ssl"
78.Sh DESCRIPTION
79.Fn SSL_CTX_set_mode
80and
81.Fn SSL_set_mode
82enable the options contained in the bitmask
83.Fa mode
84for the
85.Fa ctx
86or
87.Fa ssl
88object, respectively.
89Options that were already enabled before the call are not disabled.
90.Pp
91.Fn SSL_CTX_clear_mode
92and
93.Fn SSL_clear_mode
94disable the options contained in the bitmask
95.Fa mode
96for the
97.Fa ctx
98or
99.Fa ssl
100object.
101.Pp
102.Fn SSL_CTX_get_mode
103and
104.Fn SSL_get_mode
105return a bitmask representing the options
106that are currently enabled for the
107.Fa ctx
108or
109.Fa ssl
110object.
111.Pp
112The following options are available:
113.Bl -tag -width Ds
114.It Dv SSL_MODE_ENABLE_PARTIAL_WRITE
115Allow
116.Fn SSL_write ... n
117to return
118.Ms r
119with
120.EQ
1210 < r < n
122.EN
123(i.e., report success when just a single record has been written).
124When not set (the default),
125.Xr SSL_write 3
126will only report success once the complete chunk was written.
127Once
128.Xr SSL_write 3
129returns with
130.Ms r ,
131.Ms r
132bytes have been successfully written and the next call to
133.Xr SSL_write 3
134must only send the
135.Ms n \(mi r
136bytes left, imitating the behaviour of
137.Xr write 2 .
138.It Dv SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER
139Make it possible to retry
140.Xr SSL_write 3
141with changed buffer location (the buffer contents must stay the same).
142This is not the default to avoid the misconception that non-blocking
143.Xr SSL_write 3
144behaves like non-blocking
145.Xr write 2 .
146.It Dv SSL_MODE_AUTO_RETRY
147Never bother the application with retries if the transport is blocking.
148If a renegotiation takes place during normal operation, a
149.Xr SSL_read 3
150or
151.Xr SSL_write 3
152would return
153with \(mi1 and indicate the need to retry with
154.Dv SSL_ERROR_WANT_READ .
155In a non-blocking environment applications must be prepared to handle
156incomplete read/write operations.
157In a blocking environment, applications are not always prepared to deal with
158read/write operations returning without success report.
159The flag
160.Dv SSL_MODE_AUTO_RETRY
161will cause read/write operations to only return after the handshake and
162successful completion.
163.It Dv SSL_MODE_RELEASE_BUFFERS
164When we no longer need a read buffer or a write buffer for a given
165.Vt SSL ,
166then release the memory we were using to hold it.
167Using this flag can save around 34k per idle SSL connection.
168This flag has no effect on SSL v2 connections, or on DTLS connections.
169.El
170.Sh RETURN VALUES
171.Fn SSL_CTX_set_mode ,
172.Fn SSL_set_mode ,
173.Fn SSL_CTX_clear_mode ,
174and
175.Fn SSL_clear_mode
176return the new mode bitmask after adding or clearing
177.Fa mode .
178.Pp
179.Fn SSL_CTX_get_mode
180and
181.Fn SSL_get_mode
182return the current bitmask.
183.Sh SEE ALSO
184.Xr ssl 3 ,
185.Xr SSL_CTX_ctrl 3 ,
186.Xr SSL_read 3 ,
187.Xr SSL_write 3
188.Sh HISTORY
189.Fn SSL_CTX_set_mode ,
190.Fn SSL_set_mode ,
191.Fn SSL_CTX_get_mode ,
192and
193.Fn SSL_get_mode
194first appeared in OpenSSL 0.9.4 and have been available since
195.Ox 2.6 .
196.Pp
197.Fn SSL_CTX_clear_mode
198and
199.Fn SSL_clear_mode
200first appeared in OpenSSL 0.9.8m and have been available since
201.Ox 4.9 .
202.Pp
203.Dv SSL_MODE_AUTO_RETRY
204was added in OpenSSL 0.9.6.
diff --git a/src/lib/libssl/man/SSL_CTX_set_msg_callback.3 b/src/lib/libssl/man/SSL_CTX_set_msg_callback.3
deleted file mode 100644
index a27333e6d9..0000000000
--- a/src/lib/libssl/man/SSL_CTX_set_msg_callback.3
+++ /dev/null
@@ -1,183 +0,0 @@
1.\" $OpenBSD: SSL_CTX_set_msg_callback.3,v 1.5 2021/04/15 16:43:27 tb Exp $
2.\" OpenSSL SSL_CTX_set_msg_callback.pod e9b77246 Jan 20 19:58:49 2017 +0100
3.\" OpenSSL SSL_CTX_set_msg_callback.pod b97fdb57 Nov 11 09:33:09 2016 +0100
4.\"
5.\" This file was written by Bodo Moeller <bodo@openssl.org>.
6.\" Copyright (c) 2001, 2014, 2016 The OpenSSL Project. All rights reserved.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\"
12.\" 1. Redistributions of source code must retain the above copyright
13.\" notice, this list of conditions and the following disclaimer.
14.\"
15.\" 2. Redistributions in binary form must reproduce the above copyright
16.\" notice, this list of conditions and the following disclaimer in
17.\" the documentation and/or other materials provided with the
18.\" distribution.
19.\"
20.\" 3. All advertising materials mentioning features or use of this
21.\" software must display the following acknowledgment:
22.\" "This product includes software developed by the OpenSSL Project
23.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
24.\"
25.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
26.\" endorse or promote products derived from this software without
27.\" prior written permission. For written permission, please contact
28.\" openssl-core@openssl.org.
29.\"
30.\" 5. Products derived from this software may not be called "OpenSSL"
31.\" nor may "OpenSSL" appear in their names without prior written
32.\" permission of the OpenSSL Project.
33.\"
34.\" 6. Redistributions of any form whatsoever must retain the following
35.\" acknowledgment:
36.\" "This product includes software developed by the OpenSSL Project
37.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
38.\"
39.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
40.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
43.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50.\" OF THE POSSIBILITY OF SUCH DAMAGE.
51.\"
52.Dd $Mdocdate: April 15 2021 $
53.Dt SSL_CTX_SET_MSG_CALLBACK 3
54.Os
55.Sh NAME
56.Nm SSL_CTX_set_msg_callback ,
57.Nm SSL_CTX_set_msg_callback_arg ,
58.Nm SSL_set_msg_callback ,
59.Nm SSL_set_msg_callback_arg
60.Nd install callback for observing protocol messages
61.Sh SYNOPSIS
62.In openssl/ssl.h
63.Ft void
64.Fo SSL_CTX_set_msg_callback
65.Fa "SSL_CTX *ctx"
66.Fa "void (*cb)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg)"
67.Fc
68.Ft void
69.Fn SSL_CTX_set_msg_callback_arg "SSL_CTX *ctx" "void *arg"
70.Ft void
71.Fo SSL_set_msg_callback
72.Fa "SSL *ssl"
73.Fa "void (*cb)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg)"
74.Fc
75.Ft void
76.Fn SSL_set_msg_callback_arg "SSL *ssl" "void *arg"
77.Sh DESCRIPTION
78.Fn SSL_CTX_set_msg_callback
79or
80.Fn SSL_set_msg_callback
81can be used to define a message callback function
82.Fa cb
83for observing all SSL/TLS protocol messages (such as handshake messages)
84that are received or sent.
85.Fn SSL_CTX_set_msg_callback_arg
86and
87.Fn SSL_set_msg_callback_arg
88can be used to set argument
89.Fa arg
90to the callback function, which is available for arbitrary application use.
91.Pp
92.Fn SSL_CTX_set_msg_callback
93and
94.Fn SSL_CTX_set_msg_callback_arg
95specify default settings that will be copied to new
96.Vt SSL
97objects by
98.Xr SSL_new 3 .
99.Fn SSL_set_msg_callback
100and
101.Fn SSL_set_msg_callback_arg
102modify the actual settings of an
103.Vt SSL
104object.
105Using a
106.Dv NULL
107pointer for
108.Fa cb
109disables the message callback.
110.Pp
111When
112.Fa cb
113is called by the SSL/TLS library for a protocol message,
114the function arguments have the following meaning:
115.Bl -tag -width Ds
116.It Fa write_p
117This flag is 0 when a protocol message has been received and 1 when a protocol
118message has been sent.
119.It Fa version
120The protocol version according to which the protocol message is
121interpreted by the library, such as
122.Dv TLS1_VERSION ,
123.Dv TLS1_1_VERSION ,
124.Dv TLS1_2_VERSION ,
125.Dv DTLS1_VERSION ,
126or
127.Dv DTLS1_2_VERSION .
128.It Fa content_type
129This is one of the
130.Em ContentType
131values defined in the protocol specification
132.Po
133.Dv SSL3_RT_CHANGE_CIPHER_SPEC ,
134.Dv SSL3_RT_ALERT ,
135.Dv SSL3_RT_HANDSHAKE ,
136but never
137.Dv SSL3_RT_APPLICATION_DATA
138because the callback will only be called for protocol messages.
139.Pc
140.It Fa buf , Fa len
141.Fa buf
142points to a buffer containing the protocol message, which consists of
143.Fa len
144bytes.
145The buffer is no longer valid after the callback function has returned.
146.It Fa ssl
147The
148.Vt SSL
149object that received or sent the message.
150.It Fa arg
151The user-defined argument optionally defined by
152.Fn SSL_CTX_set_msg_callback_arg
153or
154.Fn SSL_set_msg_callback_arg .
155.El
156.Pp
157Protocol messages are passed to the callback function after decryption
158and fragment collection where applicable.
159(Thus record boundaries are not visible.)
160.Pp
161If processing a received protocol message results in an error,
162the callback function may not be called.
163For example, the callback function will never see messages that are considered
164too large to be processed.
165.Pp
166Due to automatic protocol version negotiation,
167.Fa version
168is not necessarily the protocol version used by the sender of the message:
169If a TLS 1.0 ClientHello message is received by an SSL 3.0-only server,
170.Fa version
171will be
172.Dv SSL3_VERSION .
173.Sh SEE ALSO
174.Xr ssl 3 ,
175.Xr SSL_new 3
176.Sh HISTORY
177.Fn SSL_CTX_set_msg_callback ,
178.Fn SSL_CTX_set_msg_callback_arg ,
179.Fn SSL_set_msg_callback
180and
181.Fn SSL_set_msg_callback_arg
182first appeared in OpenSSL 0.9.7 and have been available since
183.Ox 3.2 .
diff --git a/src/lib/libssl/man/SSL_CTX_set_num_tickets.3 b/src/lib/libssl/man/SSL_CTX_set_num_tickets.3
deleted file mode 100644
index cb6d7e000a..0000000000
--- a/src/lib/libssl/man/SSL_CTX_set_num_tickets.3
+++ /dev/null
@@ -1,63 +0,0 @@
1.\" $OpenBSD: SSL_CTX_set_num_tickets.3,v 1.2 2021/10/23 17:20:50 schwarze Exp $
2.\" OpenSSL pod checked up to: 5402f96a Sep 11 09:58:52 2021 +0100
3.\"
4.\" Copyright (c) 2021 Bob Beck <beck@openbsd.org>
5.\"
6.\" Permission to use, copy, modify, and distribute this software for any
7.\" purpose with or without fee is hereby granted, provided that the above
8.\" copyright notice and this permission notice appear in all copies.
9.\"
10.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17.\"
18.Dd $Mdocdate: October 23 2021 $
19.Dt SSL_CTX_SET_NUM_TICKETS 3
20.Os
21.Sh NAME
22.Nm SSL_CTX_set_num_tickets ,
23.Nm SSL_CTX_get_num_tickets ,
24.Nm SSL_set_num_tickets ,
25.Nm SSL_get_num_tickets
26.Nd set and get the number of TLS 1.3 session tickets to be sent
27.Sh SYNOPSIS
28.In openssl/ssl.h
29.Ft int
30.Fn SSL_CTX_set_num_tickets "SSL_CTX *ctx" "size_t num_tickets"
31.Ft size_t
32.Fn SSL_CTX_get_num_tickets "const SSL_CTX *ctx"
33.Ft int
34.Fn SSL_set_num_tickets "SSL *ssl" "size_t num_tickets"
35.Ft size_t
36.Fn SSL_get_num_tickets "const SSL *ssl"
37.Sh DESCRIPTION
38These functions set and retrieve
39the configured number of session tickets for
40.Fa ctx
41and
42.Fa ssl ,
43respectively.
44.Pp
45They are provided only for compatibility with OpenSSL
46and have no effect in LibreSSL.
47.Sh RETURN VALUES
48.Fn SSL_CTX_set_num_tickets
49and
50.Fn SSL_set_num_tickets
51always return 1.
52.Pp
53.Fn SSL_CTX_get_num_tickets
54and
55.Fn SSL_get_num_tickets
56return the previously set number of tickets, or 0 if it has not been set.
57.Sh SEE ALSO
58.Xr ssl 3 ,
59.Xr SSL_CTX_new 3
60.Sh HISTORY
61These function first appeared in OpenSSL 1.1.1
62and have been available since
63.Ox 7.1 .
diff --git a/src/lib/libssl/man/SSL_CTX_set_options.3 b/src/lib/libssl/man/SSL_CTX_set_options.3
deleted file mode 100644
index 5df0b07785..0000000000
--- a/src/lib/libssl/man/SSL_CTX_set_options.3
+++ /dev/null
@@ -1,374 +0,0 @@
1.\" $OpenBSD: SSL_CTX_set_options.3,v 1.16 2022/03/31 17:27:18 naddy Exp $
2.\" full merge up to: OpenSSL 7946ab33 Dec 6 17:56:41 2015 +0100
3.\" selective merge up to: OpenSSL edb79c3a Mar 29 10:07:14 2017 +1000
4.\"
5.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>,
6.\" Bodo Moeller <bodo@openssl.org>, and
7.\" Dr. Stephen Henson <steve@openssl.org>.
8.\" Copyright (c) 2001-2003, 2005, 2007, 2009, 2010, 2013-2015
9.\" The OpenSSL Project. All rights reserved.
10.\"
11.\" Redistribution and use in source and binary forms, with or without
12.\" modification, are permitted provided that the following conditions
13.\" are met:
14.\"
15.\" 1. Redistributions of source code must retain the above copyright
16.\" notice, this list of conditions and the following disclaimer.
17.\"
18.\" 2. Redistributions in binary form must reproduce the above copyright
19.\" notice, this list of conditions and the following disclaimer in
20.\" the documentation and/or other materials provided with the
21.\" distribution.
22.\"
23.\" 3. All advertising materials mentioning features or use of this
24.\" software must display the following acknowledgment:
25.\" "This product includes software developed by the OpenSSL Project
26.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
27.\"
28.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
29.\" endorse or promote products derived from this software without
30.\" prior written permission. For written permission, please contact
31.\" openssl-core@openssl.org.
32.\"
33.\" 5. Products derived from this software may not be called "OpenSSL"
34.\" nor may "OpenSSL" appear in their names without prior written
35.\" permission of the OpenSSL Project.
36.\"
37.\" 6. Redistributions of any form whatsoever must retain the following
38.\" acknowledgment:
39.\" "This product includes software developed by the OpenSSL Project
40.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
41.\"
42.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
43.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
44.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
45.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
46.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
47.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
48.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
49.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
50.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
51.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
52.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
53.\" OF THE POSSIBILITY OF SUCH DAMAGE.
54.\"
55.Dd $Mdocdate: March 31 2022 $
56.Dt SSL_CTX_SET_OPTIONS 3
57.Os
58.Sh NAME
59.Nm SSL_CTX_set_options ,
60.Nm SSL_set_options ,
61.Nm SSL_CTX_clear_options ,
62.Nm SSL_clear_options ,
63.Nm SSL_CTX_get_options ,
64.Nm SSL_get_options ,
65.Nm SSL_get_secure_renegotiation_support
66.Nd manipulate SSL options
67.Sh SYNOPSIS
68.In openssl/ssl.h
69.Ft long
70.Fn SSL_CTX_set_options "SSL_CTX *ctx" "long options"
71.Ft long
72.Fn SSL_set_options "SSL *ssl" "long options"
73.Ft long
74.Fn SSL_CTX_clear_options "SSL_CTX *ctx" "long options"
75.Ft long
76.Fn SSL_clear_options "SSL *ssl" "long options"
77.Ft long
78.Fn SSL_CTX_get_options "SSL_CTX *ctx"
79.Ft long
80.Fn SSL_get_options "SSL *ssl"
81.Ft long
82.Fn SSL_get_secure_renegotiation_support "SSL *ssl"
83.Sh DESCRIPTION
84.Fn SSL_CTX_set_options
85adds the options set via bitmask in
86.Fa options
87to
88.Fa ctx .
89Options already set before are not cleared!
90.Pp
91.Fn SSL_set_options
92adds the options set via bitmask in
93.Fa options
94to
95.Fa ssl .
96Options already set before are not cleared!
97.Pp
98.Fn SSL_CTX_clear_options
99clears the options set via bitmask in
100.Fa options
101to
102.Fa ctx .
103.Pp
104.Fn SSL_clear_options
105clears the options set via bitmask in
106.Fa options
107to
108.Fa ssl .
109.Pp
110.Fn SSL_CTX_get_options
111returns the options set for
112.Fa ctx .
113.Pp
114.Fn SSL_get_options
115returns the options set for
116.Fa ssl .
117.Pp
118.Fn SSL_get_secure_renegotiation_support
119indicates whether the peer supports secure renegotiation.
120.Pp
121All these functions are implemented using macros.
122.Pp
123The behaviour of the SSL library can be changed by setting several options.
124The options are coded as bitmasks and can be combined by a bitwise OR
125operation (|).
126.Pp
127.Fn SSL_CTX_set_options
128and
129.Fn SSL_set_options
130affect the (external) protocol behaviour of the SSL library.
131The (internal) behaviour of the API can be changed by using the similar
132.Xr SSL_CTX_set_mode 3
133and
134.Xr SSL_set_mode 3
135functions.
136.Pp
137During a handshake, the option settings of the SSL object are used.
138When a new SSL object is created from a context using
139.Xr SSL_new 3 ,
140the current option setting is copied.
141Changes to
142.Fa ctx
143do not affect already created
144.Vt SSL
145objects.
146.Fn SSL_clear
147does not affect the settings.
148.Pp
149The following
150.Em bug workaround
151options are available:
152.Bl -tag -width Ds
153.It Dv SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS
154Disables a countermeasure against a TLS 1.0 protocol vulnerability
155affecting CBC ciphers, which cannot be handled by some broken SSL
156implementations.
157This option has no effect for connections using other ciphers.
158.It Dv SSL_OP_ALL
159This is currently an alias for
160.Dv SSL_OP_LEGACY_SERVER_CONNECT .
161.El
162.Pp
163It is usually safe to use
164.Dv SSL_OP_ALL
165to enable the bug workaround options if compatibility with somewhat broken
166implementations is desired.
167.Pp
168The following
169.Em modifying
170options are available:
171.Bl -tag -width Ds
172.It Dv SSL_OP_CIPHER_SERVER_PREFERENCE
173When choosing a cipher, use the server's preferences instead of the client
174preferences.
175When not set, the server will always follow the client's preferences.
176When set, the server will choose following its own preferences.
177.It Dv SSL_OP_COOKIE_EXCHANGE
178Turn on Cookie Exchange as described in RFC 4347 Section 4.2.1.
179Only affects DTLS connections.
180.It Dv SSL_OP_LEGACY_SERVER_CONNECT
181Allow legacy insecure renegotiation between OpenSSL and unpatched servers
182.Em only :
183this option is currently set by default.
184See the
185.Sx SECURE RENEGOTIATION
186section for more details.
187.It Dv SSL_OP_NO_DTLSv1
188Do not use the DTLSv1 protocol.
189Deprecated; use
190.Xr SSL_CTX_set_min_proto_version 3
191instead.
192.It Dv SSL_OP_NO_DTLSv1_2
193Do not use the DTLSv1.2 protocol.
194Deprecated; use
195.Xr SSL_CTX_set_min_proto_version 3
196instead.
197.It Dv SSL_OP_NO_QUERY_MTU
198Do not query the MTU.
199Only affects DTLS connections.
200.It Dv SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION
201When performing renegotiation as a server, always start a new session (i.e.,
202session resumption requests are only accepted in the initial handshake).
203This option is not needed for clients.
204.It Dv SSL_OP_NO_TICKET
205Normally clients and servers using TLSv1.2 and earlier will, where possible,
206transparently make use of
207RFC 5077 tickets for stateless session resumption.
208.Pp
209If this option is set, this functionality is disabled and tickets will not be
210used by clients or servers.
211.It Dv SSL_OP_NO_TLSv1
212Do not use the TLSv1.0 protocol.
213Deprecated; use
214.Xr SSL_CTX_set_min_proto_version 3
215instead.
216.It Dv SSL_OP_NO_TLSv1_1
217Do not use the TLSv1.1 protocol.
218Deprecated; use
219.Xr SSL_CTX_set_min_proto_version 3
220instead.
221.It Dv SSL_OP_NO_TLSv1_2
222Do not use the TLSv1.2 protocol.
223Deprecated; use
224.Xr SSL_CTX_set_max_proto_version 3
225instead.
226.El
227.Pp
228The following options used to be supported at some point in the past
229and no longer have any effect:
230.Dv SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION ,
231.Dv SSL_OP_EPHEMERAL_RSA ,
232.Dv SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER ,
233.Dv SSL_OP_MICROSOFT_SESS_ID_BUG ,
234.Dv SSL_OP_NETSCAPE_CA_DN_BUG ,
235.Dv SSL_OP_NETSCAPE_CHALLENGE_BUG ,
236.Dv SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG ,
237.Dv SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG ,
238.Dv SSL_OP_NO_COMPRESSION ,
239.Dv SSL_OP_NO_SSLv2 ,
240.Dv SSL_OP_NO_SSLv3 ,
241.Dv SSL_OP_PKCS1_CHECK_1 ,
242.Dv SSL_OP_PKCS1_CHECK_2 ,
243.Dv SSL_OP_SAFARI_ECDHE_ECDSA_BUG ,
244.Dv SSL_OP_SINGLE_DH_USE ,
245.Dv SSL_OP_SINGLE_ECDH_USE ,
246.Dv SSL_OP_SSLEAY_080_CLIENT_DH_BUG ,
247.Dv SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG ,
248.Dv SSL_OP_TLS_BLOCK_PADDING_BUG ,
249.Dv SSL_OP_TLS_D5_BUG ,
250.Dv SSL_OP_TLS_ROLLBACK_BUG ,
251.Dv SSL_OP_TLSEXT_PADDING .
252.Sh SECURE RENEGOTIATION
253OpenSSL 0.9.8m and later always attempts to use secure renegotiation as
254described in RFC 5746.
255This counters the prefix attack described in CVE-2009-3555 and elsewhere.
256.Pp
257This attack has far-reaching consequences which application writers should be
258aware of.
259In the description below an implementation supporting secure renegotiation is
260referred to as
261.Dq patched .
262A server not supporting secure
263renegotiation is referred to as
264.Dq unpatched .
265.Pp
266The following sections describe the operations permitted by OpenSSL's secure
267renegotiation implementation.
268.Ss Patched client and server
269Connections and renegotiation are always permitted by OpenSSL implementations.
270.Ss Unpatched client and patched OpenSSL server
271The initial connection succeeds but client renegotiation is denied by the
272server with a
273.Em no_renegotiation
274warning alert.
275.Pp
276If the patched OpenSSL server attempts to renegotiate, a fatal
277.Em handshake_failure
278alert is sent.
279This is because the server code may be unaware of the unpatched nature of the
280client.
281.Pp
282Note that a bug in OpenSSL clients earlier than 0.9.8m (all of which
283are unpatched) will result in the connection hanging if it receives a
284.Em no_renegotiation
285alert.
286OpenSSL versions 0.9.8m and later will regard a
287.Em no_renegotiation
288alert as fatal and respond with a fatal
289.Em handshake_failure
290alert.
291This is because the OpenSSL API currently has no provision to indicate to an
292application that a renegotiation attempt was refused.
293.Ss Patched OpenSSL client and unpatched server
294If the option
295.Dv SSL_OP_LEGACY_SERVER_CONNECT
296is set then initial connections and renegotiation between patched OpenSSL
297clients and unpatched servers succeeds.
298If neither option is set then initial connections to unpatched servers will
299fail.
300.Pp
301The option
302.Dv SSL_OP_LEGACY_SERVER_CONNECT
303is currently set by default even though it has security implications:
304otherwise it would be impossible to connect to unpatched servers (i.e., all of
305them initially) and this is clearly not acceptable.
306Renegotiation is permitted because this does not add any additional security
307issues: during an attack clients do not see any renegotiations anyway.
308.Pp
309As more servers become patched, the option
310.Dv SSL_OP_LEGACY_SERVER_CONNECT
311will
312.Em not
313be set by default in a future version of OpenSSL.
314.Pp
315OpenSSL client applications wishing to ensure they can connect to unpatched
316servers should always
317.Em set
318.Dv SSL_OP_LEGACY_SERVER_CONNECT .
319.Pp
320OpenSSL client applications that want to ensure they can
321.Em not
322connect to unpatched servers (and thus avoid any security issues) should always
323.Em clear
324.Dv SSL_OP_LEGACY_SERVER_CONNECT
325using
326.Fn SSL_CTX_clear_options
327or
328.Fn SSL_clear_options .
329.Sh RETURN VALUES
330.Fn SSL_CTX_set_options
331and
332.Fn SSL_set_options
333return the new options bitmask after adding
334.Fa options .
335.Pp
336.Fn SSL_CTX_clear_options
337and
338.Fn SSL_clear_options
339return the new options bitmask after clearing
340.Fa options .
341.Pp
342.Fn SSL_CTX_get_options
343and
344.Fn SSL_get_options
345return the current bitmask.
346.Pp
347.Fn SSL_get_secure_renegotiation_support
348returns 1 is the peer supports secure renegotiation and 0 if it does not.
349.Sh SEE ALSO
350.Xr openssl 1 ,
351.Xr ssl 3 ,
352.Xr SSL_clear 3 ,
353.Xr SSL_CTX_ctrl 3 ,
354.Xr SSL_CTX_set_min_proto_version 3 ,
355.Xr SSL_new 3
356.Sh HISTORY
357.Fn SSL_CTX_set_options
358and
359.Fn SSL_set_options
360first appeared in SSLeay 0.9.0 and have been available since
361.Ox 2.4 .
362.Pp
363.Fn SSL_CTX_get_options
364and
365.Fn SSL_get_options
366first appeared in OpenSSL 0.9.2b and have been available since
367.Ox 2.6 .
368.Pp
369.Fn SSL_CTX_clear_options ,
370.Fn SSL_clear_options ,
371and
372.Fn SSL_get_secure_renegotiation_support
373first appeared in OpenSSL 0.9.8m and have been available since
374.Ox 4.9 .
diff --git a/src/lib/libssl/man/SSL_CTX_set_quiet_shutdown.3 b/src/lib/libssl/man/SSL_CTX_set_quiet_shutdown.3
deleted file mode 100644
index 71463f1eca..0000000000
--- a/src/lib/libssl/man/SSL_CTX_set_quiet_shutdown.3
+++ /dev/null
@@ -1,161 +0,0 @@
1.\" $OpenBSD: SSL_CTX_set_quiet_shutdown.3,v 1.6 2020/03/30 10:28:59 schwarze Exp $
2.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
5.\" Copyright (c) 2001, 2005 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: March 30 2020 $
52.Dt SSL_CTX_SET_QUIET_SHUTDOWN 3
53.Os
54.Sh NAME
55.Nm SSL_CTX_set_quiet_shutdown ,
56.Nm SSL_CTX_get_quiet_shutdown ,
57.Nm SSL_set_quiet_shutdown ,
58.Nm SSL_get_quiet_shutdown
59.Nd manipulate shutdown behaviour
60.Sh SYNOPSIS
61.In openssl/ssl.h
62.Ft void
63.Fn SSL_CTX_set_quiet_shutdown "SSL_CTX *ctx" "int mode"
64.Ft int
65.Fn SSL_CTX_get_quiet_shutdown "const SSL_CTX *ctx"
66.Ft void
67.Fn SSL_set_quiet_shutdown "SSL *ssl" "int mode"
68.Ft int
69.Fn SSL_get_quiet_shutdown "const SSL *ssl"
70.Sh DESCRIPTION
71.Fn SSL_CTX_set_quiet_shutdown
72sets the
73.Dq quiet shutdown
74flag for
75.Fa ctx
76to be
77.Fa mode .
78.Vt SSL
79objects created from
80.Fa ctx
81inherit the
82.Fa mode
83valid at the time
84.Xr SSL_new 3
85is called.
86.Fa mode
87may be 0 or 1.
88.Pp
89.Fn SSL_CTX_get_quiet_shutdown
90returns the
91.Dq quiet shutdown
92setting of
93.Fa ctx .
94.Pp
95.Fn SSL_set_quiet_shutdown
96sets the
97.Dq quiet shutdown
98flag for
99.Fa ssl
100to be
101.Fa mode .
102The setting stays valid until
103.Fa ssl
104is removed with
105.Xr SSL_free 3
106or
107.Fn SSL_set_quiet_shutdown
108is called again.
109It is not changed when
110.Xr SSL_clear 3
111is called.
112.Fa mode
113may be 0 or 1.
114.Pp
115.Fn SSL_get_quiet_shutdown
116returns the
117.Dq quiet shutdown
118setting of
119.Fa ssl .
120.Pp
121Normally when a SSL connection is finished, the parties must send out
122.Dq close notify
123alert messages using
124.Xr SSL_shutdown 3
125for a clean shutdown.
126.Pp
127When setting the
128.Dq quiet shutdown
129flag to 1,
130.Xr SSL_shutdown 3
131will set the internal flags to
132.Dv SSL_SENT_SHUTDOWN Ns | Ns Dv SSL_RECEIVED_SHUTDOWN
133.Po
134.Xr SSL_shutdown 3
135then behaves like
136.Xr SSL_set_shutdown 3
137called with
138.Dv SSL_SENT_SHUTDOWN Ns | Ns Dv SSL_RECEIVED_SHUTDOWN
139.Pc .
140The session is thus considered to be shut down, but no
141.Dq close notify
142alert is sent to the peer.
143This behaviour violates the TLS standard.
144.Pp
145The default is normal shutdown behaviour as described by the TLS standard.
146.Sh RETURN VALUES
147.Fn SSL_CTX_get_quiet_shutdown
148and
149.Fn SSL_get_quiet_shutdown
150return the current setting.
151.Sh SEE ALSO
152.Xr ssl 3 ,
153.Xr SSL_clear 3 ,
154.Xr SSL_free 3 ,
155.Xr SSL_new 3 ,
156.Xr SSL_set_shutdown 3 ,
157.Xr SSL_shutdown 3
158.Sh HISTORY
159These functions first appeared in SSLeay 0.8.1
160and have been available since
161.Ox 2.4 .
diff --git a/src/lib/libssl/man/SSL_CTX_set_read_ahead.3 b/src/lib/libssl/man/SSL_CTX_set_read_ahead.3
deleted file mode 100644
index eae76eb472..0000000000
--- a/src/lib/libssl/man/SSL_CTX_set_read_ahead.3
+++ /dev/null
@@ -1,144 +0,0 @@
1.\" $OpenBSD: SSL_CTX_set_read_ahead.3,v 1.4 2018/03/27 17:35:50 schwarze Exp $
2.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3.\"
4.\" This file was written by Matt Caswell <matt@openssl.org>.
5.\" Copyright (c) 2015, 2016 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: March 27 2018 $
52.Dt SSL_CTX_SET_READ_AHEAD 3
53.Os
54.Sh NAME
55.Nm SSL_CTX_set_read_ahead ,
56.Nm SSL_CTX_get_read_ahead ,
57.Nm SSL_set_read_ahead ,
58.Nm SSL_get_read_ahead ,
59.Nm SSL_CTX_get_default_read_ahead
60.Nd manage whether to read as many input bytes as possible
61.Sh SYNOPSIS
62.In openssl/ssl.h
63.Ft void
64.Fo SSL_CTX_set_read_ahead
65.Fa "SSL_CTX *ctx"
66.Fa "int yes"
67.Fc
68.Ft long
69.Fo SSL_CTX_get_read_ahead
70.Fa "SSL_CTX *ctx"
71.Fc
72.Ft void
73.Fo SSL_set_read_ahead
74.Fa "SSL *s"
75.Fa "int yes"
76.Fc
77.Ft long
78.Fo SSL_get_read_ahead
79.Fa "const SSL *s"
80.Fc
81.Ft long
82.Fo SSL_CTX_get_default_read_ahead
83.Fa "SSL_CTX *ctx"
84.Fc
85.Sh DESCRIPTION
86.Fn SSL_CTX_set_read_ahead
87and
88.Fn SSL_set_read_ahead
89set whether as many input bytes as possible are read for non-blocking
90reads.
91For example if
92.Ar x
93bytes are currently required by OpenSSL, but
94.Ar y
95bytes are available from the underlying BIO (where
96.Ar y No > Ar x ) ,
97then OpenSSL will read all
98.Ar y
99bytes into its buffer (provided that the buffer is large enough) if
100reading ahead is on, or
101.Ar x
102bytes otherwise.
103The parameter
104.Fa yes
105should be 0 to ensure reading ahead is off, or non zero otherwise.
106.Pp
107.Fn SSL_CTX_get_read_ahead
108and
109.Fn SSL_get_read_ahead
110indicate whether reading ahead is set or not.
111.Pp
112.Fn SSL_CTX_get_default_read_ahead
113is identical to
114.Fn SSL_CTX_get_read_ahead .
115.Pp
116These functions are implemented as macros.
117.Pp
118These functions have no effect when used with DTLS.
119.Sh RETURN VALUES
120.Fn SSL_CTX_get_read_ahead
121and
122.Fn SSL_get_read_ahead
123return 0 if reading ahead is off or non-zero otherwise,
124except that the return values are undefined for DTLS.
125.Sh SEE ALSO
126.Xr ssl 3 ,
127.Xr SSL_pending 3
128.Sh HISTORY
129.Fn SSL_set_read_ahead
130and
131.Fn SSL_get_read_ahead
132appeared in SSLeay 0.4 or earlier and have been available since
133.Ox 2.4 .
134.Pp
135.Fn SSL_CTX_set_read_ahead ,
136.Fn SSL_CTX_get_read_ahead ,
137and
138.Fn SSL_CTX_get_default_read_ahead
139first appeared in OpenSSL 0.9.2b and have been available since
140.Ox 2.6 .
141.Sh CAVEATS
142Switching read ahead on can impact the behaviour of the
143.Xr SSL_pending 3
144function.
diff --git a/src/lib/libssl/man/SSL_CTX_set_security_level.3 b/src/lib/libssl/man/SSL_CTX_set_security_level.3
deleted file mode 100644
index 89adb3d65d..0000000000
--- a/src/lib/libssl/man/SSL_CTX_set_security_level.3
+++ /dev/null
@@ -1,159 +0,0 @@
1.\" $OpenBSD: SSL_CTX_set_security_level.3,v 1.2 2025/01/18 10:45:12 tb Exp $
2.\"
3.\" Copyright (c) 2022 Ingo Schwarze <schwarze@openbsd.org>
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd $Mdocdate: January 18 2025 $
18.Dt SSL_CTX_SET_SECURITY_LEVEL 3
19.Os
20.Sh NAME
21.Nm SSL_CTX_set_security_level ,
22.Nm SSL_set_security_level ,
23.Nm SSL_CTX_get_security_level ,
24.Nm SSL_get_security_level
25.Nd change security level for TLS
26.Sh SYNOPSIS
27.In openssl/ssl.h
28.Ft void
29.Fo SSL_CTX_set_security_level
30.Fa "SSL_CTX *ctx"
31.Fa "int level"
32.Fc
33.Ft void
34.Fo SSL_set_security_level
35.Fa "SSL *s"
36.Fa "int level"
37.Fc
38.Ft int
39.Fo SSL_CTX_get_security_level
40.Fa "const SSL_CTX *ctx"
41.Fc
42.Ft int
43.Fo SSL_get_security_level
44.Fa "const SSL *s"
45.Fc
46.Sh DESCRIPTION
47A security level is a set of restrictions on algorithms, key lengths,
48protocol versions, and other features in TLS connections.
49These restrictions apply in addition to those that exist from individually
50selecting supported features, for example ciphers, curves, or algorithms.
51.Pp
52The following table shows properties of the various security levels:
53.Bl -column # sec 15360 ECC TLS SHA1 -offset indent
54.It # Ta sec Ta \0\0RSA Ta ECC Ta TLS Ta MAC
55.It 0 Ta \0\00 Ta \0\0\0\00 Ta \0\00 Ta 1.0 Ta MD5
56.It 1 Ta \080 Ta \01024 Ta 160 Ta 1.0 Ta RC4
57.It 2 Ta 112 Ta \02048 Ta 224 Ta 1.0 Ta
58.It 3 Ta 128 Ta \03072 Ta 256 Ta 1.1 Ta SHA1
59.It 4 Ta 192 Ta \07680 Ta 384 Ta 1.2 Ta
60.It 5 Ta 256 Ta 15360 Ta 512 Ta 1.2 Ta
61.El
62.Pp
63The meaning of the columns is as follows:
64.Pp
65.Bl -tag -width features -compact
66.It #
67The number of the
68.Fa level .
69.It sec
70The minimum security strength measured in bits, which is approximately
71the binary logarithm of the number of operations an attacker has
72to perform in order to break a cryptographic key.
73This minimum strength is enforced for all relevant parameters
74including cipher suite encryption algorithms, ECC curves, signature
75algorithms, DH parameter sizes, and certificate algorithms and key
76sizes.
77See SP800-57 below
78.Sx SEE ALSO
79for details on individual algorithms.
80.It RSA
81The minimum key length in bits for the RSA and DH algorithms.
82.It ECC
83The minimum key length in bits for ECC algorithms.
84.It TLS
85The minimum TLS protocol version.
86.It MAC
87Cipher suites using the given MACs are allowed on this level
88and on lower levels, but not on higher levels.
89.El
90.Pp
91Level 0 is only provided for backward compatibility and permits everything.
92.Pp
93Level 3 and higher disable support for session tickets
94and only accept cipher suites that provide forward secrecy.
95.Pp
96The functions
97.Fn SSL_CTX_set_security_level
98and
99.Fn SSL_set_security_level
100choose the security
101.Fa level
102for
103.Fa ctx
104or
105.Fa s ,
106respectively.
107If not set, security level 1 is used.
108.Pp
109.Xr SSL_CTX_new 3
110initializes the security level of the new object to 1.
111.Pp
112.Xr SSL_new 3
113and
114.Xr SSL_set_SSL_CTX 3
115copy the security level from the context to the SSL object.
116.Pp
117.Xr SSL_dup 3
118copies the security level from the old to the new object.
119.Sh RETURN VALUES
120.Fn SSL_CTX_get_security_level
121and
122.Fn SSL_get_security_level
123return the security level configured in
124.Fa ctx
125or
126.Fa s ,
127respectively.
128.Sh SEE ALSO
129.Xr EVP_PKEY_security_bits 3 ,
130.Xr RSA_security_bits 3 ,
131.Xr ssl 3 ,
132.Xr SSL_CTX_new 3 ,
133.Xr SSL_new 3
134.Rs
135.%A Elaine Barker
136.%T Recommendation for Key Management
137.%I U.S. National Institute of Standards and Technology
138.%R NIST Special Publication 800-57 Part 1 Revision 5
139.%U https://doi.org/10.6028/NIST.SP.800-57pt1r5
140.%C Gaithersburg, MD
141.%D May 2020
142.Re
143.Sh HISTORY
144These functions first appeared in OpenSSL 1.1.0
145and have been available since
146.Ox 7.2 .
147.Sh CAVEATS
148Applications which do not check the return values
149of configuration functions will misbehave.
150For example, if an application does not check the return value
151after trying to set a certificate and the certificate is rejected
152because of the security level, the application may behave as if
153no certificate had been provided at all.
154.Pp
155While some restrictions may be handled gracefully by negotiations
156between the client and the server, other restrictions may be
157fatal and abort the TLS handshake.
158For example, this can happen if the peer certificate contains a key
159that is too short or if the DH parameter size is too small.
diff --git a/src/lib/libssl/man/SSL_CTX_set_session_cache_mode.3 b/src/lib/libssl/man/SSL_CTX_set_session_cache_mode.3
deleted file mode 100644
index 1fe67b2a7e..0000000000
--- a/src/lib/libssl/man/SSL_CTX_set_session_cache_mode.3
+++ /dev/null
@@ -1,198 +0,0 @@
1.\" $OpenBSD: SSL_CTX_set_session_cache_mode.3,v 1.7 2019/06/12 09:36:30 schwarze Exp $
2.\" OpenSSL 67adf0a7 Dec 25 19:58:38 2016 +0100
3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org> and
5.\" Geoff Thorpe <geoff@openssl.org>.
6.\" Copyright (c) 2001, 2002 The OpenSSL Project. All rights reserved.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\"
12.\" 1. Redistributions of source code must retain the above copyright
13.\" notice, this list of conditions and the following disclaimer.
14.\"
15.\" 2. Redistributions in binary form must reproduce the above copyright
16.\" notice, this list of conditions and the following disclaimer in
17.\" the documentation and/or other materials provided with the
18.\" distribution.
19.\"
20.\" 3. All advertising materials mentioning features or use of this
21.\" software must display the following acknowledgment:
22.\" "This product includes software developed by the OpenSSL Project
23.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
24.\"
25.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
26.\" endorse or promote products derived from this software without
27.\" prior written permission. For written permission, please contact
28.\" openssl-core@openssl.org.
29.\"
30.\" 5. Products derived from this software may not be called "OpenSSL"
31.\" nor may "OpenSSL" appear in their names without prior written
32.\" permission of the OpenSSL Project.
33.\"
34.\" 6. Redistributions of any form whatsoever must retain the following
35.\" acknowledgment:
36.\" "This product includes software developed by the OpenSSL Project
37.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
38.\"
39.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
40.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
43.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50.\" OF THE POSSIBILITY OF SUCH DAMAGE.
51.\"
52.Dd $Mdocdate: June 12 2019 $
53.Dt SSL_CTX_SET_SESSION_CACHE_MODE 3
54.Os
55.Sh NAME
56.Nm SSL_CTX_set_session_cache_mode ,
57.Nm SSL_CTX_get_session_cache_mode
58.Nd enable/disable session caching
59.Sh SYNOPSIS
60.In openssl/ssl.h
61.Ft long
62.Fn SSL_CTX_set_session_cache_mode "SSL_CTX ctx" "long mode"
63.Ft long
64.Fn SSL_CTX_get_session_cache_mode "SSL_CTX ctx"
65.Sh DESCRIPTION
66.Fn SSL_CTX_set_session_cache_mode
67enables/disables session caching by setting the operational mode for
68.Ar ctx
69to
70.Ar mode .
71.Pp
72.Fn SSL_CTX_get_session_cache_mode
73returns the currently used cache mode.
74.Pp
75The OpenSSL library can store/retrieve SSL/TLS sessions for later reuse.
76The sessions can be held in memory for each
77.Fa ctx ,
78if more than one
79.Vt SSL_CTX
80object is being maintained, the sessions are unique for each
81.Vt SSL_CTX
82object.
83.Pp
84In order to reuse a session, a client must send the session's id to the server.
85It can only send exactly one id.
86The server then either agrees to reuse the session or it starts a full
87handshake (to create a new session).
88.Pp
89A server will look up the session in its internal session storage.
90If the session is not found in internal storage or lookups for the internal
91storage have been deactivated
92.Pq Dv SSL_SESS_CACHE_NO_INTERNAL_LOOKUP ,
93the server will try the external storage if available.
94.Pp
95Since a client may try to reuse a session intended for use in a different
96context, the session id context must be set by the server (see
97.Xr SSL_CTX_set_session_id_context 3 ) .
98.Pp
99The following session cache modes and modifiers are available:
100.Bl -tag -width Ds
101.It Dv SSL_SESS_CACHE_OFF
102No session caching for client or server takes place.
103.It Dv SSL_SESS_CACHE_CLIENT
104Client sessions are added to the session cache.
105As there is no reliable way for the OpenSSL library to know whether a session
106should be reused or which session to choose (due to the abstract BIO layer the
107SSL engine does not have details about the connection),
108the application must select the session to be reused by using the
109.Xr SSL_set_session 3
110function.
111This option is not activated by default.
112.It Dv SSL_SESS_CACHE_SERVER
113Server sessions are added to the session cache.
114When a client proposes a session to be reused, the server looks for the
115corresponding session in (first) the internal session cache (unless
116.Dv SSL_SESS_CACHE_NO_INTERNAL_LOOKUP
117is set), then (second) in the external cache if available.
118If the session is found, the server will try to reuse the session.
119This is the default.
120.It Dv SSL_SESS_CACHE_BOTH
121Enable both
122.Dv SSL_SESS_CACHE_CLIENT
123and
124.Dv SSL_SESS_CACHE_SERVER
125at the same time.
126.It Dv SSL_SESS_CACHE_NO_AUTO_CLEAR
127Normally the session cache is checked for expired sessions every 255
128connections using the
129.Xr SSL_CTX_flush_sessions 3
130function.
131Since this may lead to a delay which cannot be controlled,
132the automatic flushing may be disabled and
133.Xr SSL_CTX_flush_sessions 3
134can be called explicitly by the application.
135.It Dv SSL_SESS_CACHE_NO_INTERNAL_LOOKUP
136By setting this flag, session-resume operations in an SSL/TLS server will not
137automatically look up sessions in the internal cache,
138even if sessions are automatically stored there.
139If external session caching callbacks are in use,
140this flag guarantees that all lookups are directed to the external cache.
141As automatic lookup only applies for SSL/TLS servers,
142the flag has no effect on clients.
143.It Dv SSL_SESS_CACHE_NO_INTERNAL_STORE
144Depending on the presence of
145.Dv SSL_SESS_CACHE_CLIENT
146and/or
147.Dv SSL_SESS_CACHE_SERVER ,
148sessions negotiated in an SSL/TLS handshake may be cached for possible reuse.
149Normally a new session is added to the internal cache as well as any external
150session caching (callback) that is configured for the
151.Vt SSL_CTX .
152This flag will prevent sessions being stored in the internal cache
153(though the application can add them manually using
154.Xr SSL_CTX_add_session 3 ) .
155Note:
156in any SSL/TLS servers where external caching is configured, any successful
157session lookups in the external cache (e.g., for session-resume requests) would
158normally be copied into the local cache before processing continues \(en this
159flag prevents these additions to the internal cache as well.
160.It Dv SSL_SESS_CACHE_NO_INTERNAL
161Enable both
162.Dv SSL_SESS_CACHE_NO_INTERNAL_LOOKUP
163and
164.Dv SSL_SESS_CACHE_NO_INTERNAL_STORE
165at the same time.
166.El
167.Pp
168The default mode is
169.Dv SSL_SESS_CACHE_SERVER .
170.Sh RETURN VALUES
171.Fn SSL_CTX_set_session_cache_mode
172returns the previously set cache mode.
173.Pp
174.Fn SSL_CTX_get_session_cache_mode
175returns the currently set cache mode.
176.Sh SEE ALSO
177.Xr ssl 3 ,
178.Xr SSL_CTX_add_session 3 ,
179.Xr SSL_CTX_ctrl 3 ,
180.Xr SSL_CTX_flush_sessions 3 ,
181.Xr SSL_CTX_sess_number 3 ,
182.Xr SSL_CTX_sess_set_cache_size 3 ,
183.Xr SSL_CTX_sess_set_get_cb 3 ,
184.Xr SSL_CTX_set_session_id_context 3 ,
185.Xr SSL_CTX_set_timeout 3 ,
186.Xr SSL_session_reused 3 ,
187.Xr SSL_set_session 3
188.Sh HISTORY
189.Fn SSL_CTX_set_session_cache_mode
190and
191.Fn SSL_CTX_get_session_cache_mode
192first appeared in SSLeay 0.6.1 and have been available since
193.Ox 2.4 .
194.Pp
195.Dv SSL_SESS_CACHE_NO_INTERNAL_STORE
196and
197.Dv SSL_SESS_CACHE_NO_INTERNAL
198were introduced in OpenSSL 0.9.6h.
diff --git a/src/lib/libssl/man/SSL_CTX_set_session_id_context.3 b/src/lib/libssl/man/SSL_CTX_set_session_id_context.3
deleted file mode 100644
index 06fd9348ae..0000000000
--- a/src/lib/libssl/man/SSL_CTX_set_session_id_context.3
+++ /dev/null
@@ -1,160 +0,0 @@
1.\" $OpenBSD: SSL_CTX_set_session_id_context.3,v 1.6 2019/06/08 15:25:43 schwarze Exp $
2.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
5.\" Copyright (c) 2001, 2004 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: June 8 2019 $
52.Dt SSL_CTX_SET_SESSION_ID_CONTEXT 3
53.Os
54.Sh NAME
55.Nm SSL_CTX_set_session_id_context ,
56.Nm SSL_set_session_id_context
57.Nd set context within which session can be reused (server side only)
58.Sh SYNOPSIS
59.In openssl/ssl.h
60.Ft int
61.Fo SSL_CTX_set_session_id_context
62.Fa "SSL_CTX *ctx"
63.Fa "const unsigned char *sid_ctx"
64.Fa "unsigned int sid_ctx_len"
65.Fc
66.Ft int
67.Fo SSL_set_session_id_context
68.Fa "SSL *ssl"
69.Fa "const unsigned char *sid_ctx"
70.Fa "unsigned int sid_ctx_len"
71.Fc
72.Sh DESCRIPTION
73.Fn SSL_CTX_set_session_id_context
74sets the context
75.Fa sid_ctx
76of length
77.Fa sid_ctx_len
78within which a session can be reused for the
79.Fa ctx
80object.
81.Pp
82.Fn SSL_set_session_id_context
83sets the context
84.Fa sid_ctx
85of length
86.Fa sid_ctx_len
87within which a session can be reused for the
88.Fa ssl
89object.
90.Pp
91Sessions are generated within a certain context.
92When exporting/importing sessions with
93.Xr i2d_SSL_SESSION 3
94and
95.Xr d2i_SSL_SESSION 3 ,
96it would be possible to re-import a session generated from another context
97(e.g., another application), which might lead to malfunctions.
98Therefore each application must set its own session id context
99.Fa sid_ctx
100which is used to distinguish the contexts and is stored in exported sessions.
101The
102.Fa sid_ctx
103can be any kind of binary data with a given length; it is therefore possible
104to use, for instance, the name of the application, the hostname, the service
105name...
106.Pp
107The session id context becomes part of the session.
108The session id context is set by the SSL/TLS server.
109The
110.Fn SSL_CTX_set_session_id_context
111and
112.Fn SSL_set_session_id_context
113functions are therefore only useful on the server side.
114.Pp
115OpenSSL clients will check the session id context returned by the server when
116reusing a session.
117.Pp
118The maximum length of the
119.Fa sid_ctx
120is limited to
121.Dv SSL_MAX_SSL_SESSION_ID_LENGTH .
122.Sh WARNINGS
123If the session id context is not set on an SSL/TLS server and client
124certificates are used, stored sessions will not be reused but a fatal error
125will be flagged and the handshake will fail.
126.Pp
127If a server returns a different session id context to an OpenSSL client
128when reusing a session, an error will be flagged and the handshake will
129fail.
130OpenSSL servers will always return the correct session id context,
131as an OpenSSL server checks the session id context itself before reusing
132a session as described above.
133.Sh RETURN VALUES
134.Fn SSL_CTX_set_session_id_context
135and
136.Fn SSL_set_session_id_context
137return the following values:
138.Bl -tag -width Ds
139.It 0
140The length
141.Fa sid_ctx_len
142of the session id context
143.Fa sid_ctx
144exceeded
145the maximum allowed length of
146.Dv SSL_MAX_SSL_SESSION_ID_LENGTH .
147The error is logged to the error stack.
148.It 1
149The operation succeeded.
150.El
151.Sh SEE ALSO
152.Xr ssl 3 ,
153.Xr SSL_SESSION_set1_id_context 3
154.Sh HISTORY
155.Fn SSL_set_session_id_context
156first appeared in OpenSSL 0.9.2b.
157.Fn SSL_CTX_set_session_id_context
158first appeared in OpenSSL 0.9.3.
159Both functions have been available since
160.Ox 2.6 .
diff --git a/src/lib/libssl/man/SSL_CTX_set_ssl_version.3 b/src/lib/libssl/man/SSL_CTX_set_ssl_version.3
deleted file mode 100644
index b1bdb92bb0..0000000000
--- a/src/lib/libssl/man/SSL_CTX_set_ssl_version.3
+++ /dev/null
@@ -1,146 +0,0 @@
1.\" $OpenBSD: SSL_CTX_set_ssl_version.3,v 1.5 2021/05/11 19:48:56 tb Exp $
2.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
5.\" Copyright (c) 2000, 2001, 2005 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: May 11 2021 $
52.Dt SSL_CTX_SET_SSL_VERSION 3
53.Os
54.Sh NAME
55.Nm SSL_CTX_set_ssl_version ,
56.Nm SSL_set_ssl_method ,
57.Nm SSL_CTX_get_ssl_method ,
58.Nm SSL_get_ssl_method
59.Nd choose a new TLS/SSL method
60.Sh SYNOPSIS
61.In openssl/ssl.h
62.Ft int
63.Fn SSL_CTX_set_ssl_version "SSL_CTX *ctx" "const SSL_METHOD *method"
64.Ft int
65.Fn SSL_set_ssl_method "SSL *s" "const SSL_METHOD *method"
66.Ft const SSL_METHOD *
67.Fn SSL_CTX_get_ssl_method "SSL_CTX *ctx"
68.Ft const SSL_METHOD *
69.Fn SSL_get_ssl_method "SSL *ssl"
70.Sh DESCRIPTION
71.Fn SSL_CTX_set_ssl_version
72sets a new default TLS/SSL
73.Fa method
74for
75.Vt SSL
76objects newly created from this
77.Fa ctx .
78.Vt SSL
79objects already created with
80.Xr SSL_new 3
81are not affected, except when
82.Xr SSL_clear 3
83is called.
84.Pp
85.Fn SSL_set_ssl_method
86sets a new TLS/SSL
87.Fa method
88for a particular
89.Vt SSL
90object
91.Fa s .
92It may be reset when
93.Xr SSL_clear 3
94is called.
95.Pp
96.Fn SSL_CTX_get_ssl_method
97and
98.Fn SSL_get_ssl_method
99return a function pointer to the TLS/SSL method set in
100.Fa ctx
101and
102.Fa ssl ,
103respectively.
104.Pp
105The available
106.Fa method
107choices are described in
108.Xr SSL_CTX_new 3 .
109.Pp
110When
111.Xr SSL_clear 3
112is called and no session is connected to an
113.Vt SSL
114object, the method of the
115.Vt SSL
116object is reset to the method currently set in the corresponding
117.Vt SSL_CTX
118object.
119.Sh RETURN VALUES
120The following return values can occur for
121.Fn SSL_CTX_set_ssl_version
122and
123.Fn SSL_set_ssl_method :
124.Bl -tag -width Ds
125.It 0
126The new choice failed.
127Check the error stack to find out the reason.
128.It 1
129The operation succeeded.
130.El
131.Sh SEE ALSO
132.Xr ssl 3 ,
133.Xr SSL_clear 3 ,
134.Xr SSL_CTX_new 3 ,
135.Xr SSL_new 3 ,
136.Xr SSL_set_connect_state 3
137.Sh HISTORY
138.Fn SSL_CTX_set_ssl_version ,
139.Fn SSL_set_ssl_method ,
140and
141.Fn SSL_get_ssl_method
142first appeared in SSLeay 0.8.0 and have been available since
143.Ox 2.4 .
144.Fn SSL_CTX_get_ssl_method
145first appeared in OpenSSL 1.1.0 and has been available since
146.Ox 7.0 .
diff --git a/src/lib/libssl/man/SSL_CTX_set_timeout.3 b/src/lib/libssl/man/SSL_CTX_set_timeout.3
deleted file mode 100644
index ab99e2016e..0000000000
--- a/src/lib/libssl/man/SSL_CTX_set_timeout.3
+++ /dev/null
@@ -1,118 +0,0 @@
1.\" $OpenBSD: SSL_CTX_set_timeout.3,v 1.4 2018/03/27 17:35:50 schwarze Exp $
2.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
5.\" Copyright (c) 2001 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: March 27 2018 $
52.Dt SSL_CTX_SET_TIMEOUT 3
53.Os
54.Sh NAME
55.Nm SSL_CTX_set_timeout ,
56.Nm SSL_CTX_get_timeout
57.Nd manipulate timeout values for session caching
58.Sh SYNOPSIS
59.In openssl/ssl.h
60.Ft long
61.Fn SSL_CTX_set_timeout "SSL_CTX *ctx" "long t"
62.Ft long
63.Fn SSL_CTX_get_timeout "SSL_CTX *ctx"
64.Sh DESCRIPTION
65.Fn SSL_CTX_set_timeout
66sets the timeout for newly created sessions for
67.Fa ctx
68to
69.Fa t .
70The timeout value
71.Fa t
72must be given in seconds.
73.Pp
74.Fn SSL_CTX_get_timeout
75returns the currently set timeout value for
76.Fa ctx .
77.Pp
78Whenever a new session is created, it is assigned a maximum lifetime.
79This lifetime is specified by storing the creation time of the session and the
80timeout value valid at this time.
81If the actual time is later than creation time plus timeout,
82the session is not reused.
83.Pp
84Due to this realization, all sessions behave according to the timeout value
85valid at the time of the session negotiation.
86Changes of the timeout value do not affect already established sessions.
87.Pp
88The expiration time of a single session can be modified using the
89.Xr SSL_SESSION_get_time 3
90family of functions.
91.Pp
92Expired sessions are removed from the internal session cache, whenever
93.Xr SSL_CTX_flush_sessions 3
94is called, either directly by the application or automatically (see
95.Xr SSL_CTX_set_session_cache_mode 3 ) .
96.Pp
97The default value for session timeout is decided on a per-protocol basis; see
98.Xr SSL_get_default_timeout 3 .
99All currently supported protocols have the same default timeout value of 300
100seconds.
101.Sh RETURN VALUES
102.Fn SSL_CTX_set_timeout
103returns the previously set timeout value.
104.Pp
105.Fn SSL_CTX_get_timeout
106returns the currently set timeout value.
107.Sh SEE ALSO
108.Xr ssl 3 ,
109.Xr SSL_CTX_flush_sessions 3 ,
110.Xr SSL_CTX_set_session_cache_mode 3 ,
111.Xr SSL_get_default_timeout 3 ,
112.Xr SSL_SESSION_get_time 3
113.Sh HISTORY
114.Fn SSL_CTX_set_timeout
115and
116.Fn SSL_CTX_get_timeout
117first appeared in SSLeay 0.6.1 and have been available since
118.Ox 2.4 .
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
deleted file mode 100644
index 2b54406de8..0000000000
--- a/src/lib/libssl/man/SSL_CTX_set_tlsext_servername_callback.3
+++ /dev/null
@@ -1,247 +0,0 @@
1.\" $OpenBSD: SSL_CTX_set_tlsext_servername_callback.3,v 1.6 2021/09/01 13:56:03 schwarze Exp $
2.\" full merge up to: OpenSSL 190b9a03 Jun 28 15:46:13 2017 +0800
3.\" selective merge up to: OpenSSL 6328d367 Jul 4 21:58:30 2020 +0200
4.\"
5.\" This file was written by Jon Spillett <jon.spillett@oracle.com>,
6.\" Paul Yang <yang dot yang at baishancloud dot com>, and
7.\" Matt Caswell <matt@openssl.org>.
8.\" Copyright (c) 2017, 2019 The OpenSSL Project. All rights reserved.
9.\"
10.\" Redistribution and use in source and binary forms, with or without
11.\" modification, are permitted provided that the following conditions
12.\" are met:
13.\"
14.\" 1. Redistributions of source code must retain the above copyright
15.\" notice, this list of conditions and the following disclaimer.
16.\"
17.\" 2. Redistributions in binary form must reproduce the above copyright
18.\" notice, this list of conditions and the following disclaimer in
19.\" the documentation and/or other materials provided with the
20.\" distribution.
21.\"
22.\" 3. All advertising materials mentioning features or use of this
23.\" software must display the following acknowledgment:
24.\" "This product includes software developed by the OpenSSL Project
25.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
26.\"
27.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
28.\" endorse or promote products derived from this software without
29.\" prior written permission. For written permission, please contact
30.\" openssl-core@openssl.org.
31.\"
32.\" 5. Products derived from this software may not be called "OpenSSL"
33.\" nor may "OpenSSL" appear in their names without prior written
34.\" permission of the OpenSSL Project.
35.\"
36.\" 6. Redistributions of any form whatsoever must retain the following
37.\" acknowledgment:
38.\" "This product includes software developed by the OpenSSL Project
39.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
40.\"
41.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
42.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
44.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
45.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
46.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
47.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
48.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
49.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
50.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
51.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
52.\" OF THE POSSIBILITY OF SUCH DAMAGE.
53.\"
54.Dd $Mdocdate: September 1 2021 $
55.Dt SSL_CTX_SET_TLSEXT_SERVERNAME_CALLBACK 3
56.Os
57.Sh NAME
58.Nm SSL_CTX_set_tlsext_servername_callback ,
59.Nm SSL_CTX_set_tlsext_servername_arg ,
60.Nm SSL_get_servername_type ,
61.Nm SSL_get_servername ,
62.Nm SSL_set_tlsext_host_name
63.Nd handle server name indication (SNI)
64.Sh SYNOPSIS
65.In openssl/ssl.h
66.Ft long
67.Fo SSL_CTX_set_tlsext_servername_callback
68.Fa "SSL_CTX *ctx"
69.Fa "int (*cb)(SSL *ssl, int *alert, void *arg)"
70.Fc
71.Ft long
72.Fo SSL_CTX_set_tlsext_servername_arg
73.Fa "SSL_CTX *ctx"
74.Fa "void *arg"
75.Fc
76.Ft const char *
77.Fo SSL_get_servername
78.Fa "const SSL *ssl"
79.Fa "const int type"
80.Fc
81.Ft int
82.Fo SSL_get_servername_type
83.Fa "const SSL *ssl"
84.Fc
85.Ft int
86.Fo SSL_set_tlsext_host_name
87.Fa "const SSL *ssl"
88.Fa "const char *name"
89.Fc
90.Sh DESCRIPTION
91.Fn SSL_CTX_set_tlsext_servername_callback
92sets the application callback
93.Fa cb
94used by a server to perform any actions or configuration required based
95on the servername extension received in the incoming connection.
96Like the ALPN callback, it is executed during Client Hello processing.
97When
98.Fa cb
99is
100.Dv NULL ,
101SNI is not used.
102.Pp
103The servername callback should return one of the following values:
104.Bl -tag -width Ds
105.It Dv SSL_TLSEXT_ERR_OK
106This is used to indicate that the servername requested by the client
107has been accepted.
108Typically a server will call
109.Xr SSL_set_SSL_CTX 3
110in the callback to set up a different configuration
111for the selected servername in this case.
112.It Dv SSL_TLSEXT_ERR_ALERT_FATAL
113In this case the servername requested by the client is not accepted
114and the handshake will be aborted.
115The value of the alert to be used should be stored in the location
116pointed to by the
117.Fa alert
118parameter to the callback.
119By default this value is initialised to
120.Dv SSL_AD_UNRECOGNIZED_NAME .
121.It Dv SSL_TLSEXT_ERR_ALERT_WARNING
122If this value is returned, then the servername is not accepted by the server.
123However, the handshake will continue and send a warning alert instead.
124The value of the alert should be stored in the location pointed to by the
125.Fa alert
126parameter as for
127.Dv SSL_TLSEXT_ERR_ALERT_FATAL
128above.
129Note that TLSv1.3 does not support warning alerts, so if TLSv1.3 has
130been negotiated then this return value is treated the same way as
131.Dv SSL_TLSEXT_ERR_NOACK .
132.It Dv SSL_TLSEXT_ERR_NOACK
133This return value indicates
134that the servername is not accepted by the server.
135No alerts are sent
136and the server will not acknowledge the requested servername.
137.El
138.Pp
139.Fn SSL_CTX_set_tlsext_servername_arg
140sets a context-specific argument to be passed into the callback via the
141.Fa arg
142parameter for
143.Fa ctx .
144.ig end_of_get_servername_details
145.\" I would suggest to comment out that second wall text of dubious
146.\" usefulness and see if we can meet all these documented API
147.\" requirements in the future or decide that it's not worth the
148.\" effort. -- tb@ Aug 30, 2021
149.Pp
150The behaviour of
151.Fn SSL_get_servername
152depends on a number of different factors.
153In particular note that in TLSv1.3,
154the servername is negotiated in every handshake.
155In TLSv1.2 the servername is only negotiated on initial handshakes
156and not on resumption handshakes.
157.Bl -tag -width Ds
158.It On the client, before the handshake:
159If a servername has been set via a call to
160.Fn SSL_set_tlsext_host_name ,
161then it will return that servername.
162If one has not been set, but a TLSv1.2 resumption is being attempted
163and the session from the original handshake had a servername
164accepted by the server, then it will return that servername.
165Otherwise it returns
166.Dv NULL .
167.It On the client, during or after the handshake,\
168 if a TLSv1.2 (or below) resumption occurred:
169If the session from the original handshake had a servername accepted by the
170server, then it will return that servername.
171Otherwise it returns the servername set via
172.Fn SSL_set_tlsext_host_name
173or
174.Dv NULL
175if it was not called.
176.It On the client, during or after the handshake,\
177 if a TLSv1.2 (or below) resumption did not occur:
178It will return the servername set via
179.Fn SSL_set_tlsext_host_name
180or
181.Dv NULL
182if it was not called.
183.It On the server, before the handshake:
184The function will always return
185.Dv NULL
186before the handshake.
187.It On the server, after the servername extension has been processed,\
188 if a TLSv1.2 (or below) resumption occurred:
189If a servername was accepted by the server in the original handshake,
190then it will return that servername, or
191.Dv NULL
192otherwise.
193.It On the server, after the servername extension has been processed,\
194 if a TLSv1.2 (or below) resumption did not occur:
195The function will return the servername
196requested by the client in this handshake or
197.Dv NULL
198if none was requested.
199.El
200.Pp
201Note that the early callback occurs before a servername extension
202from the client is processed.
203The servername, certificate and ALPN callbacks occur
204after a servername extension from the client is processed.
205.end_of_get_servername_details
206.Pp
207.Fn SSL_set_tlsext_host_name
208sets the server name indication ClientHello extension
209to contain the value
210.Fa name ,
211or clears it if
212.Fa name
213is
214.Dv NULL .
215The type of server name indication
216extension is set to
217.Dv TLSEXT_NAMETYPE_host_name
218as defined in RFC 3546.
219.Pp
220All three functions are implemented as macros.
221.Sh RETURN VALUES
222.Fn SSL_CTX_set_tlsext_servername_callback
223and
224.Fn SSL_CTX_set_tlsext_servername_arg
225always return 1 indicating success.
226.Pp
227.Fn SSL_get_servername
228returns a servername extension value of the specified type if provided
229in the Client Hello, or
230.Dv NULL
231otherwise.
232.Pp
233.Fn SSL_get_servername_type
234returns the servername type or -1 if no servername is present.
235Currently the only supported type (defined in RFC 3546) is
236.Dv TLSEXT_NAMETYPE_host_name .
237.Pp
238.Fn SSL_set_tlsext_host_name
239returns 1 on success or 0 in case of an error.
240.Sh SEE ALSO
241.Xr ssl 3 ,
242.Xr SSL_CTX_callback_ctrl 3 ,
243.Xr SSL_CTX_set_alpn_select_cb 3
244.Sh HISTORY
245These functions first appeared in OpenSSL 0.9.8f
246and have been available since
247.Ox 4.5 .
diff --git a/src/lib/libssl/man/SSL_CTX_set_tlsext_status_cb.3 b/src/lib/libssl/man/SSL_CTX_set_tlsext_status_cb.3
deleted file mode 100644
index d5979af1e8..0000000000
--- a/src/lib/libssl/man/SSL_CTX_set_tlsext_status_cb.3
+++ /dev/null
@@ -1,238 +0,0 @@
1.\" $OpenBSD: SSL_CTX_set_tlsext_status_cb.3,v 1.8 2021/09/11 18:58:41 schwarze Exp $
2.\" full merge up to: OpenSSL 43c34894 Nov 30 16:04:51 2015 +0000
3.\" selective merge up to: OpenSSL df75c2bf Dec 9 01:02:36 2018 +0100
4.\"
5.\" This file was written by Matt Caswell <matt@openssl.org>.
6.\" Copyright (c) 2015, 2016 The OpenSSL Project. All rights reserved.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\"
12.\" 1. Redistributions of source code must retain the above copyright
13.\" notice, this list of conditions and the following disclaimer.
14.\"
15.\" 2. Redistributions in binary form must reproduce the above copyright
16.\" notice, this list of conditions and the following disclaimer in
17.\" the documentation and/or other materials provided with the
18.\" distribution.
19.\"
20.\" 3. All advertising materials mentioning features or use of this
21.\" software must display the following acknowledgment:
22.\" "This product includes software developed by the OpenSSL Project
23.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
24.\"
25.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
26.\" endorse or promote products derived from this software without
27.\" prior written permission. For written permission, please contact
28.\" openssl-core@openssl.org.
29.\"
30.\" 5. Products derived from this software may not be called "OpenSSL"
31.\" nor may "OpenSSL" appear in their names without prior written
32.\" permission of the OpenSSL Project.
33.\"
34.\" 6. Redistributions of any form whatsoever must retain the following
35.\" acknowledgment:
36.\" "This product includes software developed by the OpenSSL Project
37.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
38.\"
39.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
40.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
43.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50.\" OF THE POSSIBILITY OF SUCH DAMAGE.
51.\"
52.Dd $Mdocdate: September 11 2021 $
53.Dt SSL_CTX_SET_TLSEXT_STATUS_CB 3
54.Os
55.Sh NAME
56.Nm SSL_CTX_set_tlsext_status_cb ,
57.Nm SSL_CTX_get_tlsext_status_cb ,
58.Nm SSL_CTX_set_tlsext_status_arg ,
59.Nm SSL_CTX_get_tlsext_status_arg ,
60.Nm SSL_set_tlsext_status_type ,
61.Nm SSL_get_tlsext_status_type ,
62.Nm SSL_get_tlsext_status_ocsp_resp ,
63.Nm SSL_set_tlsext_status_ocsp_resp
64.Nd OCSP Certificate Status Request functions
65.Sh SYNOPSIS
66.In openssl/tls1.h
67.Ft long
68.Fo SSL_CTX_set_tlsext_status_cb
69.Fa "SSL_CTX *ctx"
70.Fa "int (*callback)(SSL *, void *)"
71.Fc
72.Ft long
73.Fo SSL_CTX_get_tlsext_status_cb
74.Fa "SSL_CTX *ctx"
75.Fa "int (*callback)(SSL *, void *)"
76.Fc
77.Ft long
78.Fo SSL_CTX_set_tlsext_status_arg
79.Fa "SSL_CTX *ctx"
80.Fa "void *arg"
81.Fc
82.Ft long
83.Fo SSL_CTX_get_tlsext_status_arg
84.Fa "SSL_CTX *ctx"
85.Fa "void **arg"
86.Fc
87.Ft long
88.Fo SSL_set_tlsext_status_type
89.Fa "SSL *s"
90.Fa "int type"
91.Fc
92.Ft long
93.Fo SSL_get_tlsext_status_type
94.Fa "SSL *s"
95.Fc
96.Ft long
97.Fo SSL_get_tlsext_status_ocsp_resp
98.Fa ssl
99.Fa "unsigned char **resp"
100.Fc
101.Ft long
102.Fo SSL_set_tlsext_status_ocsp_resp
103.Fa ssl
104.Fa "unsigned char *resp"
105.Fa "int len"
106.Fc
107.Sh DESCRIPTION
108A client application may request that a server send back an OCSP status
109response (also known as OCSP stapling).
110To do so the client should call the
111.Fn SSL_set_tlsext_status_type
112function on an individual
113.Vt SSL
114object prior to the start of the handshake.
115Currently the only supported type is
116.Dv TLSEXT_STATUSTYPE_ocsp .
117This value should be passed in the
118.Fa type
119argument.
120.Pp
121The client should additionally provide a callback function to decide
122what to do with the returned OCSP response by calling
123.Fn SSL_CTX_set_tlsext_status_cb .
124The callback function should determine whether the returned OCSP
125response is acceptable or not.
126The callback will be passed as an argument the value previously set via
127a call to
128.Fn SSL_CTX_set_tlsext_status_arg .
129Note that the callback will not be called in the event of a handshake
130where session resumption occurs (because there are no Certificates
131exchanged in such a handshake).
132.Pp
133The callback previously set via
134.Fn SSL_CTX_set_tlsext_status_cb
135can be retrieved by calling
136.Fn SSL_CTX_get_tlsext_status_cb ,
137and the argument by calling
138.Fn SSL_CTX_get_tlsext_status_arg .
139.Pp
140On the client side,
141.Fn SSL_get_tlsext_status_type
142can be used to determine whether the client has previously called
143.Fn SSL_set_tlsext_status_type .
144It will return
145.Dv TLSEXT_STATUSTYPE_ocsp
146if it has been called or \-1 otherwise.
147On the server side,
148.Fn SSL_get_tlsext_status_type
149can be used to determine whether the client requested OCSP stapling.
150If the client requested it, then this function will return
151.Dv TLSEXT_STATUSTYPE_ocsp ,
152or \-1 otherwise.
153.Pp
154The response returned by the server can be obtained via a call to
155.Fn SSL_get_tlsext_status_ocsp_resp .
156The value
157.Pf * Fa resp
158will be updated to point to the OCSP response data and the return value
159will be the length of that data.
160If the server has not provided any response data, then
161.Pf * Fa resp
162will be
163.Dv NULL
164and the return value from
165.Fn SSL_get_tlsext_status_ocsp_resp
166will be -1.
167.Pp
168A server application must also call the
169.Fn SSL_CTX_set_tlsext_status_cb
170function if it wants to be able to provide clients with OCSP Certificate
171Status responses.
172Typically the server callback would obtain the server certificate that
173is being sent back to the client via a call to
174.Xr SSL_get_certificate 3 ,
175obtain the OCSP response to be sent back, and then set that response
176data by calling
177.Fn SSL_set_tlsext_status_ocsp_resp .
178A pointer to the response data should be provided in the
179.Fa resp
180argument, and the length of that data should be in the
181.Fa len
182argument.
183.Sh RETURN VALUES
184The callback when used on the client side should return a negative
185value on error, 0 if the response is not acceptable (in which case
186the handshake will fail), or a positive value if it is acceptable.
187.Pp
188The callback when used on the server side should return with either
189.Dv SSL_TLSEXT_ERR_OK
190(meaning that the OCSP response that has been set should be returned),
191.Dv SSL_TLSEXT_ERR_NOACK
192(meaning that an OCSP response should not be returned), or
193.Dv SSL_TLSEXT_ERR_ALERT_FATAL
194(meaning that a fatal error has occurred).
195.Pp
196.Fn SSL_CTX_set_tlsext_status_cb ,
197.Fn SSL_CTX_get_tlsext_status_cb ,
198.Fn SSL_CTX_set_tlsext_status_arg ,
199.Fn SSL_CTX_get_tlsext_status_arg ,
200.Fn SSL_set_tlsext_status_type ,
201and
202.Fn SSL_set_tlsext_status_ocsp_resp
203always return 1, indicating success.
204.Pp
205.Fn SSL_get_tlsext_status_type
206returns
207.Dv TLSEXT_STATUSTYPE_ocsp
208on the client side if
209.Fn SSL_set_tlsext_status_type
210was previously called, or on the server side
211if the client requested OCSP stapling.
212Otherwise \-1 is returned.
213.Pp
214.Fn SSL_get_tlsext_status_ocsp_resp
215returns the length of the OCSP response data
216or \-1 if there is no OCSP response data.
217.Sh SEE ALSO
218.Xr ssl 3 ,
219.Xr SSL_CTX_callback_ctrl 3
220.Sh HISTORY
221.Fn SSL_CTX_set_tlsext_status_cb ,
222.Fn SSL_CTX_set_tlsext_status_arg ,
223.Fn SSL_set_tlsext_status_type ,
224.Fn SSL_get_tlsext_status_ocsp_resp ,
225and
226.Fn SSL_set_tlsext_status_ocsp_resp
227first appeared in OpenSSL 0.9.8h and have been available since
228.Ox 4.5 .
229.Pp
230.Fn SSL_CTX_get_tlsext_status_cb
231and
232.Fn SSL_CTX_get_tlsext_status_arg
233first appeared in OpenSSL 1.1.0 and have been available since
234.Ox 6.3 .
235.Pp
236.Fn SSL_get_tlsext_status_type
237first appeared in OpenSSL 1.1.0 and has been available since
238.Ox 7.0 .
diff --git a/src/lib/libssl/man/SSL_CTX_set_tlsext_ticket_key_cb.3 b/src/lib/libssl/man/SSL_CTX_set_tlsext_ticket_key_cb.3
deleted file mode 100644
index b6ccabaeca..0000000000
--- a/src/lib/libssl/man/SSL_CTX_set_tlsext_ticket_key_cb.3
+++ /dev/null
@@ -1,300 +0,0 @@
1.\" $OpenBSD: SSL_CTX_set_tlsext_ticket_key_cb.3,v 1.8 2022/01/25 18:01:20 tb Exp $
2.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3.\"
4.\" This file was written by Rich Salz <rsalz@akamai.com>
5.\" Copyright (c) 2014, 2015, 2016 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: January 25 2022 $
52.Dt SSL_CTX_SET_TLSEXT_TICKET_KEY_CB 3
53.Os
54.Sh NAME
55.Nm SSL_CTX_set_tlsext_ticket_key_cb
56.Nd set a callback for session ticket processing
57.Sh SYNOPSIS
58.In openssl/tls1.h
59.Ft long
60.Fo SSL_CTX_set_tlsext_ticket_key_cb
61.Fa "SSL_CTX sslctx"
62.Fa "int (*cb)(SSL *s, unsigned char key_name[16],\
63 unsigned char iv[EVP_MAX_IV_LENGTH],\
64 EVP_CIPHER_CTX *ctx, HMAC_CTX *hctx, int enc)"
65.Fc
66.Sh DESCRIPTION
67.Fn SSL_CTX_set_tlsext_ticket_key_cb
68sets a callback function
69.Fa cb
70for handling session tickets for the ssl context
71.Fa sslctx .
72Session tickets, defined in RFC 5077, provide an enhanced session
73resumption capability where the server implementation is not required to
74maintain per session state.
75.Pp
76The callback function
77.Fa cb
78will be called for every client instigated TLS session when session
79ticket extension is presented in the TLS hello message.
80It is the responsibility of this function to create or retrieve the
81cryptographic parameters and to maintain their state.
82.Pp
83The OpenSSL library uses the callback function to help implement a
84common TLS ticket construction state according to RFC 5077 Section 4 such
85that per session state is unnecessary and a small set of cryptographic
86variables needs to be maintained by the callback function
87implementation.
88.Pp
89In order to reuse a session, a TLS client must send a session ticket
90extension to the server.
91The client can only send exactly one session ticket.
92The server, through the callback function, either agrees to reuse the
93session ticket information or it starts a full TLS handshake to create a
94new session ticket.
95.Pp
96The callback is called with
97.Fa ctx
98and
99.Fa hctx
100which were newly allocated with
101.Xr EVP_CIPHER_CTX_new 3
102and
103.Xr HMAC_CTX_new 3 ,
104respectively.
105.Pp
106For new sessions tickets, when the client doesn't present a session
107ticket, or an attempted retrieval of the ticket failed, or a renew
108option was indicated, the callback function will be called with
109.Fa enc
110equal to 1.
111The OpenSSL library expects that the function will set an arbitrary
112.Fa key_name ,
113initialize
114.Fa iv ,
115and set the cipher context
116.Fa ctx
117and the hash context
118.Fa hctx .
119.Pp
120The
121.Fa key_name
122is 16 characters long and is used as a key identifier.
123.Pp
124The
125.Fa iv
126length is the length of the IV of the corresponding cipher.
127The maximum IV length is
128.Dv EVP_MAX_IV_LENGTH
129bytes defined in
130.In openssl/evp.h .
131.Pp
132The initialization vector
133.Fa iv
134should be a random value.
135The cipher context
136.Fa ctx
137should use the initialisation vector
138.Fa iv .
139The cipher context can be set using
140.Xr EVP_EncryptInit_ex 3 .
141The hmac context can be set using
142.Xr HMAC_Init_ex 3 .
143.Pp
144When the client presents a session ticket, the callback function
145with be called with
146.Fa enc
147set to 0 indicating that the
148.Fa cb
149function should retrieve a set of parameters.
150In this case
151.Fa key_name
152and
153.Fa iv
154have already been parsed out of the session ticket.
155The OpenSSL library expects that the
156.Em key_name
157will be used to retrieve a cryptographic parameters and that the
158cryptographic context
159.Fa ctx
160will be set with the retrieved parameters and the initialization vector
161.Fa iv
162using a function like
163.Xr EVP_DecryptInit_ex 3 .
164The
165.Fa hctx
166needs to be set using
167.Xr HMAC_Init_ex 3 .
168.Pp
169If the
170.Fa key_name
171is still valid but a renewal of the ticket is required, the callback
172function should return 2.
173The library will call the callback again with an argument of
174.Fa enc
175equal to 1 to set the new ticket.
176.Pp
177The return value of the
178.Fa cb
179function is used by OpenSSL to determine what further processing will
180occur.
181The following return values have meaning:
182.Bl -tag -width Ds
183.It 2
184This indicates that the
185.Fa ctx
186and
187.Fa hctx
188have been set and the session can continue on those parameters.
189Additionally it indicates that the session ticket is in a renewal period
190and should be replaced.
191The OpenSSL library will call
192.Fa cb
193again with an
194.Fa enc
195argument of 1 to set the new ticket (see RFC 5077 3.3 paragraph 2).
196.It 1
197This indicates that the
198.Fa ctx
199and
200.Fa hctx
201have been set and the session can continue on those parameters.
202.It 0
203This indicates that it was not possible to set/retrieve a session ticket
204and the SSL/TLS session will continue by negotiating a set of
205cryptographic parameters or using the alternate SSL/TLS resumption
206mechanism, session ids.
207.Pp
208If called with
209.Fa enc
210equal to 0, the library will call the
211.Fa cb
212again to get a new set of parameters.
213.It less than 0
214This indicates an error.
215.El
216.Pp
217Session resumption shortcuts the TLS so that the client certificate
218negotiation don't occur.
219It makes up for this by storing client certificate and all other
220negotiated state information encrypted within the ticket.
221In a resumed session the applications will have all this state
222information available exactly as if a full negotiation had occurred.
223.Pp
224If an attacker can obtain the key used to encrypt a session ticket, they
225can obtain the master secret for any ticket using that key and decrypt
226any traffic using that session: even if the ciphersuite supports forward
227secrecy.
228As a result applications may wish to use multiple keys and avoid using
229long term keys stored in files.
230.Pp
231Applications can use longer keys to maintain a consistent level of
232security.
233For example if a ciphersuite uses 256 bit ciphers but only a 128 bit
234ticket key the overall security is only 128 bits because breaking the
235ticket key will enable an attacker to obtain the session keys.
236.Sh RETURN VALUES
237This function returns 0 to indicate that the callback function was set.
238.Sh EXAMPLES
239Reference Implementation:
240.Bd -literal
241SSL_CTX_set_tlsext_ticket_key_cb(SSL, ssl_tlsext_ticket_key_cb);
242\&....
243static int ssl_tlsext_ticket_key_cb(SSL *s, unsigned char key_name[16],
244 unsigned char *iv, EVP_CIPHER_CTX *ctx, HMAC_CTX *hctx, int enc)
245{
246 if (enc) { /* create new session */
247 if (RAND_bytes(iv, EVP_MAX_IV_LENGTH))
248 return -1; /* insufficient random */
249
250 key = currentkey(); /* something you need to implement */
251 if (!key) {
252 /* current key doesn't exist or isn't valid */
253 key = createkey();
254 /* something that you need to implement.
255 * createkey needs to initialise a name,
256 * an aes_key, a hmac_key, and optionally
257 * an expire time. */
258 if (!key) /* key couldn't be created */
259 return 0;
260 }
261 memcpy(key_name, key->name, 16);
262
263 EVP_EncryptInit_ex(&ctx, EVP_aes_128_cbc(), NULL,
264 key->aes_key, iv);
265 HMAC_Init_ex(&hctx, key->hmac_key, 16, EVP_sha256(), NULL);
266
267 return 1;
268
269 } else { /* retrieve session */
270 key = findkey(name);
271
272 if (!key || key->expire < now())
273 return 0;
274
275 HMAC_Init_ex(&hctx, key->hmac_key, 16, EVP_sha256(), NULL);
276 EVP_DecryptInit_ex(&ctx, EVP_aes_128_cbc(), NULL,
277 key->aes_key, iv );
278
279 if (key->expire < (now() - RENEW_TIME))
280 /* this session will get a new ticket
281 * even though the current is still valid */
282 return 2;
283
284 return 1;
285 }
286}
287.Ed
288.Sh SEE ALSO
289.Xr ssl 3 ,
290.Xr SSL_CTX_add_session 3 ,
291.Xr SSL_CTX_callback_ctrl 3 ,
292.Xr SSL_CTX_sess_number 3 ,
293.Xr SSL_CTX_sess_set_get_cb 3 ,
294.Xr SSL_CTX_set_session_id_context 3 ,
295.Xr SSL_session_reused 3 ,
296.Xr SSL_set_session 3
297.Sh HISTORY
298.Fn SSL_CTX_set_tlsext_ticket_key_cb
299first appeared in OpenSSL 0.9.8h and has been available since
300.Ox 4.5 .
diff --git a/src/lib/libssl/man/SSL_CTX_set_tlsext_use_srtp.3 b/src/lib/libssl/man/SSL_CTX_set_tlsext_use_srtp.3
deleted file mode 100644
index 04c4833c6a..0000000000
--- a/src/lib/libssl/man/SSL_CTX_set_tlsext_use_srtp.3
+++ /dev/null
@@ -1,197 +0,0 @@
1.\" $OpenBSD: SSL_CTX_set_tlsext_use_srtp.3,v 1.6 2021/06/11 19:41:39 jmc Exp $
2.\" full merge up to: OpenSSL b0edda11 Mar 20 13:00:17 2018 +0000
3.\"
4.\" This file was written by Matt Caswell <matt@openssl.org>.
5.\" Copyright (c) 2017 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: June 11 2021 $
52.Dt SSL_CTX_SET_TLSEXT_USE_SRTP 3
53.Os
54.Sh NAME
55.Nm SSL_CTX_set_tlsext_use_srtp ,
56.Nm SSL_set_tlsext_use_srtp ,
57.Nm SSL_get_srtp_profiles ,
58.Nm SSL_get_selected_srtp_profile
59.Nd Configure and query SRTP support
60.Sh SYNOPSIS
61.In openssl/srtp.h
62.Ft int
63.Fo SSL_CTX_set_tlsext_use_srtp
64.Fa "SSL_CTX *ctx"
65.Fa "const char *profiles"
66.Fc
67.Ft int
68.Fo SSL_set_tlsext_use_srtp
69.Fa "SSL *ssl"
70.Fa "const char *profiles"
71.Fc
72.Ft STACK_OF(SRTP_PROTECTION_PROFILE) *
73.Fo SSL_get_srtp_profiles
74.Fa "SSL *ssl"
75.Fc
76.Ft SRTP_PROTECTION_PROFILE *
77.Fo SSL_get_selected_srtp_profile
78.Fa "SSL *ssl"
79.Fc
80.Sh DESCRIPTION
81SRTP is the Secure Real-Time Transport Protocol.
82OpenSSL implements support for the "use_srtp" DTLS extension
83defined in RFC 5764.
84This provides a mechanism for establishing SRTP keying material,
85algorithms and parameters using DTLS.
86This capability may be used as part of an implementation that
87conforms to RFC 5763.
88OpenSSL does not implement SRTP itself or RFC 5763.
89Note that OpenSSL does not support the use of SRTP Master Key
90Identifiers (MKIs).
91Also note that this extension is only supported in DTLS.
92Any SRTP configuration is ignored if a TLS connection is attempted.
93.Pp
94An OpenSSL client wishing to send the "use_srtp" extension should call
95.Fn SSL_CTX_set_tlsext_use_srtp
96to set its use for all
97.Vt SSL
98objects subsequently created from
99.Fa ctx .
100Alternatively a client may call
101.Fn SSL_set_tlsext_use_srtp
102to set its use for an individual
103.Vt SSL
104object.
105The
106.Fa profiles
107parameter should point to a NUL-terminated, colon delimited list of
108SRTP protection profile names.
109.Pp
110The currently supported protection profile names are:
111.Bl -tag -width Ds
112.It Dv SRTP_AES128_CM_SHA1_80
113This corresponds to SRTP_AES128_CM_HMAC_SHA1_80 defined in RFC 5764.
114.It Dv SRTP_AES128_CM_SHA1_32
115This corresponds to SRTP_AES128_CM_HMAC_SHA1_32 defined in RFC 5764.
116.It Dv SRTP_AEAD_AES_128_GCM
117This corresponds to SRTP_AEAD_AES_128_GCM defined in RFC 7714.
118.It Dv SRTP_AEAD_AES_256_GCM
119This corresponds to SRTP_AEAD_AES_256_GCM defined in RFC 7714.
120.El
121.Pp
122Supplying an unrecognised protection profile name results in an error.
123.Pp
124An OpenSSL server wishing to support the "use_srtp" extension should
125also call
126.Fn SSL_CTX_set_tlsext_use_srtp
127or
128.Fn SSL_set_tlsext_use_srtp
129to indicate the protection profiles that it is willing to negotiate.
130.Pp
131The currently configured list of protection profiles for either a client
132or a server can be obtained by calling
133.Fn SSL_get_srtp_profiles .
134This returns a stack of
135.Vt SRTP_PROTECTION_PROFILE
136objects.
137The memory pointed to in the return value of this function should not be
138freed by the caller.
139.Pp
140After a handshake has been completed, the negotiated SRTP protection
141profile (if any) can be obtained (on the client or the server) by
142calling
143.Fn SSL_get_selected_srtp_profile .
144This function returns
145.Dv NULL
146if no SRTP protection profile was negotiated.
147The memory returned from this function should not be freed by the
148caller.
149.Pp
150If an SRTP protection profile has been successfully negotiated,
151then the SRTP keying material (on both the client and server)
152should be obtained by calling
153.Xr SSL_export_keying_material 3
154with a
155.Fa label
156of
157.Qq EXTRACTOR-dtls_srtp ,
158a
159.Fa context
160of
161.Dv NULL ,
162and a
163.Fa use_context
164argument of 0.
165The total length of keying material obtained should be equal to two
166times the sum of the master key length and the salt length as defined
167for the protection profile in use.
168This provides the client write master key, the server write master key,
169the client write master salt and the server write master salt in that
170order.
171.Sh RETURN VALUES
172Contrary to OpenSSL conventions,
173.Fn SSL_CTX_set_tlsext_use_srtp
174and
175.Fn SSL_set_tlsext_use_srtp
176return 0 on success or 1 on error.
177.Pp
178.Fn SSL_get_srtp_profiles
179returns a stack of
180.Vt SRTP_PROTECTION_PROFILE
181objects on success or
182.Dv NULL
183on error or if no protection profiles have been configured.
184.Pp
185.Fn SSL_get_selected_srtp_profile
186returns a pointer to an
187.Vt SRTP_PROTECTION_PROFILE
188object if one has been negotiated or
189.Dv NULL
190otherwise.
191.Sh SEE ALSO
192.Xr ssl 3 ,
193.Xr SSL_export_keying_material 3
194.Sh HISTORY
195These functions first appeared in OpenSSL 1.0.1
196and have been available since
197.Ox 5.3 .
diff --git a/src/lib/libssl/man/SSL_CTX_set_tmp_dh_callback.3 b/src/lib/libssl/man/SSL_CTX_set_tmp_dh_callback.3
deleted file mode 100644
index c6f5253431..0000000000
--- a/src/lib/libssl/man/SSL_CTX_set_tmp_dh_callback.3
+++ /dev/null
@@ -1,229 +0,0 @@
1.\" $OpenBSD: SSL_CTX_set_tmp_dh_callback.3,v 1.11 2025/01/18 10:45:12 tb Exp $
2.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
5.\" Copyright (c) 2001, 2014, 2015 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: January 18 2025 $
52.Dt SSL_CTX_SET_TMP_DH_CALLBACK 3
53.Os
54.Sh NAME
55.Nm SSL_CTX_set_tmp_dh_callback ,
56.Nm SSL_CTX_set_tmp_dh ,
57.Nm SSL_set_tmp_dh_callback ,
58.Nm SSL_set_tmp_dh
59.Nd handle DH keys for ephemeral key exchange
60.Sh SYNOPSIS
61.In openssl/ssl.h
62.Ft void
63.Fo SSL_CTX_set_tmp_dh_callback
64.Fa "SSL_CTX *ctx"
65.Fa "DH *(*tmp_dh_callback)(SSL *ssl, int is_export, int keylength)"
66.Fc
67.Ft long
68.Fn SSL_CTX_set_tmp_dh "SSL_CTX *ctx" "DH *dh"
69.Ft void
70.Fo SSL_set_tmp_dh_callback
71.Fa "SSL *ssl"
72.Fa "DH *(*tmp_dh_callback)(SSL *ssl, int is_export, int keylength"
73.Fc
74.Ft long
75.Fn SSL_set_tmp_dh "SSL *ssl" "DH *dh"
76.Sh DESCRIPTION
77.Fn SSL_CTX_set_tmp_dh_callback
78sets the callback function for
79.Fa ctx
80to be used when a DH parameters are required to
81.Fa tmp_dh_callback .
82The callback is inherited by all
83.Vt ssl
84objects created from
85.Fa ctx .
86.Pp
87.Fn SSL_CTX_set_tmp_dh
88sets DH parameters to be used by
89.Fa ctx .
90The key is inherited by all
91.Fa ssl
92objects created from
93.Fa ctx .
94.Pp
95.Fn SSL_set_tmp_dh_callback
96sets the callback only for
97.Fa ssl .
98.Pp
99.Fn SSL_set_tmp_dh
100sets the parameters only for
101.Fa ssl .
102.Pp
103These functions apply to SSL/TLS servers only.
104.Pp
105When using a cipher with RSA authentication,
106an ephemeral DH key exchange can take place.
107In these cases, the session data are negotiated using the ephemeral/temporary
108DH key and the key supplied and certified by the certificate chain is only used
109for signing.
110Anonymous ciphers (without a permanent server key) also use ephemeral DH keys.
111.Pp
112Using ephemeral DH key exchange yields forward secrecy,
113as the connection can only be decrypted when the DH key is known.
114By generating a temporary DH key inside the server application that is lost
115when the application is left, it becomes impossible for attackers to decrypt
116past sessions, even if they get hold of the normal (certified) key,
117as this key was only used for signing.
118.Pp
119In order to perform a DH key exchange, the server must use a DH group
120(DH parameters) and generate a DH key.
121The server will always generate a new DH key during the negotiation.
122.Pp
123As generating DH parameters is extremely time consuming, an application should
124not generate the parameters on the fly but supply the parameters.
125DH parameters can be reused,
126as the actual key is newly generated during the negotiation.
127The risk in reusing DH parameters is that an attacker may specialize on a very
128often used DH group.
129Applications should therefore generate their own DH parameters during the
130installation process using the
131.Xr openssl 1
132.Cm dhparam
133application.
134This application guarantees that "strong" primes are used.
135.Pp
136Files
137.Pa dh2048.pem
138and
139.Pa dh4096.pem
140in the
141.Pa apps
142directory of the current version of the OpenSSL distribution contain the
143.Sq SKIP
144DH parameters,
145which use safe primes and were generated verifiably pseudo-randomly.
146These files can be converted into C code using the
147.Fl C
148option of the
149.Xr openssl 1
150.Cm dhparam
151application.
152Generation of custom DH parameters during installation should still
153be preferred to stop an attacker from specializing on a commonly
154used group.
155The file
156.Pa dh1024.pem
157contains old parameters that must not be used by applications.
158.Pp
159An application may either directly specify the DH parameters or can supply the
160DH parameters via a callback function.
161.Pp
162Previous versions of the callback used
163.Fa is_export
164and
165.Fa keylength
166parameters to control parameter generation for export and non-export
167cipher suites.
168Modern servers that do not support export ciphersuites are advised
169to either use
170.Fn SSL_CTX_set_tmp_dh
171or alternatively, use the callback but ignore
172.Fa keylength
173and
174.Fa is_export
175and simply supply at least 2048-bit parameters in the callback.
176.Sh RETURN VALUES
177.Fn SSL_CTX_set_tmp_dh
178and
179.Fn SSL_set_tmp_dh
180do return 1 on success and 0 on failure.
181Check the error queue to find out the reason of failure.
182.Sh EXAMPLES
183Set up DH parameters with a key length of 2048 bits.
184Error handling is partly left out.
185.Pp
186Command-line parameter generation:
187.Pp
188.Dl openssl dhparam -out dh_param_2048.pem 2048
189.Pp
190Code for setting up parameters during server initialization:
191.Bd -literal
192SSL_CTX ctx = SSL_CTX_new();
193\&...
194
195/* Set up ephemeral DH parameters. */
196DH *dh_2048 = NULL;
197FILE *paramfile;
198paramfile = fopen("dh_param_2048.pem", "r");
199if (paramfile) {
200 dh_2048 = PEM_read_DHparams(paramfile, NULL, NULL, NULL);
201 fclose(paramfile);
202} else {
203 /* Error. */
204}
205if (dh_2048 == NULL) {
206 /* Error. */
207}
208if (SSL_CTX_set_tmp_dh(ctx, dh_2048) != 1) {
209 /* Error. */
210}
211.Ed
212.Sh SEE ALSO
213.Xr openssl 1 ,
214.Xr ssl 3 ,
215.Xr SSL_CTX_set_cipher_list 3 ,
216.Xr SSL_CTX_set_options 3 ,
217.Xr SSL_set_tmp_ecdh 3
218.Sh HISTORY
219.Fn SSL_CTX_set_tmp_dh_callback
220and
221.Fn SSL_CTX_set_tmp_dh
222first appeared in SSLeay 0.8.0 and have been available since
223.Ox 2.4 .
224.Pp
225.Fn SSL_set_tmp_dh_callback
226and
227.Fn SSL_set_tmp_dh
228first appeared in OpenSSL 0.9.2b and have been available since
229.Ox 2.6 .
diff --git a/src/lib/libssl/man/SSL_CTX_set_tmp_rsa_callback.3 b/src/lib/libssl/man/SSL_CTX_set_tmp_rsa_callback.3
deleted file mode 100644
index b4c3a3c647..0000000000
--- a/src/lib/libssl/man/SSL_CTX_set_tmp_rsa_callback.3
+++ /dev/null
@@ -1,114 +0,0 @@
1.\" $OpenBSD: SSL_CTX_set_tmp_rsa_callback.3,v 1.9 2022/03/29 14:27:59 naddy Exp $
2.\" OpenSSL 0b30fc90 Dec 19 15:23:05 2013 -0500
3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
5.\" Copyright (c) 2001, 2006, 2013 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: March 29 2022 $
52.Dt SSL_CTX_SET_TMP_RSA_CALLBACK 3
53.Os
54.Sh NAME
55.Nm SSL_CTX_set_tmp_rsa_callback ,
56.Nm SSL_CTX_set_tmp_rsa ,
57.Nm SSL_CTX_need_tmp_RSA ,
58.Nm SSL_set_tmp_rsa_callback ,
59.Nm SSL_set_tmp_rsa ,
60.Nm SSL_need_tmp_RSA
61.Nd handle RSA keys for ephemeral key exchange
62.Sh SYNOPSIS
63.In openssl/ssl.h
64.Ft void
65.Fo SSL_CTX_set_tmp_rsa_callback
66.Fa "SSL_CTX *ctx"
67.Fa "RSA *(*tmp_rsa_callback)(SSL *ssl, int is_export, int keylength)"
68.Fc
69.Ft long
70.Fn SSL_CTX_set_tmp_rsa "SSL_CTX *ctx" "RSA *rsa"
71.Ft long
72.Fn SSL_CTX_need_tmp_RSA "SSL_CTX *ctx"
73.Ft void
74.Fo SSL_set_tmp_rsa_callback
75.Fa "SSL_CTX *ctx"
76.Fa "RSA *(*tmp_rsa_callback)(SSL *ssl, int is_export, int keylength)"
77.Fc
78.Ft long
79.Fn SSL_set_tmp_rsa "SSL *ssl" "RSA *rsa"
80.Ft long
81.Fn SSL_need_tmp_RSA "SSL *ssl"
82.Sh DESCRIPTION
83Since they mattered only for deliberately insecure RSA authentication
84mandated by historical U.S. export restrictions, these functions
85are all deprecated and have no effect except that
86.Fn SSL_CTX_set_tmp_rsa_callback ,
87.Fn SSL_CTX_set_tmp_rsa ,
88.Fn SSL_set_tmp_rsa_callback ,
89and
90.Fn SSL_set_tmp_rsa
91issue error messages when called.
92.Sh RETURN VALUES
93These functions always return 0, indicating failure.
94.Sh SEE ALSO
95.Xr ssl 3 ,
96.Xr SSL_CTX_set_cipher_list 3 ,
97.Xr SSL_CTX_set_options 3 ,
98.Xr SSL_CTX_set_tmp_dh_callback 3 ,
99.Xr SSL_new 3 ,
100.Xr SSL_set_tmp_ecdh 3
101.Sh HISTORY
102.Fn SSL_CTX_set_tmp_rsa_callback ,
103.Fn SSL_CTX_set_tmp_rsa ,
104and
105.Fn SSL_CTX_need_tmp_RSA
106first appeared in SSLeay 0.8.0 and have been available since
107.Ox 2.4 .
108.Pp
109.Fn SSL_set_tmp_rsa_callback ,
110.Fn SSL_set_tmp_rsa ,
111and
112.Fn SSL_need_tmp_RSA
113first appeared in OpenSSL 0.9.2b and have been available since
114.Ox 2.6 .
diff --git a/src/lib/libssl/man/SSL_CTX_set_verify.3 b/src/lib/libssl/man/SSL_CTX_set_verify.3
deleted file mode 100644
index 1ed86407e9..0000000000
--- a/src/lib/libssl/man/SSL_CTX_set_verify.3
+++ /dev/null
@@ -1,479 +0,0 @@
1.\" $OpenBSD: SSL_CTX_set_verify.3,v 1.9 2021/06/12 16:59:53 jmc Exp $
2.\" full merge up to: OpenSSL 9b86974e Aug 17 15:21:33 2015 -0400
3.\" selective merge up to: OpenSSL 1cb7eff4 Sep 10 13:56:40 2019 +0100
4.\"
5.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
6.\" Copyright (c) 2000, 2001, 2002, 2003, 2014 The OpenSSL Project.
7.\" All rights reserved.
8.\"
9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions
11.\" are met:
12.\"
13.\" 1. Redistributions of source code must retain the above copyright
14.\" notice, this list of conditions and the following disclaimer.
15.\"
16.\" 2. Redistributions in binary form must reproduce the above copyright
17.\" notice, this list of conditions and the following disclaimer in
18.\" the documentation and/or other materials provided with the
19.\" distribution.
20.\"
21.\" 3. All advertising materials mentioning features or use of this
22.\" software must display the following acknowledgment:
23.\" "This product includes software developed by the OpenSSL Project
24.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
25.\"
26.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
27.\" endorse or promote products derived from this software without
28.\" prior written permission. For written permission, please contact
29.\" openssl-core@openssl.org.
30.\"
31.\" 5. Products derived from this software may not be called "OpenSSL"
32.\" nor may "OpenSSL" appear in their names without prior written
33.\" permission of the OpenSSL Project.
34.\"
35.\" 6. Redistributions of any form whatsoever must retain the following
36.\" acknowledgment:
37.\" "This product includes software developed by the OpenSSL Project
38.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
39.\"
40.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
41.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
42.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
43.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
44.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
45.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
46.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
47.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
49.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
50.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
51.\" OF THE POSSIBILITY OF SUCH DAMAGE.
52.\"
53.Dd $Mdocdate: June 12 2021 $
54.Dt SSL_CTX_SET_VERIFY 3
55.Os
56.Sh NAME
57.Nm SSL_CTX_set_verify ,
58.Nm SSL_set_verify ,
59.Nm SSL_CTX_set_verify_depth ,
60.Nm SSL_set_verify_depth
61.Nd set peer certificate verification parameters
62.Sh SYNOPSIS
63.In openssl/ssl.h
64.Ft void
65.Fo SSL_CTX_set_verify
66.Fa "SSL_CTX *ctx"
67.Fa "int mode"
68.Fa "int (*verify_callback)(int, X509_STORE_CTX *)"
69.Fc
70.Ft void
71.Fo SSL_set_verify
72.Fa "SSL *s"
73.Fa "int mode"
74.Fa "int (*verify_callback)(int, X509_STORE_CTX *)"
75.Fc
76.Ft void
77.Fn SSL_CTX_set_verify_depth "SSL_CTX *ctx" "int depth"
78.Ft void
79.Fn SSL_set_verify_depth "SSL *s" "int depth"
80.Ft int
81.Fn verify_callback "int preverify_ok" "X509_STORE_CTX *x509_ctx"
82.Sh DESCRIPTION
83.Fn SSL_CTX_set_verify
84sets the verification flags for
85.Fa ctx
86to be
87.Fa mode
88and
89specifies the
90.Fa verify_callback
91function to be used.
92If no callback function shall be specified, the
93.Dv NULL
94pointer can be used for
95.Fa verify_callback .
96.Pp
97.Fn SSL_set_verify
98sets the verification flags for
99.Fa ssl
100to be
101.Fa mode
102and specifies the
103.Fa verify_callback
104function to be used.
105If no callback function shall be specified, the
106.Dv NULL
107pointer can be used for
108.Fa verify_callback .
109In this case last
110.Fa verify_callback
111set specifically for this
112.Fa ssl
113remains.
114If no special callback was set before, the default callback for the underlying
115.Fa ctx
116is used, that was valid at the time
117.Fa ssl
118was created with
119.Xr SSL_new 3 .
120Within the callback function,
121.Xr SSL_get_ex_data_X509_STORE_CTX_idx 3
122can be called to get the data index of the current
123.Vt SSL
124object that is doing the verification.
125.Pp
126.Fn SSL_CTX_set_verify_depth
127sets the maximum
128.Fa depth
129for the certificate chain verification that shall be allowed for
130.Fa ctx .
131(See the
132.Sx BUGS
133section.)
134.Pp
135.Fn SSL_set_verify_depth
136sets the maximum
137.Fa depth
138for the certificate chain verification that shall be allowed for
139.Fa ssl .
140(See the
141.Sx BUGS
142section.)
143.Pp
144The verification of certificates can be controlled by a set of bitwise ORed
145.Fa mode
146flags:
147.Bl -tag -width Ds
148.It Dv SSL_VERIFY_NONE
149.Em Server mode :
150the server will not send a client certificate request to the client,
151so the client will not send a certificate.
152.Pp
153.Em Client mode :
154if not using an anonymous cipher (by default disabled),
155the server will send a certificate which will be checked.
156The result of the certificate verification process can be checked after the
157TLS/SSL handshake using the
158.Xr SSL_get_verify_result 3
159function.
160The handshake will be continued regardless of the verification result.
161.It Dv SSL_VERIFY_PEER
162.Em Server mode :
163the server sends a client certificate request to the client.
164The certificate returned (if any) is checked.
165If the verification process fails,
166the TLS/SSL handshake is immediately terminated with an alert message
167containing the reason for the verification failure.
168The behaviour can be controlled by the additional
169.Dv SSL_VERIFY_FAIL_IF_NO_PEER_CERT
170and
171.Dv SSL_VERIFY_CLIENT_ONCE
172flags.
173.Pp
174.Em Client mode :
175the server certificate is verified.
176If the verification process fails,
177the TLS/SSL handshake is immediately terminated with an alert message
178containing the reason for the verification failure.
179If no server certificate is sent, because an anonymous cipher is used,
180.Dv SSL_VERIFY_PEER
181is ignored.
182.It Dv SSL_VERIFY_FAIL_IF_NO_PEER_CERT
183.Em Server mode :
184if the client did not return a certificate, the TLS/SSL
185handshake is immediately terminated with a
186.Dq handshake failure
187alert.
188This flag must be used together with
189.Dv SSL_VERIFY_PEER .
190.Pp
191.Em Client mode :
192ignored
193.It Dv SSL_VERIFY_CLIENT_ONCE
194.Em Server mode :
195only request a client certificate on the initial TLS/SSL handshake.
196Do not ask for a client certificate again in case of a renegotiation.
197This flag must be used together with
198.Dv SSL_VERIFY_PEER .
199.Pp
200.Em Client mode :
201ignored
202.El
203.Pp
204Exactly one of the
205.Fa mode
206flags
207.Dv SSL_VERIFY_NONE
208and
209.Dv SSL_VERIFY_PEER
210must be set at any time.
211.Pp
212The actual verification procedure is performed either using the built-in
213verification procedure or using another application provided verification
214function set with
215.Xr SSL_CTX_set_cert_verify_callback 3 .
216The following descriptions apply in the case of the built-in procedure.
217An application provided procedure also has access to the verify depth
218information and the
219.Fa verify_callback Ns ()
220function, but the way this information is used may be different.
221.Pp
222.Fn SSL_CTX_set_verify_depth
223and
224.Fn SSL_set_verify_depth
225set the limit up to which depth certificates in a chain are used during the
226verification procedure.
227If the certificate chain is longer than allowed,
228the certificates above the limit are ignored.
229Error messages are generated as if these certificates would not be present,
230most likely a
231.Dv X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY
232will be issued.
233The depth count is
234.Dq level 0: peer certificate ,
235.Dq level 1: CA certificate ,
236.Dq level 2: higher level CA certificate ,
237and so on.
238Setting the maximum depth to 2 allows the levels 0, 1, and 2.
239The default depth limit is 100,
240allowing for the peer certificate and an additional 100 CA certificates.
241.Pp
242The
243.Fa verify_callback
244function is used to control the behaviour when the
245.Dv SSL_VERIFY_PEER
246flag is set.
247It must be supplied by the application and receives two arguments:
248.Fa preverify_ok
249indicates whether the verification of the certificate in question was passed
250(preverify_ok=1) or not (preverify_ok=0).
251.Fa x509_ctx
252is a pointer to the complete context used
253for the certificate chain verification.
254.Pp
255The certificate chain is checked starting with the deepest nesting level
256(the root CA certificate) and worked upward to the peer's certificate.
257At each level signatures and issuer attributes are checked.
258Whenever a verification error is found, the error number is stored in
259.Fa x509_ctx
260and
261.Fa verify_callback
262is called with
263.Fa preverify_ok
264equal to 0.
265By applying
266.Fn X509_CTX_store_*
267functions
268.Fa verify_callback
269can locate the certificate in question and perform additional steps (see
270.Sx EXAMPLES ) .
271If no error is found for a certificate,
272.Fa verify_callback
273is called with
274.Fa preverify_ok
275equal to 1 before advancing to the next level.
276.Pp
277The return value of
278.Fa verify_callback
279controls the strategy of the further verification process.
280If
281.Fa verify_callback
282returns 0, the verification process is immediately stopped with
283.Dq verification failed
284state.
285If
286.Dv SSL_VERIFY_PEER
287is set, a verification failure alert is sent to the peer and the TLS/SSL
288handshake is terminated.
289If
290.Fa verify_callback
291returns 1, the verification process is continued.
292If
293.Fa verify_callback
294always returns 1,
295the TLS/SSL handshake will not be terminated with respect to verification
296failures and the connection will be established.
297The calling process can however retrieve the error code of the last
298verification error using
299.Xr SSL_get_verify_result 3
300or by maintaining its own error storage managed by
301.Fa verify_callback .
302.Pp
303If no
304.Fa verify_callback
305is specified, the default callback will be used.
306Its return value is identical to
307.Fa preverify_ok ,
308so that any verification
309failure will lead to a termination of the TLS/SSL handshake with an
310alert message, if
311.Dv SSL_VERIFY_PEER
312is set.
313.Sh EXAMPLES
314The following code sequence realizes an example
315.Fa verify_callback
316function that will always continue the TLS/SSL handshake regardless of
317verification failure, if wished.
318The callback realizes a verification depth limit with more informational output.
319.Pp
320All verification errors are printed;
321information about the certificate chain is printed on request.
322The example is realized for a server that does allow but not require client
323certificates.
324.Pp
325The example makes use of the ex_data technique to store application data
326into/retrieve application data from the
327.Vt SSL
328structure (see
329.Xr SSL_get_ex_new_index 3 ,
330.Xr SSL_get_ex_data_X509_STORE_CTX_idx 3 ) .
331.Bd -literal
332\&...
333
334typedef struct {
335 int verbose_mode;
336 int verify_depth;
337 int always_continue;
338} mydata_t;
339int mydata_index;
340\&...
341static int
342verify_callback(int preverify_ok, X509_STORE_CTX *ctx)
343{
344 char buf[256];
345 X509 *err_cert;
346 int err, depth;
347 SSL *ssl;
348 mydata_t *mydata;
349
350 err_cert = X509_STORE_CTX_get_current_cert(ctx);
351 err = X509_STORE_CTX_get_error(ctx);
352 depth = X509_STORE_CTX_get_error_depth(ctx);
353
354 /*
355 * Retrieve the pointer to the SSL of the connection currently
356 * treated * and the application specific data stored into the
357 * SSL object.
358 */
359 ssl = X509_STORE_CTX_get_ex_data(ctx,
360 SSL_get_ex_data_X509_STORE_CTX_idx());
361 mydata = SSL_get_ex_data(ssl, mydata_index);
362
363 X509_NAME_oneline(X509_get_subject_name(err_cert), buf, 256);
364
365 /*
366 * Catch a too long certificate chain. The depth limit set using
367 * SSL_CTX_set_verify_depth() is by purpose set to "limit+1" so
368 * that whenever the "depth>verify_depth" condition is met, we
369 * have violated the limit and want to log this error condition.
370 * We must do it here, because the CHAIN_TOO_LONG error would not
371 * be found explicitly; only errors introduced by cutting off the
372 * additional certificates would be logged.
373 */
374 if (depth > mydata->verify_depth) {
375 preverify_ok = 0;
376 err = X509_V_ERR_CERT_CHAIN_TOO_LONG;
377 X509_STORE_CTX_set_error(ctx, err);
378 }
379 if (!preverify_ok) {
380 printf("verify error:num=%d:%s:depth=%d:%s\en", err,
381 X509_verify_cert_error_string(err), depth, buf);
382 } else if (mydata->verbose_mode) {
383 printf("depth=%d:%s\en", depth, buf);
384 }
385
386 /*
387 * At this point, err contains the last verification error.
388 * We can use it for something special
389 */
390 if (!preverify_ok && (err ==
391 X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT)) {
392 X509_NAME_oneline(X509_get_issuer_name(ctx->current_cert),
393 buf, 256);
394 printf("issuer= %s\en", buf);
395 }
396
397 if (mydata->always_continue)
398 return 1;
399 else
400 return preverify_ok;
401}
402\&...
403
404mydata_t mydata;
405
406\&...
407
408mydata_index = SSL_get_ex_new_index(0, "mydata index", NULL, NULL, NULL);
409
410\&...
411
412SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER|SSL_VERIFY_CLIENT_ONCE,
413 verify_callback);
414
415/*
416 * Let the verify_callback catch the verify_depth error so that we get
417 * an appropriate error in the logfile.
418 */
419SSL_CTX_set_verify_depth(verify_depth + 1);
420
421/*
422 * Set up the SSL specific data into "mydata" and store it into the SSL
423 * structure.
424 */
425mydata.verify_depth = verify_depth; ...
426SSL_set_ex_data(ssl, mydata_index, &mydata);
427
428\&...
429
430SSL_accept(ssl); /* check of success left out for clarity */
431if (peer = SSL_get_peer_certificate(ssl)) {
432 if (SSL_get_verify_result(ssl) == X509_V_OK) {
433 /* The client sent a certificate which verified OK */
434 }
435}
436.Ed
437.Sh SEE ALSO
438.Xr ssl 3 ,
439.Xr SSL_CTX_get_verify_mode 3 ,
440.Xr SSL_CTX_load_verify_locations 3 ,
441.Xr SSL_CTX_set_cert_verify_callback 3 ,
442.Xr SSL_get_ex_data_X509_STORE_CTX_idx 3 ,
443.Xr SSL_get_ex_new_index 3 ,
444.Xr SSL_get_peer_certificate 3 ,
445.Xr SSL_get_verify_result 3 ,
446.Xr SSL_new 3 ,
447.Xr SSL_set1_host 3
448.Sh HISTORY
449.Fn SSL_set_verify
450appeared in SSLeay 0.4 or earlier.
451.Fn SSL_CTX_set_verify
452first appeared in SSLeay 0.6.4.
453Both functions have been available since
454.Ox 2.4 .
455.Pp
456.Fn SSL_CTX_set_verify_depth
457and
458.Fn SSL_set_verify_depth
459first appeared in OpenSSL 0.9.3 and have been available since
460.Ox 2.6 .
461.Sh BUGS
462In client mode, it is not checked whether the
463.Dv SSL_VERIFY_PEER
464flag is set, but whether
465.Dv SSL_VERIFY_NONE
466is not set.
467This can lead to unexpected behaviour, if the
468.Dv SSL_VERIFY_PEER
469and
470.Dv SSL_VERIFY_NONE
471are not used as required (exactly one must be set at any time).
472.Pp
473The certificate verification depth set with
474.Fn SSL[_CTX]_verify_depth
475stops the verification at a certain depth.
476The error message produced will be that of an incomplete certificate chain and
477not
478.Dv X509_V_ERR_CERT_CHAIN_TOO_LONG
479as may be expected.
diff --git a/src/lib/libssl/man/SSL_CTX_use_certificate.3 b/src/lib/libssl/man/SSL_CTX_use_certificate.3
deleted file mode 100644
index c88a6971b2..0000000000
--- a/src/lib/libssl/man/SSL_CTX_use_certificate.3
+++ /dev/null
@@ -1,451 +0,0 @@
1.\" $OpenBSD: SSL_CTX_use_certificate.3,v 1.17 2025/01/18 10:45:12 tb Exp $
2.\" full merge up to: OpenSSL 3aaa1bd0 Mar 28 16:35:25 2017 +1000
3.\" selective merge up to: OpenSSL d1f7a1e6 Apr 26 14:05:40 2018 +0100
4.\"
5.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
6.\" Copyright (c) 2000, 2001, 2002, 2003, 2005 The OpenSSL Project.
7.\" All rights reserved.
8.\"
9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions
11.\" are met:
12.\"
13.\" 1. Redistributions of source code must retain the above copyright
14.\" notice, this list of conditions and the following disclaimer.
15.\"
16.\" 2. Redistributions in binary form must reproduce the above copyright
17.\" notice, this list of conditions and the following disclaimer in
18.\" the documentation and/or other materials provided with the
19.\" distribution.
20.\"
21.\" 3. All advertising materials mentioning features or use of this
22.\" software must display the following acknowledgment:
23.\" "This product includes software developed by the OpenSSL Project
24.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
25.\"
26.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
27.\" endorse or promote products derived from this software without
28.\" prior written permission. For written permission, please contact
29.\" openssl-core@openssl.org.
30.\"
31.\" 5. Products derived from this software may not be called "OpenSSL"
32.\" nor may "OpenSSL" appear in their names without prior written
33.\" permission of the OpenSSL Project.
34.\"
35.\" 6. Redistributions of any form whatsoever must retain the following
36.\" acknowledgment:
37.\" "This product includes software developed by the OpenSSL Project
38.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
39.\"
40.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
41.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
42.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
43.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
44.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
45.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
46.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
47.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
49.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
50.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
51.\" OF THE POSSIBILITY OF SUCH DAMAGE.
52.\"
53.Dd $Mdocdate: January 18 2025 $
54.Dt SSL_CTX_USE_CERTIFICATE 3
55.Os
56.Sh NAME
57.Nm SSL_CTX_use_certificate ,
58.Nm SSL_CTX_use_certificate_ASN1 ,
59.Nm SSL_CTX_use_certificate_file ,
60.Nm SSL_use_certificate ,
61.Nm SSL_use_certificate_ASN1 ,
62.Nm SSL_use_certificate_chain_file ,
63.Nm SSL_use_certificate_file ,
64.Nm SSL_CTX_use_certificate_chain_file ,
65.Nm SSL_CTX_use_certificate_chain_mem ,
66.Nm SSL_CTX_use_PrivateKey ,
67.Nm SSL_CTX_use_PrivateKey_ASN1 ,
68.Nm SSL_CTX_use_PrivateKey_file ,
69.Nm SSL_CTX_use_RSAPrivateKey ,
70.Nm SSL_CTX_use_RSAPrivateKey_ASN1 ,
71.Nm SSL_CTX_use_RSAPrivateKey_file ,
72.Nm SSL_use_PrivateKey_file ,
73.Nm SSL_use_PrivateKey_ASN1 ,
74.Nm SSL_use_PrivateKey ,
75.Nm SSL_use_RSAPrivateKey ,
76.Nm SSL_use_RSAPrivateKey_ASN1 ,
77.Nm SSL_use_RSAPrivateKey_file ,
78.Nm SSL_CTX_check_private_key ,
79.Nm SSL_check_private_key
80.Nd load certificate and key data
81.Sh SYNOPSIS
82.In openssl/ssl.h
83.Ft int
84.Fn SSL_CTX_use_certificate "SSL_CTX *ctx" "X509 *x"
85.Ft int
86.Fn SSL_CTX_use_certificate_ASN1 "SSL_CTX *ctx" "int len" "unsigned char *d"
87.Ft int
88.Fn SSL_CTX_use_certificate_file "SSL_CTX *ctx" "const char *file" "int type"
89.Ft int
90.Fn SSL_use_certificate "SSL *ssl" "X509 *x"
91.Ft int
92.Fn SSL_use_certificate_ASN1 "SSL *ssl" "unsigned char *d" "int len"
93.Ft int
94.Fn SSL_use_certificate_chain_file "SSL *ssl" "const char *file"
95.Ft int
96.Fn SSL_use_certificate_file "SSL *ssl" "const char *file" "int type"
97.Ft int
98.Fn SSL_CTX_use_certificate_chain_file "SSL_CTX *ctx" "const char *file"
99.Ft int
100.Fn SSL_CTX_use_certificate_chain_mem "SSL_CTX *ctx" "void *buf" "int len"
101.Ft int
102.Fn SSL_CTX_use_PrivateKey "SSL_CTX *ctx" "EVP_PKEY *pkey"
103.Ft int
104.Fo SSL_CTX_use_PrivateKey_ASN1
105.Fa "int pk" "SSL_CTX *ctx" "unsigned char *d" "long len"
106.Fc
107.Ft int
108.Fn SSL_CTX_use_PrivateKey_file "SSL_CTX *ctx" "const char *file" "int type"
109.Ft int
110.Fn SSL_CTX_use_RSAPrivateKey "SSL_CTX *ctx" "RSA *rsa"
111.Ft int
112.Fn SSL_CTX_use_RSAPrivateKey_ASN1 "SSL_CTX *ctx" "unsigned char *d" "long len"
113.Ft int
114.Fn SSL_CTX_use_RSAPrivateKey_file "SSL_CTX *ctx" "const char *file" "int type"
115.Ft int
116.Fn SSL_use_PrivateKey "SSL *ssl" "EVP_PKEY *pkey"
117.Ft int
118.Fn SSL_use_PrivateKey_ASN1 "int pk" "SSL *ssl" "unsigned char *d" "long len"
119.Ft int
120.Fn SSL_use_PrivateKey_file "SSL *ssl" "const char *file" "int type"
121.Ft int
122.Fn SSL_use_RSAPrivateKey "SSL *ssl" "RSA *rsa"
123.Ft int
124.Fn SSL_use_RSAPrivateKey_ASN1 "SSL *ssl" "const unsigned char *d" "long len"
125.Ft int
126.Fn SSL_use_RSAPrivateKey_file "SSL *ssl" "const char *file" "int type"
127.Ft int
128.Fn SSL_CTX_check_private_key "const SSL_CTX *ctx"
129.Ft int
130.Fn SSL_check_private_key "const SSL *ssl"
131.Sh DESCRIPTION
132These functions load the certificates and private keys into the
133.Vt SSL_CTX
134or
135.Vt SSL
136object, respectively.
137.Pp
138The
139.Fn SSL_CTX_*
140class of functions loads the certificates and keys into the
141.Vt SSL_CTX
142object
143.Fa ctx .
144The information is passed to
145.Vt SSL
146objects
147.Fa ssl
148created from
149.Fa ctx
150with
151.Xr SSL_new 3
152by copying, so that changes applied to
153.Fa ctx
154do not propagate to already existing
155.Vt SSL
156objects.
157.Pp
158The
159.Fn SSL_*
160class of functions only loads certificates and keys into a specific
161.Vt SSL
162object.
163The specific information is kept when
164.Xr SSL_clear 3
165is called for this
166.Vt SSL
167object.
168.Pp
169.Fn SSL_CTX_use_certificate
170loads the certificate
171.Fa x
172into
173.Fa ctx ;
174.Fn SSL_use_certificate
175loads
176.Fa x
177into
178.Fa ssl .
179The rest of the certificates needed to form the complete certificate chain can
180be specified using the
181.Xr SSL_CTX_add_extra_chain_cert 3
182function.
183.Pp
184.Fn SSL_CTX_use_certificate_ASN1
185loads the ASN1 encoded certificate from the memory location
186.Fa d
187(with length
188.Fa len )
189into
190.Fa ctx ;
191.Fn SSL_use_certificate_ASN1
192loads the ASN1 encoded certificate into
193.Fa ssl .
194.Pp
195.Fn SSL_CTX_use_certificate_file
196loads the first certificate stored in
197.Fa file
198into
199.Fa ctx .
200The formatting
201.Fa type
202of the certificate must be specified from the known types
203.Dv SSL_FILETYPE_PEM
204and
205.Dv SSL_FILETYPE_ASN1 .
206.Fn SSL_use_certificate_file
207loads the certificate from
208.Fa file
209into
210.Fa ssl .
211See the
212.Sx NOTES
213section on why
214.Fn SSL_CTX_use_certificate_chain_file
215should be preferred.
216.Pp
217The
218.Fn SSL_CTX_use_certificate_chain*
219functions load a certificate chain into
220.Fa ctx .
221The certificates must be in PEM format and must be sorted starting with the
222subject's certificate (actual client or server certificate),
223followed by intermediate CA certificates if applicable,
224and ending at the highest level (root) CA.
225With the exception of
226.Fn SSL_use_certificate_chain_file ,
227there is no corresponding function working on a single
228.Vt SSL
229object.
230.Pp
231.Fn SSL_CTX_use_PrivateKey
232adds
233.Fa pkey
234as private key to
235.Fa ctx .
236.Fn SSL_CTX_use_RSAPrivateKey
237adds the private key
238.Fa rsa
239of type RSA to
240.Fa ctx .
241.Fn SSL_use_PrivateKey
242adds
243.Fa pkey
244as private key to
245.Fa ssl ;
246.Fn SSL_use_RSAPrivateKey
247adds
248.Fa rsa
249as private key of type RSA to
250.Fa ssl .
251If a certificate has already been set and the private does not belong to the
252certificate, an error is returned.
253To change a certificate private key pair,
254the new certificate needs to be set with
255.Fn SSL_use_certificate
256or
257.Fn SSL_CTX_use_certificate
258before setting the private key with
259.Fn SSL_CTX_use_PrivateKey
260or
261.Fn SSL_use_PrivateKey .
262.Pp
263.Fn SSL_CTX_use_PrivateKey_ASN1
264adds the private key of type
265.Fa pk
266stored at memory location
267.Fa d
268(length
269.Fa len )
270to
271.Fa ctx .
272.Fn SSL_CTX_use_RSAPrivateKey_ASN1
273adds the private key of type RSA stored at memory location
274.Fa d
275(length
276.Fa len )
277to
278.Fa ctx .
279.Fn SSL_use_PrivateKey_ASN1
280and
281.Fn SSL_use_RSAPrivateKey_ASN1
282add the private key to
283.Fa ssl .
284.Pp
285.Fn SSL_CTX_use_PrivateKey_file
286adds the first private key found in
287.Fa file
288to
289.Fa ctx .
290The formatting
291.Fa type
292of the private key must be specified from the known types
293.Dv SSL_FILETYPE_PEM
294and
295.Dv SSL_FILETYPE_ASN1 .
296.Fn SSL_CTX_use_RSAPrivateKey_file
297adds the first private RSA key found in
298.Fa file
299to
300.Fa ctx .
301.Fn SSL_use_PrivateKey_file
302adds the first private key found in
303.Fa file
304to
305.Fa ssl ;
306.Fn SSL_use_RSAPrivateKey_file
307adds the first private RSA key found to
308.Fa ssl .
309.Pp
310The
311.Fn SSL_CTX_check_private_key
312function is seriously misnamed.
313It compares the
314.Em public
315key components and parameters of an OpenSSL private key with the
316corresponding certificate loaded into
317.Fa ctx .
318If more than one key/certificate pair (RSA/ECDSA) is installed,
319the last item installed will be compared.
320If, e.g., the last item was an RSA certificate or key,
321the RSA key/certificate pair will be checked.
322.Fn SSL_check_private_key
323performs the same
324.Em public
325key comparison for
326.Fa ssl .
327If no key/certificate was explicitly added for this
328.Fa ssl ,
329the last item added into
330.Fa ctx
331will be checked.
332.Pp
333Despite the name, neither
334.Fn SSL_CTX_check_private_key
335nor
336.Fn SSL_check_private_key
337checks whether the private key component is indeed a private key,
338nor whether it matches the public key component.
339They merely compare the public materials (e.g. exponent and modulus of
340an RSA key) and/or key parameters (e.g. EC params of an EC key) of a
341key pair.
342.Sh NOTES
343The internal certificate store of OpenSSL can hold several private
344key/certificate pairs at a time.
345The certificate used depends on the cipher selected.
346See also
347.Xr SSL_CTX_set_cipher_list 3 .
348.Pp
349When reading certificates and private keys from file, files of type
350.Dv SSL_FILETYPE_ASN1
351(also known as
352.Em DER ,
353binary encoding) can only contain one certificate or private key; consequently,
354.Fn SSL_CTX_use_certificate_chain_file
355is only applicable to PEM formatting.
356Files of type
357.Dv SSL_FILETYPE_PEM
358can contain more than one item.
359.Pp
360.Fn SSL_CTX_use_certificate_chain_file
361adds the first certificate found in the file to the certificate store.
362The other certificates are added to the store of chain certificates using
363.Xr SSL_CTX_add1_chain_cert 3 .
364It is recommended to use the
365.Fn SSL_CTX_use_certificate_chain_file
366instead of the
367.Fn SSL_CTX_use_certificate_file
368function in order to allow the use of complete certificate chains even when no
369trusted CA storage is used or when the CA issuing the certificate shall not be
370added to the trusted CA storage.
371.Pp
372If additional certificates are needed to complete the chain during the TLS
373negotiation, CA certificates are additionally looked up in the locations of
374trusted CA certificates (see
375.Xr SSL_CTX_load_verify_locations 3 ) .
376.Pp
377The private keys loaded from file can be encrypted.
378In order to successfully load encrypted keys,
379a function returning the passphrase must have been supplied (see
380.Xr SSL_CTX_set_default_passwd_cb 3 ) .
381(Certificate files might be encrypted as well from the technical point of view,
382it however does not make sense as the data in the certificate is considered
383public anyway.)
384.Sh RETURN VALUES
385On success, the functions return 1.
386Otherwise check out the error stack to find out the reason.
387.Sh SEE ALSO
388.Xr ssl 3 ,
389.Xr SSL_clear 3 ,
390.Xr SSL_CTX_add1_chain_cert 3 ,
391.Xr SSL_CTX_add_extra_chain_cert 3 ,
392.Xr SSL_CTX_load_verify_locations 3 ,
393.Xr SSL_CTX_set_cipher_list 3 ,
394.Xr SSL_CTX_set_client_CA_list 3 ,
395.Xr SSL_CTX_set_client_cert_cb 3 ,
396.Xr SSL_CTX_set_default_passwd_cb 3 ,
397.Xr SSL_new 3 ,
398.Xr X509_check_private_key 3
399.Sh HISTORY
400.Fn SSL_use_certificate ,
401.Fn SSL_use_certificate_file ,
402.Fn SSL_use_RSAPrivateKey ,
403and
404.Fn SSL_use_RSAPrivateKey_file
405appeared in SSLeay 0.4 or earlier.
406.Fn SSL_use_certificate_ASN1
407and
408.Fn SSL_use_RSAPrivateKey_ASN1
409first appeared in SSLeay 0.5.1.
410.Fn SSL_use_PrivateKey_file ,
411.Fn SSL_use_PrivateKey_ASN1 ,
412and
413.Fn SSL_use_PrivateKey
414first appeared in SSLeay 0.6.0.
415.Fn SSL_CTX_use_certificate ,
416.Fn SSL_CTX_use_certificate_ASN1 ,
417.Fn SSL_CTX_use_certificate_file ,
418.Fn SSL_CTX_use_PrivateKey ,
419.Fn SSL_CTX_use_PrivateKey_ASN1 ,
420.Fn SSL_CTX_use_PrivateKey_file ,
421.Fn SSL_CTX_use_RSAPrivateKey ,
422.Fn SSL_CTX_use_RSAPrivateKey_ASN1 ,
423and
424.Fn SSL_CTX_use_RSAPrivateKey_file
425first appeared in SSLeay 0.6.1.
426.Fn SSL_CTX_check_private_key
427and
428.Fn SSL_check_private_key
429first appeared in SSLeay 0.6.5.
430All these functions have been available since
431.Ox 2.4 .
432.Pp
433.Fn SSL_CTX_use_certificate_chain_file
434first appeared in OpenSSL 0.9.4 and has been available since
435.Ox 2.6 .
436.Pp
437.Fn SSL_use_certificate_chain_file
438first appeared in OpenSSL 1.1.0 and has been available since
439.Ox 6.9 .
440.Pp
441Support for DER encoded private keys
442.Pq Dv SSL_FILETYPE_ASN1
443in
444.Fn SSL_CTX_use_PrivateKey_file
445and
446.Fn SSL_use_PrivateKey_file
447was added in 0.9.8.
448.Pp
449.Fn SSL_CTX_use_certificate_chain_mem
450first appeared in
451.Ox 5.7 .
diff --git a/src/lib/libssl/man/SSL_SESSION_free.3 b/src/lib/libssl/man/SSL_SESSION_free.3
deleted file mode 100644
index 3f785e95e5..0000000000
--- a/src/lib/libssl/man/SSL_SESSION_free.3
+++ /dev/null
@@ -1,148 +0,0 @@
1.\" $OpenBSD: SSL_SESSION_free.3,v 1.7 2019/06/12 09:36:30 schwarze Exp $
2.\" full merge up to: OpenSSL b31db505 Mar 24 16:01:50 2017 +0000
3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>
5.\" and Matt Caswell <matt@openssl.org>.
6.\" Copyright (c) 2000, 2001, 2009, 2017 The OpenSSL Project.
7.\" All rights reserved.
8.\"
9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions
11.\" are met:
12.\"
13.\" 1. Redistributions of source code must retain the above copyright
14.\" notice, this list of conditions and the following disclaimer.
15.\"
16.\" 2. Redistributions in binary form must reproduce the above copyright
17.\" notice, this list of conditions and the following disclaimer in
18.\" the documentation and/or other materials provided with the
19.\" distribution.
20.\"
21.\" 3. All advertising materials mentioning features or use of this
22.\" software must display the following acknowledgment:
23.\" "This product includes software developed by the OpenSSL Project
24.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
25.\"
26.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
27.\" endorse or promote products derived from this software without
28.\" prior written permission. For written permission, please contact
29.\" openssl-core@openssl.org.
30.\"
31.\" 5. Products derived from this software may not be called "OpenSSL"
32.\" nor may "OpenSSL" appear in their names without prior written
33.\" permission of the OpenSSL Project.
34.\"
35.\" 6. Redistributions of any form whatsoever must retain the following
36.\" acknowledgment:
37.\" "This product includes software developed by the OpenSSL Project
38.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
39.\"
40.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
41.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
42.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
43.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
44.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
45.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
46.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
47.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
49.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
50.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
51.\" OF THE POSSIBILITY OF SUCH DAMAGE.
52.\"
53.Dd $Mdocdate: June 12 2019 $
54.Dt SSL_SESSION_FREE 3
55.Os
56.Sh NAME
57.Nm SSL_SESSION_up_ref ,
58.Nm SSL_SESSION_free
59.Nd SSL_SESSION reference counting
60.Sh SYNOPSIS
61.In openssl/ssl.h
62.Ft int
63.Fn SSL_SESSION_up_ref "SSL_SESSION *session"
64.Ft void
65.Fn SSL_SESSION_free "SSL_SESSION *session"
66.Sh DESCRIPTION
67.Fn SSL_SESSION_up_ref
68increments the reference count of the given
69.Fa session
70by 1.
71.Pp
72.Fn SSL_SESSION_free
73decrements the reference count of the given
74.Fa session
75by 1.
76If the reference count reaches 0, it frees the memory used by the
77.Fa session .
78If
79.Fa session
80is a
81.Dv NULL
82pointer, no action occurs.
83.Pp
84.Vt SSL_SESSION
85objects are allocated when a TLS/SSL handshake operation is successfully
86completed.
87Depending on the settings, see
88.Xr SSL_CTX_set_session_cache_mode 3 ,
89the
90.Vt SSL_SESSION
91objects are internally referenced by the
92.Vt SSL_CTX
93and linked into its session cache.
94.Vt SSL
95objects may be using the
96.Vt SSL_SESSION
97object; as a session may be reused, several
98.Vt SSL
99objects may be using one
100.Vt SSL_SESSION
101object at the same time.
102It is therefore crucial to keep the reference count (usage information) correct
103and not delete a
104.Vt SSL_SESSION
105object that is still used, as this may lead to program failures due to dangling
106pointers.
107These failures may also appear delayed, e.g., when an
108.Vt SSL_SESSION
109object is completely freed as the reference count incorrectly becomes 0, but it
110is still referenced in the internal session cache and the cache list is
111processed during a
112.Xr SSL_CTX_flush_sessions 3
113operation.
114.Pp
115.Fn SSL_SESSION_free
116must only be called for
117.Vt SSL_SESSION
118objects, for which the reference count was explicitly incremented (e.g., by
119calling
120.Xr SSL_get1_session 3 ;
121see
122.Xr SSL_get_session 3 )
123or when the
124.Vt SSL_SESSION
125object was generated outside a TLS handshake operation, e.g., by using
126.Xr d2i_SSL_SESSION 3 .
127It must not be called on other
128.Vt SSL_SESSION
129objects, as this would cause incorrect reference counts and therefore program
130failures.
131.Sh RETURN VALUES
132.Fn SSL_SESSION_up_ref
133returns 1 on success or 0 on error.
134.Sh SEE ALSO
135.Xr d2i_SSL_SESSION 3 ,
136.Xr ssl 3 ,
137.Xr SSL_CTX_flush_sessions 3 ,
138.Xr SSL_CTX_set_session_cache_mode 3 ,
139.Xr SSL_get_session 3 ,
140.Xr SSL_SESSION_new 3
141.Sh HISTORY
142.Fn SSL_SESSION_free
143first appeared in SSLeay 0.5.2 and has been available since
144.Ox 2.4 .
145.Pp
146.Fn SSL_SESSION_up_ref
147first appeared in OpenSSL 1.1.0 and has been available since
148.Ox 6.3 .
diff --git a/src/lib/libssl/man/SSL_SESSION_get0_cipher.3 b/src/lib/libssl/man/SSL_SESSION_get0_cipher.3
deleted file mode 100644
index 239a426dbd..0000000000
--- a/src/lib/libssl/man/SSL_SESSION_get0_cipher.3
+++ /dev/null
@@ -1,94 +0,0 @@
1.\" $OpenBSD: SSL_SESSION_get0_cipher.3,v 1.1 2021/05/12 14:16:25 tb Exp $
2.\" full merge up to: OpenSSL d42e7759f Mar 30 19:40:04 2017 +0200
3.\" selective merge up to: OpenSSL df75c2bf Dec 9 01:02:36 2018 +0100
4.\"
5.\" This file was written by Rich Salz <rsalz@openssl.org>.
6.\" Copyright (c) 2016, 2017 The OpenSSL Project. All rights reserved.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\"
12.\" 1. Redistributions of source code must retain the above copyright
13.\" notice, this list of conditions and the following disclaimer.
14.\"
15.\" 2. Redistributions in binary form must reproduce the above copyright
16.\" notice, this list of conditions and the following disclaimer in
17.\" the documentation and/or other materials provided with the
18.\" distribution.
19.\"
20.\" 3. All advertising materials mentioning features or use of this
21.\" software must display the following acknowledgment:
22.\" "This product includes software developed by the OpenSSL Project
23.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
24.\"
25.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
26.\" endorse or promote products derived from this software without
27.\" prior written permission. For written permission, please contact
28.\" openssl-core@openssl.org.
29.\"
30.\" 5. Products derived from this software may not be called "OpenSSL"
31.\" nor may "OpenSSL" appear in their names without prior written
32.\" permission of the OpenSSL Project.
33.\"
34.\" 6. Redistributions of any form whatsoever must retain the following
35.\" acknowledgment:
36.\" "This product includes software developed by the OpenSSL Project
37.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
38.\"
39.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
40.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
43.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50.\" OF THE POSSIBILITY OF SUCH DAMAGE.
51.\"
52.Dd $Mdocdate: May 12 2021 $
53.Dt SSL_SESSION_GET0_CIPHER 3
54.Os
55.Sh NAME
56.Nm SSL_SESSION_get0_cipher
57.Nd retrieve the SSL cipher associated with a session
58.Sh SYNOPSIS
59.In openssl/ssl.h
60.Ft const SSL_CIPHER *
61.Fo SSL_SESSION_get0_cipher
62.Fa "const SSL_SESSION *session"
63.Fc
64.Sh DESCRIPTION
65.Fn SSL_SESSION_get0_cipher
66retrieves the cipher that was used by the connection when the session
67was created, or
68.Dv NULL
69if it cannot be determined.
70.Pp
71The value returned is a pointer to an object maintained within
72.Fa session
73and should not be released.
74.Sh RETURN VALUES
75.Fn SSL_SESSION_get0_cipher
76returns the
77.Vt SSL_CIPHER
78associated with
79.Fa session
80or
81.Dv NULL
82if it cannot be determined.
83.Sh SEE ALSO
84.Xr ssl 3 ,
85.Xr SSL_CIPHER_get_name 3 ,
86.Xr SSL_get_current_cipher 3 ,
87.Xr SSL_get_session 3 ,
88.Xr SSL_SESSION_new 3
89.Sh HISTORY
90The
91.Fn SSL_SESSION_get0_cipher
92function first appeared in OpenSSL 1.1.0
93and has been available since
94.Ox 7.0 .
diff --git a/src/lib/libssl/man/SSL_SESSION_get0_peer.3 b/src/lib/libssl/man/SSL_SESSION_get0_peer.3
deleted file mode 100644
index 6b1ef6680e..0000000000
--- a/src/lib/libssl/man/SSL_SESSION_get0_peer.3
+++ /dev/null
@@ -1,80 +0,0 @@
1.\" $OpenBSD: SSL_SESSION_get0_peer.3,v 1.2 2018/03/23 05:50:30 schwarze Exp $
2.\" OpenSSL SSL_SESSION_get0_peer.pod b31db505 Mar 24 16:01:50 2017 +0000
3.\"
4.\" This file was written by Matt Caswell <matt@openssl.org>
5.\" Copyright (c) 2017 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: March 23 2018 $
52.Dt SSL_SESSION_GET0_PEER 3
53.Os
54.Sh NAME
55.Nm SSL_SESSION_get0_peer
56.Nd get details about peer's certificate for a session
57.Sh SYNOPSIS
58.In openssl/ssl.h
59.Ft X509 *
60.Fo SSL_SESSION_get0_peer
61.Fa "SSL_SESSION *s"
62.Fc
63.Sh DESCRIPTION
64.Fn SSL_SESSION_get0_peer
65returns a pointer to the peer certificate associated with the session
66.Fa s
67or
68.Dv NULL
69if no peer certificate is available.
70The caller should not free the returned value, unless
71.Xr X509_up_ref 3
72has also been called.
73.Sh SEE ALSO
74.Xr ssl 3 ,
75.Xr SSL_get_session 3 ,
76.Xr SSL_SESSION_new 3
77.Sh HISTORY
78.Fn SSL_SESSION_get0_peer
79first appeared in OpenSSL 1.0.1 and has been available since
80.Ox 5.3 .
diff --git a/src/lib/libssl/man/SSL_SESSION_get_compress_id.3 b/src/lib/libssl/man/SSL_SESSION_get_compress_id.3
deleted file mode 100644
index aedc216a15..0000000000
--- a/src/lib/libssl/man/SSL_SESSION_get_compress_id.3
+++ /dev/null
@@ -1,78 +0,0 @@
1.\" $OpenBSD: SSL_SESSION_get_compress_id.3,v 1.3 2018/03/23 05:50:30 schwarze Exp $
2.\" OpenSSL SSL_SESSION_get_compress_id.pod b31db505 Mar 24 16:01:50 2017
3.\"
4.\" This file was written by Matt Caswell <matt@openssl.org>
5.\" Copyright (c) 2017 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: March 23 2018 $
52.Dt SSL_SESSION_GET_COMPRESS_ID 3
53.Os
54.Sh NAME
55.Nm SSL_SESSION_get_compress_id
56.Nd get details about the compression associated with a session
57.Sh SYNOPSIS
58.In openssl/ssl.h
59.Ft unsigned int
60.Fo SSL_SESSION_get_compress_id
61.Fa "const SSL_SESSION *s"
62.Fc
63.Sh DESCRIPTION
64If compression has been negotiated for an ssl session,
65.Fn SSL_SESSION_get_compress_id
66returns the id for the compression method, or 0 otherwise.
67The only built-in supported compression method is zlib,
68which has an id of 1.
69.Sh SEE ALSO
70.Xr ssl 3 ,
71.Xr SSL_get_session 3 ,
72.Xr SSL_SESSION_get_id 3 ,
73.Xr SSL_SESSION_get_protocol_version 3 ,
74.Xr SSL_SESSION_new 3
75.Sh HISTORY
76.Fn SSL_SESSION_get_compress_id
77first appeared in OpenSSL 1.0.1 and has been available since
78.Ox 5.3 .
diff --git a/src/lib/libssl/man/SSL_SESSION_get_ex_new_index.3 b/src/lib/libssl/man/SSL_SESSION_get_ex_new_index.3
deleted file mode 100644
index 9fd6949b6a..0000000000
--- a/src/lib/libssl/man/SSL_SESSION_get_ex_new_index.3
+++ /dev/null
@@ -1,134 +0,0 @@
1.\" $OpenBSD: SSL_SESSION_get_ex_new_index.3,v 1.3 2018/03/21 08:06:34 schwarze Exp $
2.\" OpenSSL 9b86974e Aug 17 15:21:33 2015 -0400
3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
5.\" Copyright (c) 2001, 2005 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: March 21 2018 $
52.Dt SSL_SESSION_GET_EX_NEW_INDEX 3
53.Os
54.Sh NAME
55.Nm SSL_SESSION_get_ex_new_index ,
56.Nm SSL_SESSION_set_ex_data ,
57.Nm SSL_SESSION_get_ex_data
58.Nd internal application specific data functions
59.Sh SYNOPSIS
60.In openssl/ssl.h
61.Ft int
62.Fo SSL_SESSION_get_ex_new_index
63.Fa "long argl"
64.Fa "void *argp"
65.Fa "CRYPTO_EX_new *new_func"
66.Fa "CRYPTO_EX_dup *dup_func"
67.Fa "CRYPTO_EX_free *free_func"
68.Fc
69.Ft int
70.Fn SSL_SESSION_set_ex_data "SSL_SESSION *session" "int idx" "void *arg"
71.Ft void *
72.Fn SSL_SESSION_get_ex_data "const SSL_SESSION *session" "int idx"
73.Bd -literal
74 typedef int new_func(void *parent, void *ptr, CRYPTO_EX_DATA *ad,
75 int idx, long argl, void *argp);
76 typedef void free_func(void *parent, void *ptr, CRYPTO_EX_DATA *ad,
77 int idx, long argl, void *argp);
78 typedef int dup_func(CRYPTO_EX_DATA *to, CRYPTO_EX_DATA *from, void *from_d,
79 int idx, long argl, void *argp);
80.Ed
81.Sh DESCRIPTION
82Several OpenSSL structures can have application specific data attached to them.
83These functions are used internally by OpenSSL to manipulate
84application-specific data attached to a specific structure.
85.Pp
86.Fn SSL_SESSION_get_ex_new_index
87is used to register a new index for application-specific data.
88.Pp
89.Fn SSL_SESSION_set_ex_data
90is used to store application data at
91.Fa arg
92for
93.Fa idx
94into the
95.Fa session
96object.
97.Pp
98.Fn SSL_SESSION_get_ex_data
99is used to retrieve the information for
100.Fa idx
101from
102.Fa session .
103.Pp
104A detailed description for the
105.Fn *_get_ex_new_index
106functionality
107can be found in
108.Xr RSA_get_ex_new_index 3 .
109The
110.Fn *_get_ex_data
111and
112.Fn *_set_ex_data
113functionality is described in
114.Xr CRYPTO_set_ex_data 3 .
115.Sh WARNINGS
116The application data is only maintained for sessions held in memory.
117The application data is not included when dumping the session with
118.Xr i2d_SSL_SESSION 3
119(and all functions indirectly calling the dump functions like
120.Xr PEM_write_SSL_SESSION 3
121and
122.Xr PEM_write_bio_SSL_SESSION 3 )
123and can therefore not be restored.
124.Sh SEE ALSO
125.Xr CRYPTO_set_ex_data 3 ,
126.Xr RSA_get_ex_new_index 3 ,
127.Xr ssl 3
128.Sh HISTORY
129.Fn SSL_SESSION_get_ex_new_index ,
130.Fn SSL_SESSION_set_ex_data ,
131and
132.Fn SSL_SESSION_get_ex_data
133first appeared in SSLeay 0.9.0 and have been available since
134.Ox 2.4 .
diff --git a/src/lib/libssl/man/SSL_SESSION_get_id.3 b/src/lib/libssl/man/SSL_SESSION_get_id.3
deleted file mode 100644
index 6d0de1e52e..0000000000
--- a/src/lib/libssl/man/SSL_SESSION_get_id.3
+++ /dev/null
@@ -1,112 +0,0 @@
1.\" $OpenBSD: SSL_SESSION_get_id.3,v 1.6 2018/03/24 00:55:37 schwarze Exp $
2.\" full merge up to:
3.\" OpenSSL SSL_SESSION_set1_id 17b60280 Dec 21 09:08:25 2017 +0100
4.\"
5.\" This file was written by Remi Gacogne <rgacogne-github@coredump.fr>
6.\" and Matt Caswell <matt@openssl.org>.
7.\" Copyright (c) 2016, 2017 The OpenSSL Project. All rights reserved.
8.\"
9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions
11.\" are met:
12.\"
13.\" 1. Redistributions of source code must retain the above copyright
14.\" notice, this list of conditions and the following disclaimer.
15.\"
16.\" 2. Redistributions in binary form must reproduce the above copyright
17.\" notice, this list of conditions and the following disclaimer in
18.\" the documentation and/or other materials provided with the
19.\" distribution.
20.\"
21.\" 3. All advertising materials mentioning features or use of this
22.\" software must display the following acknowledgment:
23.\" "This product includes software developed by the OpenSSL Project
24.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
25.\"
26.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
27.\" endorse or promote products derived from this software without
28.\" prior written permission. For written permission, please contact
29.\" openssl-core@openssl.org.
30.\"
31.\" 5. Products derived from this software may not be called "OpenSSL"
32.\" nor may "OpenSSL" appear in their names without prior written
33.\" permission of the OpenSSL Project.
34.\"
35.\" 6. Redistributions of any form whatsoever must retain the following
36.\" acknowledgment:
37.\" "This product includes software developed by the OpenSSL Project
38.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
39.\"
40.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
41.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
42.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
43.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
44.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
45.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
46.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
47.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
49.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
50.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
51.\" OF THE POSSIBILITY OF SUCH DAMAGE.
52.\"
53.Dd $Mdocdate: March 24 2018 $
54.Dt SSL_SESSION_GET_ID 3
55.Os
56.Sh NAME
57.Nm SSL_SESSION_get_id ,
58.Nm SSL_SESSION_set1_id
59.Nd get and set the SSL session ID
60.Sh SYNOPSIS
61.In openssl/ssl.h
62.Ft const unsigned char *
63.Fo SSL_SESSION_get_id
64.Fa "const SSL_SESSION *s"
65.Fa "unsigned int *len"
66.Fc
67.Ft int
68.Fo SSL_SESSION_set1_id
69.Fa "SSL_SESSION *s"
70.Fa "const unsigned char *sid"
71.Fa "unsigned int sid_len"
72.Fc
73.Sh DESCRIPTION
74.Fn SSL_SESSION_get_id
75returns a pointer to the internal session ID value for the session
76.Fa s .
77The length of the ID in bytes is stored in
78.Pf * Fa len .
79The length may be 0.
80The caller should not free the returned pointer directly.
81.Pp
82.Fn SSL_SESSION_set1_id
83sets the session ID for
84.Fa s
85to a copy of the
86.Fa sid
87of length
88.Fa sid_len .
89.Sh RETURN VALUES
90.Fn SSL_SESSION_get_id
91returns a pointer to the session ID value.
92.Pp
93.Fn SSL_SESSION_set1_id
94returns 1 for success and 0 for failure,
95for example if the supplied session ID length exceeds
96.Dv SSL_MAX_SSL_SESSION_ID_LENGTH .
97.Sh SEE ALSO
98.Xr ssl 3 ,
99.Xr SSL_copy_session_id 3 ,
100.Xr SSL_get_session 3 ,
101.Xr SSL_SESSION_get_compress_id 3 ,
102.Xr SSL_SESSION_get_protocol_version 3 ,
103.Xr SSL_SESSION_has_ticket 3 ,
104.Xr SSL_SESSION_new 3
105.Sh HISTORY
106.Fn SSL_SESSION_get_id
107first appeared in OpenSSL 0.9.8 and has been available since
108.Ox 4.5 .
109.Pp
110.Fn SSL_SESSION_set1_id
111first appeared in OpenSSL 1.1.0 and has been available since
112.Ox 6.3 .
diff --git a/src/lib/libssl/man/SSL_SESSION_get_protocol_version.3 b/src/lib/libssl/man/SSL_SESSION_get_protocol_version.3
deleted file mode 100644
index f14c0490e9..0000000000
--- a/src/lib/libssl/man/SSL_SESSION_get_protocol_version.3
+++ /dev/null
@@ -1,84 +0,0 @@
1.\" $OpenBSD: SSL_SESSION_get_protocol_version.3,v 1.2 2018/03/24 00:55:37 schwarze Exp $
2.\" full merge up to: OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3.\"
4.\" This file was written by TJ Saunders <tj@castaglia.org>
5.\" Copyright (c) 2016 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: March 24 2018 $
52.Dt SSL_SESSION_GET_PROTOCOL_VERSION 3
53.Os
54.Sh NAME
55.Nm SSL_SESSION_get_protocol_version
56.Nd get the session protocol version
57.Sh SYNOPSIS
58.In openssl/ssl.h
59.Ft int
60.Fo SSL_SESSION_get_protocol_version
61.Fa "const SSL_SESSION *s"
62.Fc
63.Sh DESCRIPTION
64.Fn SSL_SESSION_get_protocol_version
65returns the protocol version number used by the session
66.Fa s .
67.Sh RETURN VALUES
68.Fn SSL_SESSION_get_protocol_version
69returns a constant like
70.Dv TLS1_VERSION
71or
72.Dv TLS1_2_VERSION .
73.Sh SEE ALSO
74.Xr ssl 3 ,
75.Xr SSL_get_session 3 ,
76.Xr SSL_SESSION_get0_peer 3 ,
77.Xr SSL_SESSION_get_compress_id 3 ,
78.Xr SSL_SESSION_get_id 3 ,
79.Xr SSL_SESSION_get_time 3 ,
80.Xr SSL_SESSION_new 3
81.Sh HISTORY
82.Fn SSL_SESSION_get_protocol_version
83first appeared in OpenSSL 1.1.0 and has been available since
84.Ox 6.3 .
diff --git a/src/lib/libssl/man/SSL_SESSION_get_time.3 b/src/lib/libssl/man/SSL_SESSION_get_time.3
deleted file mode 100644
index aaadec5137..0000000000
--- a/src/lib/libssl/man/SSL_SESSION_get_time.3
+++ /dev/null
@@ -1,165 +0,0 @@
1.\" $OpenBSD: SSL_SESSION_get_time.3,v 1.8 2019/06/08 15:25:43 schwarze Exp $
2.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
5.\" Copyright (c) 2001, 2005, 2006, 2016 The OpenSSL Project.
6.\" All rights reserved.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\"
12.\" 1. Redistributions of source code must retain the above copyright
13.\" notice, this list of conditions and the following disclaimer.
14.\"
15.\" 2. Redistributions in binary form must reproduce the above copyright
16.\" notice, this list of conditions and the following disclaimer in
17.\" the documentation and/or other materials provided with the
18.\" distribution.
19.\"
20.\" 3. All advertising materials mentioning features or use of this
21.\" software must display the following acknowledgment:
22.\" "This product includes software developed by the OpenSSL Project
23.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
24.\"
25.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
26.\" endorse or promote products derived from this software without
27.\" prior written permission. For written permission, please contact
28.\" openssl-core@openssl.org.
29.\"
30.\" 5. Products derived from this software may not be called "OpenSSL"
31.\" nor may "OpenSSL" appear in their names without prior written
32.\" permission of the OpenSSL Project.
33.\"
34.\" 6. Redistributions of any form whatsoever must retain the following
35.\" acknowledgment:
36.\" "This product includes software developed by the OpenSSL Project
37.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
38.\"
39.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
40.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
43.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50.\" OF THE POSSIBILITY OF SUCH DAMAGE.
51.\"
52.Dd $Mdocdate: June 8 2019 $
53.Dt SSL_SESSION_GET_TIME 3
54.Os
55.Sh NAME
56.Nm SSL_SESSION_get_time ,
57.Nm SSL_SESSION_set_time ,
58.Nm SSL_SESSION_get_timeout ,
59.Nm SSL_SESSION_set_timeout ,
60.Nm SSL_get_time ,
61.Nm SSL_set_time ,
62.Nm SSL_get_timeout ,
63.Nm SSL_set_timeout
64.Nd retrieve and manipulate session time and timeout settings
65.Sh SYNOPSIS
66.In openssl/ssl.h
67.Ft long
68.Fn SSL_SESSION_get_time "const SSL_SESSION *s"
69.Ft long
70.Fn SSL_SESSION_set_time "SSL_SESSION *s" "long tm"
71.Ft long
72.Fn SSL_SESSION_get_timeout "const SSL_SESSION *s"
73.Ft long
74.Fn SSL_SESSION_set_timeout "SSL_SESSION *s" "long tm"
75.Ft long
76.Fn SSL_get_time "const SSL_SESSION *s"
77.Ft long
78.Fn SSL_set_time "SSL_SESSION *s" "long tm"
79.Ft long
80.Fn SSL_get_timeout "const SSL_SESSION *s"
81.Ft long
82.Fn SSL_set_timeout "SSL_SESSION *s" "long tm"
83.Sh DESCRIPTION
84.Fn SSL_SESSION_get_time
85returns the time at which the session
86.Fa s
87was established.
88The time is given in seconds since the Epoch and therefore compatible to the
89time delivered by the
90.Xr time 3
91call.
92.Pp
93.Fn SSL_SESSION_set_time
94replaces the creation time of the session
95.Fa s
96with
97the chosen value
98.Fa tm .
99.Pp
100.Fn SSL_SESSION_get_timeout
101returns the timeout value set for session
102.Fa s
103in seconds.
104.Pp
105.Fn SSL_SESSION_set_timeout
106sets the timeout value for session
107.Fa s
108in seconds to
109.Fa tm .
110.Pp
111The
112.Fn SSL_get_time ,
113.Fn SSL_set_time ,
114.Fn SSL_get_timeout ,
115and
116.Fn SSL_set_timeout
117functions are synonyms for the
118.Fn SSL_SESSION_*
119counterparts.
120.Pp
121Sessions are expired by examining the creation time and the timeout value.
122Both are set at creation time of the session to the actual time and the default
123timeout value at creation, respectively, as set by
124.Xr SSL_CTX_set_timeout 3 .
125Using these functions it is possible to extend or shorten the lifetime of the
126session.
127.Sh RETURN VALUES
128.Fn SSL_SESSION_get_time
129and
130.Fn SSL_SESSION_get_timeout
131return the currently valid values.
132.Pp
133.Fn SSL_SESSION_set_time
134and
135.Fn SSL_SESSION_set_timeout
136return 1 on success.
137.Pp
138If any of the function is passed the
139.Dv NULL
140pointer for the session
141.Fa s ,
1420 is returned.
143.Sh SEE ALSO
144.Xr ssl 3 ,
145.Xr SSL_CTX_set_timeout 3 ,
146.Xr SSL_get_default_timeout 3 ,
147.Xr SSL_get_session 3 ,
148.Xr SSL_SESSION_has_ticket 3 ,
149.Xr SSL_SESSION_new 3
150.Sh HISTORY
151.Fn SSL_get_time ,
152.Fn SSL_get_timeout ,
153and
154.Fn SSL_set_timeout
155appeared in SSLeay 0.4 or earlier.
156.Fn SSL_set_time
157first appeared in SSLeay 0.5.2.
158.Fn SSL_SESSION_get_time ,
159.Fn SSL_SESSION_set_time ,
160.Fn SSL_SESSION_get_timeout ,
161and
162.Fn SSL_SESSION_set_timeout
163first appeared in SSLeay 0.9.0.
164All these functions have been available since
165.Ox 2.4 .
diff --git a/src/lib/libssl/man/SSL_SESSION_has_ticket.3 b/src/lib/libssl/man/SSL_SESSION_has_ticket.3
deleted file mode 100644
index 322b49feef..0000000000
--- a/src/lib/libssl/man/SSL_SESSION_has_ticket.3
+++ /dev/null
@@ -1,85 +0,0 @@
1.\" $OpenBSD: SSL_SESSION_has_ticket.3,v 1.2 2018/03/24 00:55:37 schwarze Exp $
2.\" full merge up to: OpenSSL f2baac27 Feb 8 15:43:16 2015 +0000
3.\" selective merge up to: OpenSSL 61f805c1 Jan 16 01:01:46 2018 +0800
4.\"
5.\" This file was written by Matt Caswell <matt@openssl.org>.
6.\" Copyright (c) 2015 The OpenSSL Project. All rights reserved.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\"
12.\" 1. Redistributions of source code must retain the above copyright
13.\" notice, this list of conditions and the following disclaimer.
14.\"
15.\" 2. Redistributions in binary form must reproduce the above copyright
16.\" notice, this list of conditions and the following disclaimer in
17.\" the documentation and/or other materials provided with the
18.\" distribution.
19.\"
20.\" 3. All advertising materials mentioning features or use of this
21.\" software must display the following acknowledgment:
22.\" "This product includes software developed by the OpenSSL Project
23.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
24.\"
25.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
26.\" endorse or promote products derived from this software without
27.\" prior written permission. For written permission, please contact
28.\" openssl-core@openssl.org.
29.\"
30.\" 5. Products derived from this software may not be called "OpenSSL"
31.\" nor may "OpenSSL" appear in their names without prior written
32.\" permission of the OpenSSL Project.
33.\"
34.\" 6. Redistributions of any form whatsoever must retain the following
35.\" acknowledgment:
36.\" "This product includes software developed by the OpenSSL Project
37.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
38.\"
39.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
40.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
43.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50.\" OF THE POSSIBILITY OF SUCH DAMAGE.
51.\"
52.Dd $Mdocdate: March 24 2018 $
53.Dt SSL_SESSION_HAS_TICKET 3
54.Os
55.Sh NAME
56.Nm SSL_SESSION_has_ticket ,
57.Nm SSL_SESSION_get_ticket_lifetime_hint
58.Nd get details about the ticket associated with a session
59.Sh SYNOPSIS
60.In openssl/ssl.h
61.Ft int
62.Fo SSL_SESSION_has_ticket
63.Fa "const SSL_SESSION *s"
64.Fc
65.Ft unsigned long
66.Fo SSL_SESSION_get_ticket_lifetime_hint
67.Fa "const SSL_SESSION *s"
68.Fc
69.Sh DESCRIPTION
70.Fn SSL_SESSION_has_ticket
71returns 1 if there is a Session Ticket associated with
72.Fa s
73or 0 otherwise.
74.Pp
75.Fn SSL_SESSION_get_ticket_lifetime_hint
76returns the lifetime hint in seconds associated with the session ticket.
77.Sh SEE ALSO
78.Xr ssl 3 ,
79.Xr SSL_SESSION_get_id 3 ,
80.Xr SSL_SESSION_get_time 3 ,
81.Xr SSL_SESSION_new 3
82.Sh HISTORY
83These functions first appeared in OpenSSL 1.1.0
84and have been available since
85.Ox 6.3 .
diff --git a/src/lib/libssl/man/SSL_SESSION_is_resumable.3 b/src/lib/libssl/man/SSL_SESSION_is_resumable.3
deleted file mode 100644
index 48d7d17889..0000000000
--- a/src/lib/libssl/man/SSL_SESSION_is_resumable.3
+++ /dev/null
@@ -1,81 +0,0 @@
1.\" $OpenBSD: SSL_SESSION_is_resumable.3,v 1.1 2021/09/14 14:08:15 schwarze Exp $
2.\" full merge up to: OpenSSL df75c2bf Dec 9 01:02:36 2018 +0100
3.\"
4.\" This file was written by Matt Caswell <matt@openssl.org>.
5.\" Copyright (c) 2017 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: September 14 2021 $
52.Dt SSL_SESSION_IS_RESUMABLE 3
53.Os
54.Sh NAME
55.Nm SSL_SESSION_is_resumable
56.Nd determine whether an SSL_SESSION object can be used for resumption
57.Sh SYNOPSIS
58.In openssl/ssl.h
59.Ft int
60.Fo SSL_SESSION_is_resumable
61.Fa "const SSL_SESSION *session"
62.Fc
63.Sh DESCRIPTION
64.Fn SSL_SESSION_is_resumable
65determines whether the
66.Fa session
67object can be used to resume a session.
68Note that attempting to resume with a non-resumable session
69will result in a full handshake.
70.Sh RETURN VALUES
71.Fn SSL_SESSION_is_resumable
72returns 1 if the session is resumable or 0 otherwise.
73It always returns 0 with LibreSSL.
74.Sh SEE ALSO
75.Xr ssl 3 ,
76.Xr SSL_CTX_sess_set_new_cb 3 ,
77.Xr SSL_get_session 3
78.Sh HISTORY
79.Fn SSL_SESSION_is_resumable
80first appeared in OpenSSL 1.1.1 and has been available since
81.Ox 7.0 .
diff --git a/src/lib/libssl/man/SSL_SESSION_new.3 b/src/lib/libssl/man/SSL_SESSION_new.3
deleted file mode 100644
index 2dcdb264c1..0000000000
--- a/src/lib/libssl/man/SSL_SESSION_new.3
+++ /dev/null
@@ -1,78 +0,0 @@
1.\" $OpenBSD: SSL_SESSION_new.3,v 1.9 2021/09/14 14:08:15 schwarze Exp $
2.\"
3.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd $Mdocdate: September 14 2021 $
18.Dt SSL_SESSION_NEW 3
19.Os
20.Sh NAME
21.Nm SSL_SESSION_new
22.Nd construct a new SSL_SESSION object
23.Sh SYNOPSIS
24.In openssl/ssl.h
25.Ft SSL_SESSION *
26.Fn SSL_SESSION_new void
27.Sh DESCRIPTION
28.Fn SSL_SESSION_new
29allocates and initializes a new
30.Vt SSL_SESSION
31object.
32The reference count is set to 1, the time to the current time, and
33the timeout to five minutes.
34.Pp
35When the object is no longer needed, it can be destructed with
36.Xr SSL_SESSION_free 3 .
37.Pp
38.Fn SSL_SESSION_new
39is used internally, for example by
40.Xr SSL_connect 3 .
41.Sh RETURN VALUES
42.Fn SSL_SESSION_new
43returns the new
44.Vt SSL_SESSION
45object or
46.Dv NULL
47if insufficient memory is available.
48.Pp
49After failure,
50.Xr ERR_get_error 3
51returns
52.Dv ERR_R_MALLOC_FAILURE .
53.Sh SEE ALSO
54.Xr d2i_SSL_SESSION 3 ,
55.Xr PEM_read_SSL_SESSION 3 ,
56.Xr ssl 3 ,
57.Xr SSL_connect 3 ,
58.Xr SSL_copy_session_id 3 ,
59.Xr SSL_CTX_add_session 3 ,
60.Xr SSL_CTX_sess_set_get_cb 3 ,
61.Xr SSL_get_session 3 ,
62.Xr SSL_SESSION_free 3 ,
63.Xr SSL_SESSION_get0_peer 3 ,
64.Xr SSL_SESSION_get_compress_id 3 ,
65.Xr SSL_SESSION_get_ex_new_index 3 ,
66.Xr SSL_SESSION_get_id 3 ,
67.Xr SSL_SESSION_get_master_key 3 ,
68.Xr SSL_SESSION_get_protocol_version 3 ,
69.Xr SSL_SESSION_get_time 3 ,
70.Xr SSL_SESSION_has_ticket 3 ,
71.Xr SSL_SESSION_is_resumable 3 ,
72.Xr SSL_SESSION_print 3 ,
73.Xr SSL_SESSION_set1_id_context 3 ,
74.Xr SSL_set_session 3
75.Sh HISTORY
76.Fn SSL_SESSION_new
77first appeared in SSLeay 0.5.2 and has been available since
78.Ox 2.4 .
diff --git a/src/lib/libssl/man/SSL_SESSION_print.3 b/src/lib/libssl/man/SSL_SESSION_print.3
deleted file mode 100644
index e92debde0e..0000000000
--- a/src/lib/libssl/man/SSL_SESSION_print.3
+++ /dev/null
@@ -1,74 +0,0 @@
1.\" $OpenBSD: SSL_SESSION_print.3,v 1.4 2019/06/12 09:36:30 schwarze Exp $
2.\"
3.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd $Mdocdate: June 12 2019 $
18.Dt SSL_SESSION_PRINT 3
19.Os
20.Sh NAME
21.Nm SSL_SESSION_print ,
22.Nm SSL_SESSION_print_fp
23.Nd print some properties of an SSL_SESSION object
24.Sh SYNOPSIS
25.In openssl/ssl.h
26.Ft int
27.Fo SSL_SESSION_print
28.Fa "BIO *bp"
29.Fa "const SSL_SESSION *session"
30.Fc
31.Ft int
32.Fo SSL_SESSION_print_fp
33.Fa "FILE *fp"
34.Fa "const SSL_SESSION *session"
35.Fc
36.Sh DESCRIPTION
37.Fn SSL_SESSION_print
38prints some properties of
39.Fa session
40in a human-readable format to the
41.Fa "BIO *bp" ,
42including protocol version, cipher name, session ID,
43session ID context, master key, session ticket lifetime hint,
44session ticket, start time, timeout, and verify return code.
45.Pp
46.Fn SSL_SESSION_print_fp
47does the same as
48.Fn SSL_SESSION_print
49except that it prints to the
50.Fa "FILE *fp" .
51.Sh RETURN VALUES
52.Fn SSL_SESSION_print
53and
54.Fn SSL_SESSION_print_fp
55return 1 for success or 0 for failure.
56.Pp
57In some cases, the reason for failure can be determined with
58.Xr ERR_get_error 3 .
59.Sh SEE ALSO
60.Xr d2i_SSL_SESSION 3 ,
61.Xr PEM_read_SSL_SESSION 3 ,
62.Xr ssl 3 ,
63.Xr SSL_get_session 3 ,
64.Xr SSL_SESSION_free 3 ,
65.Xr SSL_SESSION_get_ex_new_index 3 ,
66.Xr SSL_SESSION_get_time 3 ,
67.Xr SSL_SESSION_new 3
68.Sh HISTORY
69.Fn SSL_SESSION_print
70first appeared in SSLeay 0.5.2.
71.Fn SSL_SESSION_print_fp
72first appeared in SSLeay 0.6.0.
73Both functions have been available since
74.Ox 2.4 .
diff --git a/src/lib/libssl/man/SSL_SESSION_set1_id_context.3 b/src/lib/libssl/man/SSL_SESSION_set1_id_context.3
deleted file mode 100644
index dd7595baca..0000000000
--- a/src/lib/libssl/man/SSL_SESSION_set1_id_context.3
+++ /dev/null
@@ -1,113 +0,0 @@
1.\" $OpenBSD: SSL_SESSION_set1_id_context.3,v 1.4 2018/03/24 00:55:37 schwarze Exp $
2.\" full merge up to:
3.\" OpenSSL SSL_SESSION_get0_id_context b31db505 Mar 24 16:01:50 2017
4.\"
5.\" This file was written by Matt Caswell <matt@openssl.org>
6.\" Copyright (c) 2017 The OpenSSL Project. All rights reserved.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\"
12.\" 1. Redistributions of source code must retain the above copyright
13.\" notice, this list of conditions and the following disclaimer.
14.\"
15.\" 2. Redistributions in binary form must reproduce the above copyright
16.\" notice, this list of conditions and the following disclaimer in
17.\" the documentation and/or other materials provided with the
18.\" distribution.
19.\"
20.\" 3. All advertising materials mentioning features or use of this
21.\" software must display the following acknowledgment:
22.\" "This product includes software developed by the OpenSSL Project
23.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
24.\"
25.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
26.\" endorse or promote products derived from this software without
27.\" prior written permission. For written permission, please contact
28.\" openssl-core@openssl.org.
29.\"
30.\" 5. Products derived from this software may not be called "OpenSSL"
31.\" nor may "OpenSSL" appear in their names without prior written
32.\" permission of the OpenSSL Project.
33.\"
34.\" 6. Redistributions of any form whatsoever must retain the following
35.\" acknowledgment:
36.\" "This product includes software developed by the OpenSSL Project
37.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
38.\"
39.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
40.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
43.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50.\" OF THE POSSIBILITY OF SUCH DAMAGE.
51.\"
52.Dd $Mdocdate: March 24 2018 $
53.Dt SSL_SESSION_SET1_ID_CONTEXT 3
54.Os
55.Sh NAME
56.Nm SSL_SESSION_get0_id_context ,
57.Nm SSL_SESSION_set1_id_context
58.Nd get and set the SSL ID context associated with a session
59.Sh SYNOPSIS
60.In openssl/ssl.h
61.Ft const unsigned char *
62.Fo SSL_SESSION_get0_id_context
63.Fa "const SSL_SESSION *s"
64.Fa "unsigned int *len"
65.Fc
66.Ft int
67.Fo SSL_SESSION_set1_id_context
68.Fa "SSL_SESSION *s"
69.Fa "const unsigned char *sid_ctx"
70.Fa "unsigned int sid_ctx_len"
71.Fc
72.Sh DESCRIPTION
73.Fn SSL_SESSION_get0_id_context
74returns the ID context associated with
75.Fa s .
76The length of the ID context in bytes is written to
77.Pf * Fa len
78if
79.Fa len
80is not
81.Dv NULL .
82.Pp
83.Fn SSL_SESSION_set1_id_context
84takes a copy of the provided ID context given in
85.Fa sid_ctx
86and associates it with the session
87.Fa s .
88The length of the ID context is given by
89.Fa sid_ctx_len
90which must not exceed
91.Dv SSL_MAX_SID_CTX_LENGTH
92bytes.
93.Sh RETURN VALUES
94.Fn SSL_SESSION_get0_id_context
95returns an internal pointer to an object maintained within
96.Fa s
97that should not be freed by the caller.
98.Pp
99.Fn SSL_SESSION_set1_id_context
100returns 1 on success or 0 on error.
101.Sh SEE ALSO
102.Xr ssl 3 ,
103.Xr SSL_CTX_set_session_id_context 3 ,
104.Xr SSL_get_session 3 ,
105.Xr SSL_SESSION_new 3
106.Sh HISTORY
107.Fn SSL_SESSION_set1_id_context
108first appeared in OpenSSL 1.0.1 and has been available since
109.Ox 5.3 .
110.Pp
111.Fn SSL_SESSION_get0_id_context
112first appeared in OpenSSL 1.1.0 and has been available since
113.Ox 6.3 .
diff --git a/src/lib/libssl/man/SSL_accept.3 b/src/lib/libssl/man/SSL_accept.3
deleted file mode 100644
index fb1d89eb57..0000000000
--- a/src/lib/libssl/man/SSL_accept.3
+++ /dev/null
@@ -1,155 +0,0 @@
1.\" $OpenBSD: SSL_accept.3,v 1.6 2019/06/08 15:25:43 schwarze Exp $
2.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
5.\" Copyright (c) 2000, 2001, 2002, 2003 The OpenSSL Project.
6.\" All rights reserved.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\"
12.\" 1. Redistributions of source code must retain the above copyright
13.\" notice, this list of conditions and the following disclaimer.
14.\"
15.\" 2. Redistributions in binary form must reproduce the above copyright
16.\" notice, this list of conditions and the following disclaimer in
17.\" the documentation and/or other materials provided with the
18.\" distribution.
19.\"
20.\" 3. All advertising materials mentioning features or use of this
21.\" software must display the following acknowledgment:
22.\" "This product includes software developed by the OpenSSL Project
23.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
24.\"
25.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
26.\" endorse or promote products derived from this software without
27.\" prior written permission. For written permission, please contact
28.\" openssl-core@openssl.org.
29.\"
30.\" 5. Products derived from this software may not be called "OpenSSL"
31.\" nor may "OpenSSL" appear in their names without prior written
32.\" permission of the OpenSSL Project.
33.\"
34.\" 6. Redistributions of any form whatsoever must retain the following
35.\" acknowledgment:
36.\" "This product includes software developed by the OpenSSL Project
37.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
38.\"
39.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
40.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
43.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50.\" OF THE POSSIBILITY OF SUCH DAMAGE.
51.\"
52.Dd $Mdocdate: June 8 2019 $
53.Dt SSL_ACCEPT 3
54.Os
55.Sh NAME
56.Nm SSL_accept
57.Nd wait for a TLS/SSL client to initiate a TLS/SSL handshake
58.Sh SYNOPSIS
59.In openssl/ssl.h
60.Ft int
61.Fn SSL_accept "SSL *ssl"
62.Sh DESCRIPTION
63.Fn SSL_accept
64waits for a TLS/SSL client to initiate the TLS/SSL handshake.
65The communication channel must already have been set and assigned to the
66.Fa ssl
67object by setting an underlying
68.Vt BIO .
69.Pp
70The behaviour of
71.Fn SSL_accept
72depends on the underlying
73.Vt BIO .
74.Pp
75If the underlying
76.Vt BIO
77is
78.Em blocking ,
79.Fn SSL_accept
80will only return once the handshake has been finished or an error occurred.
81.Pp
82If the underlying
83.Vt BIO
84is
85.Em non-blocking ,
86.Fn SSL_accept
87will also return when the underlying
88.Vt BIO
89could not satisfy the needs of
90.Fn SSL_accept
91to continue the handshake, indicating the problem by the return value \(mi1.
92In this case a call to
93.Xr SSL_get_error 3
94with the
95return value of
96.Fn SSL_accept
97will yield
98.Dv SSL_ERROR_WANT_READ
99or
100.Dv SSL_ERROR_WANT_WRITE .
101The calling process then must repeat the call after taking appropriate action
102to satisfy the needs of
103.Fn SSL_accept .
104The action depends on the underlying
105.Dv BIO .
106When using a non-blocking socket, nothing is to be done, but
107.Xr select 2
108can be used to check for the required condition.
109When using a buffering
110.Vt BIO ,
111like a
112.Vt BIO
113pair, data must be written into or retrieved out of the
114.Vt BIO
115before being able to continue.
116.Sh RETURN VALUES
117The following return values can occur:
118.Bl -tag -width Ds
119.It 0
120The TLS/SSL handshake was not successful but was shut down controlled and by
121the specifications of the TLS/SSL protocol.
122Call
123.Xr SSL_get_error 3
124with the return value
125.Fa ret
126to find out the reason.
127.It 1
128The TLS/SSL handshake was successfully completed,
129and a TLS/SSL connection has been established.
130.It <0
131The TLS/SSL handshake was not successful because a fatal error occurred either
132at the protocol level or a connection failure occurred.
133The shutdown was not clean.
134It can also occur of action is need to continue the operation for non-blocking
135.Vt BIO Ns
136s.
137Call
138.Xr SSL_get_error 3
139with the return value
140.Fa ret
141to find out the reason.
142.El
143.Sh SEE ALSO
144.Xr BIO_new 3 ,
145.Xr ssl 3 ,
146.Xr SSL_connect 3 ,
147.Xr SSL_CTX_new 3 ,
148.Xr SSL_do_handshake 3 ,
149.Xr SSL_get_error 3 ,
150.Xr SSL_set_connect_state 3 ,
151.Xr SSL_shutdown 3
152.Sh HISTORY
153.Fn SSL_accept
154appeared in SSLeay 0.4 or earlier and has been available since
155.Ox 2.4 .
diff --git a/src/lib/libssl/man/SSL_alert_type_string.3 b/src/lib/libssl/man/SSL_alert_type_string.3
deleted file mode 100644
index 354865e546..0000000000
--- a/src/lib/libssl/man/SSL_alert_type_string.3
+++ /dev/null
@@ -1,253 +0,0 @@
1.\" $OpenBSD: SSL_alert_type_string.3,v 1.7 2024/10/13 08:25:09 jsg Exp $
2.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
5.\" Copyright (c) 2001, 2011 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: October 13 2024 $
52.Dt SSL_ALERT_TYPE_STRING 3
53.Os
54.Sh NAME
55.Nm SSL_alert_type_string ,
56.Nm SSL_alert_type_string_long ,
57.Nm SSL_alert_desc_string ,
58.Nm SSL_alert_desc_string_long
59.Nd get textual description of alert information
60.Sh SYNOPSIS
61.In openssl/ssl.h
62.Ft const char *
63.Fn SSL_alert_type_string "int value"
64.Ft const char *
65.Fn SSL_alert_type_string_long "int value"
66.Ft const char *
67.Fn SSL_alert_desc_string "int value"
68.Ft const char *
69.Fn SSL_alert_desc_string_long "int value"
70.Sh DESCRIPTION
71.Fn SSL_alert_type_string
72returns a one letter string indicating the type of the alert specified by
73.Fa value .
74.Pp
75.Fn SSL_alert_type_string_long
76returns a string indicating the type of the alert specified by
77.Fa value .
78.Pp
79.Fn SSL_alert_desc_string
80returns a two letter string as a short form describing the reason of the alert
81specified by
82.Fa value .
83.Pp
84.Fn SSL_alert_desc_string_long
85returns a string describing the reason of the alert specified by
86.Fa value .
87.Pp
88When one side of an SSL/TLS communication wants to inform the peer about
89a special situation, it sends an alert.
90The alert is sent as a special message and does not influence the normal data
91stream (unless its contents results in the communication being canceled).
92.Pp
93A warning alert is sent, when a non-fatal error condition occurs.
94The
95.Dq close notify
96alert is sent as a warning alert.
97Other examples for non-fatal errors are certificate errors
98.Po
99.Dq certificate expired ,
100.Dq unsupported certificate
101.Pc ,
102for which a warning alert may be sent.
103(The sending party may, however, decide to send a fatal error.)
104The receiving side may cancel the connection on reception of a warning alert at
105its discretion.
106.Pp
107Several alert messages must be sent as fatal alert messages as specified
108by the TLS RFC.
109A fatal alert always leads to a connection abort.
110.Sh RETURN VALUES
111The following strings can occur for
112.Fn SSL_alert_type_string
113or
114.Fn SSL_alert_type_string_long :
115.Bl -tag -width Ds
116.It \(dqW\(dq/\(dqwarning\(dq
117.It \(dqF\(dq/\(dqfatal\(dq
118.It \(dqU\(dq/\(dqunknown\(dq
119This indicates that no support is available for this alert type.
120Probably
121.Fa value
122does not contain a correct alert message.
123.El
124.Pp
125The following strings can occur for
126.Fn SSL_alert_desc_string
127or
128.Fn SSL_alert_desc_string_long :
129.Bl -tag -width Ds
130.It \(dqCN\(dq/\(dqclose notify\(dq
131The connection shall be closed.
132This is a warning alert.
133.It \(dqUM\(dq/\(dqunexpected message\(dq
134An inappropriate message was received.
135This alert is always fatal and should never be observed in communication
136between proper implementations.
137.It \(dqBM\(dq/\(dqbad record mac\(dq
138This alert is returned if a record is received with an incorrect MAC.
139This message is always fatal.
140.It \(dqDF\(dq/\(dqdecompression failure\(dq
141The decompression function received improper input
142(e.g., data that would expand to excessive length).
143This message is always fatal.
144.It \(dqHF\(dq/\(dqhandshake failure\(dq
145Reception of a handshake_failure alert message indicates that the sender was
146unable to negotiate an acceptable set of security parameters given the options
147available.
148This is a fatal error.
149.It \(dqNC\(dq/\(dqno certificate\(dq
150A client, that was asked to send a certificate, does not send a certificate
151(SSLv3 only).
152.It \(dqBC\(dq/\(dqbad certificate\(dq
153A certificate was corrupt, contained signatures that did not verify correctly,
154etc.
155.It \(dqUC\(dq/\(dqunsupported certificate\(dq
156A certificate was of an unsupported type.
157.It \(dqCR\(dq/\(dqcertificate revoked\(dq
158A certificate was revoked by its signer.
159.It \(dqCE\(dq/\(dqcertificate expired\(dq
160A certificate has expired or is not currently valid.
161.It \(dqCU\(dq/\(dqcertificate unknown\(dq
162Some other (unspecified) issue arose in processing the certificate,
163rendering it unacceptable.
164.It \(dqIP\(dq/\(dqillegal parameter\(dq
165A field in the handshake was out of range or inconsistent with other fields.
166This is always fatal.
167.It \(dqDC\(dq/\(dqdecryption failed\(dq
168A TLSCiphertext decrypted in an invalid way: either it wasn't an even multiple
169of the block length or its padding values, when checked, weren't correct.
170This message is always fatal.
171.It \(dqRO\(dq/\(dqrecord overflow\(dq
172A TLSCiphertext record was received which had a length more than
1732^14+2048 bytes, or a record decrypted to a TLSCompressed record with more than
1742^14+1024 bytes.
175This message is always fatal.
176.It \(dqCA\(dq/\(dqunknown CA\(dq
177A valid certificate chain or partial chain was received,
178but the certificate was not accepted because the CA certificate could not be
179located or couldn't be matched with a known, trusted CA.
180This message is always fatal.
181.It \(dqAD\(dq/\(dqaccess denied\(dq
182A valid certificate was received, but when access control was applied,
183the sender decided not to proceed with negotiation.
184This message is always fatal.
185.It \(dqDE\(dq/\(dqdecode error\(dq
186A message could not be decoded because some field was out of the specified
187range or the length of the message was incorrect.
188This message is always fatal.
189.It \(dqCY\(dq/\(dqdecrypt error\(dq
190A handshake cryptographic operation failed, including being unable to correctly
191verify a signature, decrypt a key exchange, or validate a finished message.
192.It \(dqER\(dq/\(dqexport restriction\(dq
193A negotiation not in compliance with export restrictions was detected;
194for example, attempting to transfer a 1024 bit ephemeral RSA key for the
195RSA_EXPORT handshake method.
196This message is always fatal.
197.It \(dqPV\(dq/\(dqprotocol version\(dq
198The protocol version the client has attempted to negotiate is recognized,
199but not supported.
200(For example, old protocol versions might be avoided for security reasons.)
201This message is always fatal.
202.It \(dqIS\(dq/\(dqinsufficient security\(dq
203Returned instead of handshake_failure when a negotiation has failed
204specifically because the server requires ciphers more secure than those
205supported by the client.
206This message is always fatal.
207.It \(dqIE\(dq/\(dqinternal error\(dq
208An internal error unrelated to the peer or the correctness of the protocol
209makes it impossible to continue (such as a memory allocation failure).
210This message is always fatal.
211.It \(dqIF\(dq/\(dqinappropriate fallback\(dq
212Sent by a server in response to an invalid connection retry attempt from
213a client (see RFC 7507).
214.It \(dqUS\(dq/\(dquser canceled\(dq
215This handshake is being canceled for some reason unrelated to a protocol
216failure.
217If the user cancels an operation after the handshake is complete,
218just closing the connection by sending a close_notify is more appropriate.
219This alert should be followed by a close_notify.
220This message is generally a warning.
221.It \(dqNR\(dq/\(dqno renegotiation\(dq
222Sent by the client in response to a hello request or by the server in response
223to a client hello after initial handshaking.
224Either of these would normally lead to renegotiation; when that is not
225appropriate, the recipient should respond with this alert; at that point,
226the original requester can decide whether to proceed with the connection.
227One case where this would be appropriate would be where a server has spawned a
228process to satisfy a request; the process might receive security parameters
229(key length, authentication, etc.) at startup and it might be difficult to
230communicate changes to these parameters after that point.
231This message is always a warning.
232.It \(dqUP\(dq/\(dqunknown PSK identity\(dq
233Sent by the server to indicate that it does not recognize a PSK identity or an
234SRP identity.
235.It \(dqCQ\(dq/\(dqcertificate required\(dq
236Sent by servers when a client certificate is desired but none was provided
237by the client.
238.It \(dqAP\(dq/\(dqno application protocol\(dq
239Sent by servers when a client ALPN extension advertises only protocols that
240the server does not support (see RFC 7301).
241.It \(dqUK\(dq/\(dqunknown\(dq
242This indicates that no description is available for this alert type.
243Probably
244.Fa value
245does not contain a correct alert message.
246.El
247.Sh SEE ALSO
248.Xr ssl 3 ,
249.Xr SSL_CTX_set_info_callback 3
250.Sh HISTORY
251These functions first appeared in SSLeay 0.8.0
252and have been available since
253.Ox 2.4 .
diff --git a/src/lib/libssl/man/SSL_clear.3 b/src/lib/libssl/man/SSL_clear.3
deleted file mode 100644
index 809c3b20f4..0000000000
--- a/src/lib/libssl/man/SSL_clear.3
+++ /dev/null
@@ -1,144 +0,0 @@
1.\" $OpenBSD: SSL_clear.3,v 1.5 2021/06/11 19:41:39 jmc Exp $
2.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
5.\" Copyright (c) 2000, 2001, 2002, 2011, 2015 The OpenSSL Project.
6.\" All rights reserved.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\"
12.\" 1. Redistributions of source code must retain the above copyright
13.\" notice, this list of conditions and the following disclaimer.
14.\"
15.\" 2. Redistributions in binary form must reproduce the above copyright
16.\" notice, this list of conditions and the following disclaimer in
17.\" the documentation and/or other materials provided with the
18.\" distribution.
19.\"
20.\" 3. All advertising materials mentioning features or use of this
21.\" software must display the following acknowledgment:
22.\" "This product includes software developed by the OpenSSL Project
23.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
24.\"
25.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
26.\" endorse or promote products derived from this software without
27.\" prior written permission. For written permission, please contact
28.\" openssl-core@openssl.org.
29.\"
30.\" 5. Products derived from this software may not be called "OpenSSL"
31.\" nor may "OpenSSL" appear in their names without prior written
32.\" permission of the OpenSSL Project.
33.\"
34.\" 6. Redistributions of any form whatsoever must retain the following
35.\" acknowledgment:
36.\" "This product includes software developed by the OpenSSL Project
37.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
38.\"
39.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
40.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
43.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50.\" OF THE POSSIBILITY OF SUCH DAMAGE.
51.\"
52.Dd $Mdocdate: June 11 2021 $
53.Dt SSL_CLEAR 3
54.Os
55.Sh NAME
56.Nm SSL_clear
57.Nd reset SSL object to allow another connection
58.Sh SYNOPSIS
59.In openssl/ssl.h
60.Ft int
61.Fn SSL_clear "SSL *ssl"
62.Sh DESCRIPTION
63Reset
64.Fa ssl
65to allow another connection.
66All settings (method, ciphers, BIOs) are kept.
67.Pp
68.Fn SSL_clear
69is used to prepare an
70.Vt SSL
71object for a new connection.
72While all settings are kept,
73a side effect is the handling of the current SSL session.
74If a session is still
75.Em open ,
76it is considered bad and will be removed from the session cache,
77as required by RFC 2246.
78A session is considered open if
79.Xr SSL_shutdown 3
80was not called for the connection or at least
81.Xr SSL_set_shutdown 3
82was used to
83set the
84.Dv SSL_SENT_SHUTDOWN
85state.
86.Pp
87If a session was closed cleanly,
88the session object will be kept and all settings corresponding.
89This explicitly means that for example the special method used during the
90session will be kept for the next handshake.
91So if the session was a TLSv1 session, a
92.Vt SSL
93client object will use a TLSv1 client method for the next handshake and a
94.Vt SSL
95server object will use a TLSv1 server method, even if
96.Fn TLS_*_method Ns s
97were chosen on startup.
98This might lead to connection failures (see
99.Xr SSL_new 3 )
100for a description of the method's properties.
101.Sh RETURN VALUES
102The following return values can occur:
103.Bl -tag -width Ds
104.It 0
105The
106.Fn SSL_clear
107operation could not be performed.
108Check the error stack to find out the reason.
109.It 1
110The
111.Fn SSL_clear
112operation was successful.
113.El
114.Sh SEE ALSO
115.Xr ssl 3 ,
116.Xr SSL_CTX_set_client_cert_cb 3 ,
117.Xr SSL_CTX_set_options 3 ,
118.Xr SSL_free 3 ,
119.Xr SSL_new 3 ,
120.Xr SSL_set_shutdown 3 ,
121.Xr SSL_shutdown 3
122.Sh HISTORY
123.Fn SSL_clear
124first appeared in SSLeay 0.4.5b and has been available since
125.Ox 2.4 .
126.Sh CAVEATS
127.Fn SSL_clear
128resets the
129.Vt SSL
130object to allow for another connection.
131The reset operation however keeps several settings of the last sessions
132(some of these settings were made automatically during the last handshake).
133It only makes sense for a new connection with the exact same peer that shares
134these settings,
135and may fail if that peer changes its settings between connections.
136Use the sequence
137.Xr SSL_get_session 3 ;
138.Xr SSL_new 3 ;
139.Xr SSL_set_session 3 ;
140.Xr SSL_free 3
141instead to avoid such failures (or simply
142.Xr SSL_free 3 ;
143.Xr SSL_new 3
144if session reuse is not desired).
diff --git a/src/lib/libssl/man/SSL_connect.3 b/src/lib/libssl/man/SSL_connect.3
deleted file mode 100644
index d5b962a480..0000000000
--- a/src/lib/libssl/man/SSL_connect.3
+++ /dev/null
@@ -1,154 +0,0 @@
1.\" $OpenBSD: SSL_connect.3,v 1.6 2018/03/27 17:35:50 schwarze Exp $
2.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
5.\" Copyright (c) 2000, 2001, 2002, 2003 The OpenSSL Project.
6.\" All rights reserved.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\"
12.\" 1. Redistributions of source code must retain the above copyright
13.\" notice, this list of conditions and the following disclaimer.
14.\"
15.\" 2. Redistributions in binary form must reproduce the above copyright
16.\" notice, this list of conditions and the following disclaimer in
17.\" the documentation and/or other materials provided with the
18.\" distribution.
19.\"
20.\" 3. All advertising materials mentioning features or use of this
21.\" software must display the following acknowledgment:
22.\" "This product includes software developed by the OpenSSL Project
23.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
24.\"
25.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
26.\" endorse or promote products derived from this software without
27.\" prior written permission. For written permission, please contact
28.\" openssl-core@openssl.org.
29.\"
30.\" 5. Products derived from this software may not be called "OpenSSL"
31.\" nor may "OpenSSL" appear in their names without prior written
32.\" permission of the OpenSSL Project.
33.\"
34.\" 6. Redistributions of any form whatsoever must retain the following
35.\" acknowledgment:
36.\" "This product includes software developed by the OpenSSL Project
37.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
38.\"
39.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
40.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
43.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50.\" OF THE POSSIBILITY OF SUCH DAMAGE.
51.\"
52.Dd $Mdocdate: March 27 2018 $
53.Dt SSL_CONNECT 3
54.Os
55.Sh NAME
56.Nm SSL_connect
57.Nd initiate the TLS/SSL handshake with a TLS/SSL server
58.Sh SYNOPSIS
59.In openssl/ssl.h
60.Ft int
61.Fn SSL_connect "SSL *ssl"
62.Sh DESCRIPTION
63.Fn SSL_connect
64initiates the TLS/SSL handshake with a server.
65The communication channel must already have been set and assigned to the
66.Fa ssl
67by setting an underlying
68.Vt BIO .
69.Pp
70The behaviour of
71.Fn SSL_connect
72depends on the underlying
73.Vt BIO .
74.Pp
75If the underlying
76.Vt BIO
77is
78.Em blocking ,
79.Fn SSL_connect
80will only return once the handshake has been finished or an error occurred.
81.Pp
82If the underlying
83.Vt BIO
84is
85.Em non-blocking ,
86.Fn SSL_connect
87will also return when the underlying
88.Vt BIO
89could not satisfy the needs of
90.Fn SSL_connect
91to continue the handshake, indicating the problem with the return value \(mi1.
92In this case a call to
93.Xr SSL_get_error 3
94with the return value of
95.Fn SSL_connect
96will yield
97.Dv SSL_ERROR_WANT_READ
98or
99.Dv SSL_ERROR_WANT_WRITE .
100The calling process then must repeat the call after taking appropriate action
101to satisfy the needs of
102.Fn SSL_connect .
103The action depends on the underlying
104.Vt BIO .
105When using a non-blocking socket, nothing is to be done, but
106.Xr select 2
107can be used to check for the required condition.
108When using a buffering
109.Vt BIO ,
110like a
111.Vt BIO
112pair, data must be written into or retrieved out of the
113.Vt BIO
114before being able to continue.
115.Sh RETURN VALUES
116The following return values can occur:
117.Bl -tag -width Ds
118.It 0
119The TLS/SSL handshake was not successful but was shut down controlled and
120by the specifications of the TLS/SSL protocol.
121Call
122.Xr SSL_get_error 3
123with the return value
124.Fa ret
125to find out the reason.
126.It 1
127The TLS/SSL handshake was successfully completed,
128and a TLS/SSL connection has been established.
129.It <0
130The TLS/SSL handshake was not successful, because either a fatal error occurred
131at the protocol level or a connection failure occurred.
132The shutdown was not clean.
133It can also occur if action is needed to continue the operation for
134non-blocking
135.Vt BIO Ns s .
136Call
137.Xr SSL_get_error 3
138with the return value
139.Fa ret
140to find out the reason.
141.El
142.Sh SEE ALSO
143.Xr BIO_new 3 ,
144.Xr ssl 3 ,
145.Xr SSL_accept 3 ,
146.Xr SSL_CTX_new 3 ,
147.Xr SSL_do_handshake 3 ,
148.Xr SSL_get_error 3 ,
149.Xr SSL_set_connect_state 3 ,
150.Xr SSL_shutdown 3
151.Sh HISTORY
152.Fn SSL_connect
153appeared in SSLeay 0.4 or earlier and has been available since
154.Ox 2.4 .
diff --git a/src/lib/libssl/man/SSL_copy_session_id.3 b/src/lib/libssl/man/SSL_copy_session_id.3
deleted file mode 100644
index a7a7a8aa99..0000000000
--- a/src/lib/libssl/man/SSL_copy_session_id.3
+++ /dev/null
@@ -1,79 +0,0 @@
1.\" $OpenBSD: SSL_copy_session_id.3,v 1.7 2019/06/12 09:36:30 schwarze Exp $
2.\"
3.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd $Mdocdate: June 12 2019 $
18.Dt SSL_COPY_SESSION_ID 3
19.Os
20.Sh NAME
21.Nm SSL_copy_session_id
22.Nd copy session details between SSL objects
23.Sh SYNOPSIS
24.In openssl/ssl.h
25.Ft int
26.Fo SSL_copy_session_id
27.Fa "SSL *to"
28.Fa "const SSL *from"
29.Fc
30.Sh DESCRIPTION
31.Fn SSL_copy_session_id
32copies the following data from
33.Fa from
34to
35.Fa to :
36.Bl -dash
37.It
38the pointer to the
39.Vt SSL_SESSION
40object, incrementing its reference count by 1
41.It
42the pointer to the
43.Vt SSL_METHOD
44object; if that changes the method, protocol-specific data is
45reinitialized
46.It
47the pointer to the
48.Vt CERT
49object, incrementing its reference count by 1
50.It
51the session ID context
52.El
53.Pp
54This function is used internally by
55.Xr SSL_dup 3
56and by
57.Xr BIO_ssl_copy_session_id 3 .
58.Sh RETURN VALUES
59.Fn SSL_copy_session_id
60returns 1 on success and 0 on error.
61.Sh SEE ALSO
62.Xr BIO_ssl_copy_session_id 3 ,
63.Xr ssl 3 ,
64.Xr SSL_dup 3 ,
65.Xr SSL_get_session 3 ,
66.Xr SSL_SESSION_get_id 3 ,
67.Xr SSL_SESSION_new 3 ,
68.Xr SSL_set_session 3 ,
69.Xr SSL_set_session_id_context 3
70.Sh HISTORY
71.Fn SSL_copy_session_id
72appeared in SSLeay 0.4 or earlier and has been available since
73.Ox 2.4 .
74.Sh BUGS
75Failures of
76.Xr CRYPTO_add 3
77are silently ignored and may leave
78.Fa to
79in an invalid or inconsistent state.
diff --git a/src/lib/libssl/man/SSL_do_handshake.3 b/src/lib/libssl/man/SSL_do_handshake.3
deleted file mode 100644
index e9327b4229..0000000000
--- a/src/lib/libssl/man/SSL_do_handshake.3
+++ /dev/null
@@ -1,152 +0,0 @@
1.\" $OpenBSD: SSL_do_handshake.3,v 1.6 2018/03/27 17:35:50 schwarze Exp $
2.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3.\"
4.\" This file was written by Martin Sjoegren <martin@strakt.com>.
5.\" Copyright (c) 2002 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: March 27 2018 $
52.Dt SSL_DO_HANDSHAKE 3
53.Os
54.Sh NAME
55.Nm SSL_do_handshake
56.Nd perform a TLS/SSL handshake
57.Sh SYNOPSIS
58.In openssl/ssl.h
59.Ft int
60.Fn SSL_do_handshake "SSL *ssl"
61.Sh DESCRIPTION
62.Fn SSL_do_handshake
63will wait for a SSL/TLS handshake to take place.
64If the connection is in client mode, the handshake will be started.
65The handshake routines may have to be explicitly set in advance using either
66.Xr SSL_set_connect_state 3
67or
68.Xr SSL_set_accept_state 3 .
69.Pp
70The behaviour of
71.Fn SSL_do_handshake
72depends on the underlying
73.Vt BIO .
74.Pp
75If the underlying
76.Vt BIO
77is
78.Em blocking ,
79.Fn SSL_do_handshake
80will only return once the handshake has been finished or an error occurred.
81.Pp
82If the underlying
83.Vt BIO
84is
85.Em non-blocking ,
86.Fn SSL_do_handshake
87will also return when the underlying
88.Vt BIO
89could not satisfy the needs of
90.Fn SSL_do_handshake
91to continue the handshake.
92In this case a call to
93.Xr SSL_get_error 3
94with the return value of
95.Fn SSL_do_handshake
96will yield
97.Dv SSL_ERROR_WANT_READ
98or
99.Dv SSL_ERROR_WANT_WRITE .
100The calling process then must repeat the call after taking appropriate action
101to satisfy the needs of
102.Fn SSL_do_handshake .
103The action depends on the underlying
104.Vt BIO .
105When using a non-blocking socket, nothing is to be done, but
106.Xr select 2
107can be used to check for the required condition.
108When using a buffering
109.Vt BIO ,
110like a
111.Vt BIO
112pair, data must be written into or retrieved out of the
113.Vt BIO
114before being able to continue.
115.Sh RETURN VALUES
116The following return values can occur:
117.Bl -tag -width Ds
118.It 0
119The TLS/SSL handshake was not successful but was shut down controlled and
120by the specifications of the TLS/SSL protocol.
121Call
122.Xr SSL_get_error 3
123with the return value
124.Fa ret
125to find out the reason.
126.It 1
127The TLS/SSL handshake was successfully completed,
128and a TLS/SSL connection has been established.
129.It <0
130The TLS/SSL handshake was not successful because either a fatal error occurred
131at the protocol level or a connection failure occurred.
132The shutdown was not clean.
133It can also occur if action is needed to continue the operation for
134non-blocking
135.Vt BIO Ns s .
136Call
137.Xr SSL_get_error 3
138with the return value
139.Fa ret
140to find out the reason.
141.El
142.Sh SEE ALSO
143.Xr BIO_new 3 ,
144.Xr ssl 3 ,
145.Xr SSL_accept 3 ,
146.Xr SSL_connect 3 ,
147.Xr SSL_get_error 3 ,
148.Xr SSL_set_connect_state 3
149.Sh HISTORY
150.Fn SSL_do_handshake
151first appeared in SSLeay 0.8.0 and has been available since
152.Ox 2.4 .
diff --git a/src/lib/libssl/man/SSL_dup.3 b/src/lib/libssl/man/SSL_dup.3
deleted file mode 100644
index a83440b431..0000000000
--- a/src/lib/libssl/man/SSL_dup.3
+++ /dev/null
@@ -1,62 +0,0 @@
1.\" $OpenBSD: SSL_dup.3,v 1.5 2022/07/13 22:05:53 schwarze Exp $
2.\"
3.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd $Mdocdate: July 13 2022 $
18.Dt SSL_DUP 3
19.Os
20.Sh NAME
21.Nm SSL_dup
22.Nd deep copy of an SSL object
23.Sh SYNOPSIS
24.In openssl/ssl.h
25.Ft SSL *
26.Fo SSL_dup
27.Fa "SSL *ssl"
28.Fc
29.Sh DESCRIPTION
30.Fn SSL_dup
31constructs a new
32.Vt SSL
33object in the same context as
34.Fa ssl
35and copies much of the contained data from
36.Fa ssl
37to the new
38.Vt SSL
39object, but many fields, for example tlsext data, are not copied.
40.Pp
41As an exception from deep copying, if a session is already established,
42the new object shares
43.Fa ssl->cert
44with the original object.
45.Sh RETURN VALUES
46.Fn SSL_dup
47returns the new
48.Vt SSL
49object or
50.Dv NULL
51on failure.
52.Sh SEE ALSO
53.Xr ssl 3 ,
54.Xr SSL_clear 3 ,
55.Xr SSL_copy_session_id 3 ,
56.Xr SSL_free 3 ,
57.Xr SSL_new 3 ,
58.Xr SSL_set_security_level 3
59.Sh HISTORY
60.Fn SSL_dup
61first appeared in SSLeay 0.8.0 and has been available since
62.Ox 2.4 .
diff --git a/src/lib/libssl/man/SSL_dup_CA_list.3 b/src/lib/libssl/man/SSL_dup_CA_list.3
deleted file mode 100644
index d073b07176..0000000000
--- a/src/lib/libssl/man/SSL_dup_CA_list.3
+++ /dev/null
@@ -1,54 +0,0 @@
1.\" $OpenBSD: SSL_dup_CA_list.3,v 1.6 2019/06/12 09:36:30 schwarze Exp $
2.\"
3.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd $Mdocdate: June 12 2019 $
18.Dt SSL_DUP_CA_LIST 3
19.Os
20.Sh NAME
21.Nm SSL_dup_CA_list
22.Nd deep copy of a stack of X.509 Name objects
23.\" The capital "N" in "Name" is intentional (X.509 syntax).
24.Sh SYNOPSIS
25.Ft STACK_OF(X509_NAME) *
26.Fo SSL_dup_CA_list
27.Fa "const STACK_OF(X509_NAME) *sk"
28.Fc
29.Sh DESCRIPTION
30.Fn SSL_dup_CA_list
31constructs a new
32.Vt STACK_OF(X509_NAME)
33object and places copies of all the
34.Vt X509_NAME
35objects found on
36.Fa sk
37on it.
38.Sh RETURN VALUES
39.Fn SSL_dup_CA_list
40returns the new
41.Vt STACK_OF(X509_NAME)
42or
43.Dv NULL
44on failure.
45.Sh SEE ALSO
46.Xr ssl 3 ,
47.Xr SSL_CTX_set_client_CA_list 3 ,
48.Xr SSL_get_client_CA_list 3 ,
49.Xr SSL_load_client_CA_file 3 ,
50.Xr X509_NAME_new 3
51.Sh HISTORY
52.Fn SSL_dup_CA_list
53first appeared in SSLeay 0.8.0 and has been available since
54.Ox 2.4 .
diff --git a/src/lib/libssl/man/SSL_export_keying_material.3 b/src/lib/libssl/man/SSL_export_keying_material.3
deleted file mode 100644
index e32a5c5d61..0000000000
--- a/src/lib/libssl/man/SSL_export_keying_material.3
+++ /dev/null
@@ -1,133 +0,0 @@
1.\" $OpenBSD: SSL_export_keying_material.3,v 1.3 2019/06/12 09:36:30 schwarze Exp $
2.\" OpenSSL a599574b Jun 28 17:18:27 2017 +0100
3.\" OpenSSL 23cec1f4 Jun 21 13:55:02 2017 +0100
4.\"
5.\" This file was written by Matt Caswell <matt@openssl.org>.
6.\" Copyright (c) 2017 The OpenSSL Project. All rights reserved.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\"
12.\" 1. Redistributions of source code must retain the above copyright
13.\" notice, this list of conditions and the following disclaimer.
14.\"
15.\" 2. Redistributions in binary form must reproduce the above copyright
16.\" notice, this list of conditions and the following disclaimer in
17.\" the documentation and/or other materials provided with the
18.\" distribution.
19.\"
20.\" 3. All advertising materials mentioning features or use of this
21.\" software must display the following acknowledgment:
22.\" "This product includes software developed by the OpenSSL Project
23.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
24.\"
25.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
26.\" endorse or promote products derived from this software without
27.\" prior written permission. For written permission, please contact
28.\" openssl-core@openssl.org.
29.\"
30.\" 5. Products derived from this software may not be called "OpenSSL"
31.\" nor may "OpenSSL" appear in their names without prior written
32.\" permission of the OpenSSL Project.
33.\"
34.\" 6. Redistributions of any form whatsoever must retain the following
35.\" acknowledgment:
36.\" "This product includes software developed by the OpenSSL Project
37.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
38.\"
39.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
40.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
43.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50.\" OF THE POSSIBILITY OF SUCH DAMAGE.
51.\"
52.Dd $Mdocdate: June 12 2019 $
53.Dt SSL_EXPORT_KEYING_MATERIAL 3
54.Os
55.Sh NAME
56.Nm SSL_export_keying_material
57.Nd obtain keying material for application use
58.Sh SYNOPSIS
59.In openssl/ssl.h
60.Ft int
61.Fo SSL_export_keying_material
62.Fa "SSL *s"
63.Fa "unsigned char *out"
64.Fa "size_t olen"
65.Fa "const char *label"
66.Fa "size_t llen"
67.Fa "const unsigned char *context"
68.Fa "size_t contextlen"
69.Fa "int use_context"
70.Fc
71.Sh DESCRIPTION
72During the creation of a TLS or DTLS connection,
73shared keying material is established between the two endpoints.
74The function
75.Fn SSL_export_keying_material
76enables an application to use some of this keying material
77for its own purposes in accordance with RFC 5705.
78.Pp
79An application may need to securely establish the context
80within which this keying material will be used.
81For example, this may include identifiers for the application session,
82application algorithms or parameters, or the lifetime of the context.
83The context value is left to the application but must be the same on
84both sides of the communication.
85.Pp
86For a given SSL connection
87.Fa s ,
88.Fa olen
89bytes of data will be written to
90.Fa out .
91The application specific context should be supplied
92in the location pointed to by
93.Fa context
94and should be
95.Fa contextlen
96bytes long.
97Provision of a context is optional.
98If the context should be omitted entirely, then
99.Fa use_context
100should be set to 0.
101Otherwise it should be any other value.
102If
103.Fa use_context
104is 0, then the values of
105.Fa context
106and
107.Fa contextlen
108are ignored.
109.Pp
110In TLSv1.2 and below, a zero length context is treated differently
111from no context at all, and will result in different keying material
112being returned.
113.Pp
114An application specific label should be provided in the location pointed
115to by
116.Fa label
117and should be
118.Fa llen
119bytes long.
120Typically this will be a value from the
121.Lk https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#exporter-labels "IANA Exporter Label Registry" .
122.Pp
123Alternatively, labels beginning with "EXPERIMENTAL" are permitted by the
124standard to be used without registration.
125.Sh RETURN VALUES
126.Fn SSL_export_keying_material
127returns 1 on success or 0 or -1 on failure.
128.Sh SEE ALSO
129.Xr ssl 3
130.Sh HISTORY
131.Fn SSL_export_keying_material
132first appeared in OpenSSL 1.0.1 and has been available since
133.Ox 5.3 .
diff --git a/src/lib/libssl/man/SSL_free.3 b/src/lib/libssl/man/SSL_free.3
deleted file mode 100644
index c713ded121..0000000000
--- a/src/lib/libssl/man/SSL_free.3
+++ /dev/null
@@ -1,115 +0,0 @@
1.\" $OpenBSD: SSL_free.3,v 1.6 2021/06/11 19:41:39 jmc Exp $
2.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
5.\" Copyright (c) 2000, 2001 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: June 11 2021 $
52.Dt SSL_FREE 3
53.Os
54.Sh NAME
55.Nm SSL_free
56.Nd free an allocated SSL structure
57.Sh SYNOPSIS
58.In openssl/ssl.h
59.Ft void
60.Fn SSL_free "SSL *ssl"
61.Sh DESCRIPTION
62.Fn SSL_free
63decrements the reference count of
64.Fa ssl ,
65and removes the
66.Vt SSL
67structure pointed to by
68.Fa ssl
69and frees up the allocated memory if the reference count has reached 0.
70If
71.Fa ssl
72is a
73.Dv NULL
74pointer, no action occurs.
75.Pp
76.Fn SSL_free
77also calls the
78.Xr free 3 Ns
79ing procedures for indirectly affected items, if applicable: the buffering
80.Vt BIO ,
81the read and write
82.Vt BIOs ,
83cipher lists specially created for this
84.Fa ssl ,
85the
86.Sy SSL_SESSION .
87Do not explicitly free these indirectly freed up items before or after calling
88.Fn SSL_free ,
89as trying to free things twice may lead to program failure.
90.Pp
91The
92.Fa ssl
93session has reference counts from two users: the
94.Vt SSL
95object, for which the reference count is removed by
96.Fn SSL_free
97and the internal session cache.
98If the session is considered bad, because
99.Xr SSL_shutdown 3
100was not called for the connection and
101.Xr SSL_set_shutdown 3
102was not used to set the
103.Vt SSL_SENT_SHUTDOWN
104state, the session will also be removed from the session cache as required by
105RFC 2246.
106.Sh SEE ALSO
107.Xr ssl 3 ,
108.Xr SSL_clear 3 ,
109.Xr SSL_new 3 ,
110.Xr SSL_set_shutdown 3 ,
111.Xr SSL_shutdown 3
112.Sh HISTORY
113.Fn SSL_free
114appeared in SSLeay 0.4 or earlier and has been available since
115.Ox 2.4 .
diff --git a/src/lib/libssl/man/SSL_get_SSL_CTX.3 b/src/lib/libssl/man/SSL_get_SSL_CTX.3
deleted file mode 100644
index 60fda555bc..0000000000
--- a/src/lib/libssl/man/SSL_get_SSL_CTX.3
+++ /dev/null
@@ -1,79 +0,0 @@
1.\" $OpenBSD: SSL_get_SSL_CTX.3,v 1.4 2018/03/27 17:35:50 schwarze Exp $
2.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
5.\" Copyright (c) 2001, 2005 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: March 27 2018 $
52.Dt SSL_GET_SSL_CTX 3
53.Os
54.Sh NAME
55.Nm SSL_get_SSL_CTX
56.Nd get the SSL_CTX from which an SSL is created
57.Sh SYNOPSIS
58.In openssl/ssl.h
59.Ft SSL_CTX *
60.Fn SSL_get_SSL_CTX "const SSL *ssl"
61.Sh DESCRIPTION
62.Fn SSL_get_SSL_CTX
63returns a pointer to the
64.Vt SSL_CTX
65object from which
66.Fa ssl
67was created with
68.Xr SSL_new 3 .
69.Sh RETURN VALUES
70The pointer to the
71.Vt SSL_CTX
72object is returned.
73.Sh SEE ALSO
74.Xr ssl 3 ,
75.Xr SSL_new 3
76.Sh HISTORY
77.Fn SSL_get_SSL_CTX
78first appeared in SSLeay 0.5.1 and has been available since
79.Ox 2.4 .
diff --git a/src/lib/libssl/man/SSL_get_certificate.3 b/src/lib/libssl/man/SSL_get_certificate.3
deleted file mode 100644
index eb53ea49bf..0000000000
--- a/src/lib/libssl/man/SSL_get_certificate.3
+++ /dev/null
@@ -1,64 +0,0 @@
1.\" $OpenBSD: SSL_get_certificate.3,v 1.5 2019/06/12 09:36:30 schwarze Exp $
2.\"
3.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd $Mdocdate: June 12 2019 $
18.Dt SSL_GET_CERTIFICATE 3
19.Os
20.Sh NAME
21.Nm SSL_get_certificate ,
22.Nm SSL_get_privatekey
23.Nd get SSL certificate and private key
24.Sh SYNOPSIS
25.In openssl/ssl.h
26.Ft X509 *
27.Fo SSL_get_certificate
28.Fa "const SSL *ssl"
29.Fc
30.Ft EVP_PKEY *
31.Fo SSL_get_privatekey
32.Fa "const SSL *ssl"
33.Fc
34.Sh DESCRIPTION
35These functions retrieve certificate and key data from an
36.Vt SSL
37object.
38They return internal pointers that must not be freed by the application
39program.
40.Sh RETURN VALUES
41.Fn SSL_get_certificate
42returns the active X.509 certificate currently used by
43.Fa ssl
44or
45.Dv NULL
46if none is active.
47.Pp
48.Fn SSL_get_privatekey
49returns the active private key currently used by
50.Fa ssl
51or
52.Dv NULL
53if none is active.
54.Sh SEE ALSO
55.Xr ssl 3 ,
56.Xr SSL_check_private_key 3 ,
57.Xr SSL_use_certificate 3
58.Sh HISTORY
59.Fn SSL_get_certificate
60first appeared in SSLeay 0.5.2a.
61.Fn SSL_get_privatekey
62first appeared in SSLeay 0.8.0.
63Both functions have been available since
64.Ox 2.4 .
diff --git a/src/lib/libssl/man/SSL_get_ciphers.3 b/src/lib/libssl/man/SSL_get_ciphers.3
deleted file mode 100644
index 8030f0bbb1..0000000000
--- a/src/lib/libssl/man/SSL_get_ciphers.3
+++ /dev/null
@@ -1,249 +0,0 @@
1.\" $OpenBSD: SSL_get_ciphers.3,v 1.11 2020/09/16 07:25:15 schwarze Exp $
2.\" full merge up to: OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3.\" selective merge up to: OpenSSL 83cf7abf May 29 13:07:08 2018 +0100
4.\"
5.\" This file is a derived work.
6.\" The changes are covered by the following Copyright and license:
7.\"
8.\" Copyright (c) 2020 Ingo Schwarze <schwarze@openbsd.org>
9.\"
10.\" Permission to use, copy, modify, and distribute this software for any
11.\" purpose with or without fee is hereby granted, provided that the above
12.\" copyright notice and this permission notice appear in all copies.
13.\"
14.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
15.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
16.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
17.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
18.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
19.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
20.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
21.\"
22.\" The original file was written by Lutz Jaenicke <jaenicke@openssl.org>,
23.\" Nick Mathewson <nickm@torproject.org>, Kurt Roeckx <kurt@roeckx.be>,
24.\" Kazuki Yamaguchi <k@rhe.jp>, and Benjamin Kaduk <bkaduk@akamai.com>.
25.\" Copyright (c) 2000, 2005, 2015, 2016, 2017 The OpenSSL Project.
26.\" All rights reserved.
27.\"
28.\" Redistribution and use in source and binary forms, with or without
29.\" modification, are permitted provided that the following conditions
30.\" are met:
31.\"
32.\" 1. Redistributions of source code must retain the above copyright
33.\" notice, this list of conditions and the following disclaimer.
34.\"
35.\" 2. Redistributions in binary form must reproduce the above copyright
36.\" notice, this list of conditions and the following disclaimer in
37.\" the documentation and/or other materials provided with the
38.\" distribution.
39.\"
40.\" 3. All advertising materials mentioning features or use of this
41.\" software must display the following acknowledgment:
42.\" "This product includes software developed by the OpenSSL Project
43.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
44.\"
45.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
46.\" endorse or promote products derived from this software without
47.\" prior written permission. For written permission, please contact
48.\" openssl-core@openssl.org.
49.\"
50.\" 5. Products derived from this software may not be called "OpenSSL"
51.\" nor may "OpenSSL" appear in their names without prior written
52.\" permission of the OpenSSL Project.
53.\"
54.\" 6. Redistributions of any form whatsoever must retain the following
55.\" acknowledgment:
56.\" "This product includes software developed by the OpenSSL Project
57.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
58.\"
59.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
60.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
61.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
62.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
63.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
64.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
65.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
66.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
67.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
68.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
69.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
70.\" OF THE POSSIBILITY OF SUCH DAMAGE.
71.\"
72.Dd $Mdocdate: September 16 2020 $
73.Dt SSL_GET_CIPHERS 3
74.Os
75.Sh NAME
76.Nm SSL_get_ciphers ,
77.Nm SSL_CTX_get_ciphers ,
78.Nm SSL_get1_supported_ciphers ,
79.Nm SSL_get_client_ciphers ,
80.Nm SSL_get_cipher_list
81.Nd get lists of available SSL_CIPHERs
82.Sh SYNOPSIS
83.In openssl/ssl.h
84.Ft STACK_OF(SSL_CIPHER) *
85.Fn SSL_get_ciphers "const SSL *ssl"
86.Ft STACK_OF(SSL_CIPHER) *
87.Fn SSL_CTX_get_ciphers "const SSL_CTX *ctx"
88.Ft STACK_OF(SSL_CIPHER) *
89.Fn SSL_get1_supported_ciphers "SSL *ssl"
90.Ft STACK_OF(SSL_CIPHER) *
91.Fn SSL_get_client_ciphers "const SSL *ssl"
92.Ft const char *
93.Fn SSL_get_cipher_list "const SSL *ssl" "int priority"
94.Sh DESCRIPTION
95.Fn SSL_get_ciphers
96returns the stack of available
97.Vt SSL_CIPHER Ns s
98for
99.Fa ssl ,
100sorted by preference.
101.Pp
102.Fn SSL_CTX_get_ciphers
103returns the stack of available
104.Vt SSL_CIPHER Ns s
105for
106.Fa ctx .
107.Pp
108.Fn SSL_get1_supported_ciphers
109returns a stack of enabled
110.Vt SSL_CIPHER Ns s
111for
112.Fa ssl
113as it would be sent in a ClientHello, sorted by preference.
114The list depends on settings like the cipher list, the supported
115protocol versions, the security level, and the enabled signature
116algorithms.
117The list of ciphers that would be sent in a ClientHello can differ
118from the list of ciphers that would be acceptable when acting as a
119server.
120For example,
121additional ciphers may be usable by a server if there is a gap in the
122list of supported protocols, and some ciphers may not be usable by a
123server if there is not a suitable certificate configured.
124.Pp
125.Fn SSL_get_client_ciphers
126returns the stack of available
127.Vt SSL_CIPHER Ns s
128matching the list received from the client on
129.Fa ssl .
130.Pp
131The details of the ciphers obtained by
132.Fn SSL_get_ciphers ,
133.Fn SSL_CTX_get_ciphers ,
134.Fn SSL_get1_supported_ciphers ,
135and
136.Fn SSL_get_client_ciphers
137can be obtained using the
138.Xr SSL_CIPHER_get_name 3
139family of functions.
140.Pp
141.Fn SSL_get_cipher_list
142is deprecated \(em use
143.Fn SSL_get_ciphers
144instead \(em and badly misnamed; it does not return a list
145but the name of one element of the return value of
146.Fn SSL_get_ciphers ,
147with the index given by the
148.Fa priority
149argument.
150Passing 0 selects the cipher with the highest priority.
151To iterate over all available ciphers in decreasing priority,
152repeatedly increment the argument by 1 until
153.Dv NULL
154is returned.
155.Sh RETURN VALUES
156.Fn SSL_get_ciphers
157returns an internal pointer to a list of ciphers or
158.Dv NULL
159if
160.Fa ssl
161is
162.Dv NULL
163or if no ciphers are available.
164The returned pointer may not only become invalid when
165.Fa ssl
166is destroyed or when
167.Xr SSL_set_cipher_list 3
168is called on it, but also when the
169.Vt SSL_CTX
170object in use by
171.Fa ssl
172at the time of the call is freed or when
173.Xr SSL_CTX_set_cipher_list 3
174is called on that context object.
175.Pp
176.Fn SSL_CTX_get_ciphers
177returns an internal pointer to a list of ciphers or
178.Dv NULL
179if
180.Fa ctx
181is
182.Dv NULL
183or if no ciphers are available.
184The returned pointer becomes invalid when
185.Fa ctx
186is destroyed or when
187.Xr SSL_CTX_set_cipher_list 3
188is called on it.
189.Pp
190.Fn SSL_get1_supported_ciphers
191returns a newly allocated list of ciphers or
192.Dv NULL
193if
194.Fa ssl
195is
196.Dv NULL ,
197if no ciphers are available, or if an error occurs.
198When the returned pointer is no longer needed, the caller is
199responsible for freeing it using
200.Fn sk_SSL_CIPHER_free .
201.Pp
202.Fn SSL_get_client_ciphers
203returns an internal pointer to a list of ciphers or
204.Dv NULL
205if
206.Fa ssl
207is
208.Dv NULL ,
209has no active session,
210or is not operating in server mode.
211The returned pointer becomes invalid when the
212.Vt SSL_SESSION
213object is destroyed, even if the
214.Fa ssl
215object remains valid.
216It may also become invalid in other circumstances,
217for example when processing a new ClientHello.
218.Pp
219.Fn SSL_get_cipher_list
220returns an internal pointer to a string or
221.Dv NULL
222if
223.Fa ssl
224is
225.Dv NULL ,
226if no ciphers are available, or if
227.Fa priority
228is greater than or equal to the number of available ciphers.
229.Sh SEE ALSO
230.Xr ssl 3 ,
231.Xr SSL_CIPHER_get_name 3 ,
232.Xr SSL_CTX_set_cipher_list 3
233.Sh HISTORY
234.Fn SSL_get_cipher_list
235first appeared in SSLeay 0.5.2.
236.Fn SSL_get_ciphers
237first appeared in SSLeay 0.8.0.
238Both functions have been available since
239.Ox 2.4 .
240.Pp
241.Fn SSL_CTX_get_ciphers
242first appeared in OpenSSL 1.1.0 and has been available since
243.Ox 6.3 .
244.Pp
245.Fn SSL_get1_supported_ciphers
246and
247.Fn SSL_get_client_ciphers
248first appeared in OpenSSL 1.1.0 and has been available since
249.Ox 6.5 .
diff --git a/src/lib/libssl/man/SSL_get_client_CA_list.3 b/src/lib/libssl/man/SSL_get_client_CA_list.3
deleted file mode 100644
index e80e5cb6f5..0000000000
--- a/src/lib/libssl/man/SSL_get_client_CA_list.3
+++ /dev/null
@@ -1,96 +0,0 @@
1.\" $OpenBSD: SSL_get_client_CA_list.3,v 1.5 2018/03/27 17:35:50 schwarze Exp $
2.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
5.\" Copyright (c) 2000, 2001, 2002, 2005 The OpenSSL Project.
6.\" All rights reserved.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\"
12.\" 1. Redistributions of source code must retain the above copyright
13.\" notice, this list of conditions and the following disclaimer.
14.\"
15.\" 2. Redistributions in binary form must reproduce the above copyright
16.\" notice, this list of conditions and the following disclaimer in
17.\" the documentation and/or other materials provided with the
18.\" distribution.
19.\"
20.\" 3. All advertising materials mentioning features or use of this
21.\" software must display the following acknowledgment:
22.\" "This product includes software developed by the OpenSSL Project
23.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
24.\"
25.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
26.\" endorse or promote products derived from this software without
27.\" prior written permission. For written permission, please contact
28.\" openssl-core@openssl.org.
29.\"
30.\" 5. Products derived from this software may not be called "OpenSSL"
31.\" nor may "OpenSSL" appear in their names without prior written
32.\" permission of the OpenSSL Project.
33.\"
34.\" 6. Redistributions of any form whatsoever must retain the following
35.\" acknowledgment:
36.\" "This product includes software developed by the OpenSSL Project
37.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
38.\"
39.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
40.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
43.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50.\" OF THE POSSIBILITY OF SUCH DAMAGE.
51.\"
52.Dd $Mdocdate: March 27 2018 $
53.Dt SSL_GET_CLIENT_CA_LIST 3
54.Os
55.Sh NAME
56.Nm SSL_get_client_CA_list ,
57.Nm SSL_CTX_get_client_CA_list
58.Nd get list of client CAs
59.Sh SYNOPSIS
60.In openssl/ssl.h
61.Ft STACK_OF(X509_NAME) *
62.Fn SSL_get_client_CA_list "const SSL *s"
63.Ft STACK_OF(X509_NAME) *
64.Fn SSL_CTX_get_client_CA_list "const SSL_CTX *ctx"
65.Sh DESCRIPTION
66.Fn SSL_CTX_get_client_CA_list
67returns the list of client CAs explicitly set for
68.Fa ctx
69using
70.Xr SSL_CTX_set_client_CA_list 3 .
71.Pp
72.Fn SSL_get_client_CA_list
73returns the list of client CAs explicitly set for
74.Fa ssl
75using
76.Fn SSL_set_client_CA_list
77or
78.Fa ssl Ns 's
79.Vt SSL_CTX
80object with
81.Xr SSL_CTX_set_client_CA_list 3 ,
82when in server mode.
83In client mode,
84.Fn SSL_get_client_CA_list
85returns the list of client CAs sent from the server, if any.
86.Sh SEE ALSO
87.Xr ssl 3 ,
88.Xr SSL_CTX_set_client_CA_list 3 ,
89.Xr SSL_CTX_set_client_cert_cb 3 ,
90.Xr X509_NAME_new 3
91.Sh HISTORY
92.Fn SSL_get_client_CA_list
93and
94.Fn SSL_CTX_get_client_CA_list
95first appeared in SSLeay 0.8.0 and have been available since
96.Ox 2.4 .
diff --git a/src/lib/libssl/man/SSL_get_client_random.3 b/src/lib/libssl/man/SSL_get_client_random.3
deleted file mode 100644
index eda74db355..0000000000
--- a/src/lib/libssl/man/SSL_get_client_random.3
+++ /dev/null
@@ -1,150 +0,0 @@
1.\" $OpenBSD: SSL_get_client_random.3,v 1.2 2018/03/24 00:55:37 schwarze Exp $
2.\" full merge up to: OpenSSL e9b77246 Jan 20 19:58:49 2017 +0100
3.\"
4.\" This file was written by Nick Mathewson <nickm@torproject.org>
5.\" Copyright (c) 2015 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: March 24 2018 $
52.Dt SSL_GET_CLIENT_RANDOM 3
53.Os
54.Sh NAME
55.Nm SSL_get_client_random ,
56.Nm SSL_get_server_random ,
57.Nm SSL_SESSION_get_master_key
58.Nd get internal TLS handshake random values and master key
59.Sh SYNOPSIS
60.In openssl/ssl.h
61.Ft size_t
62.Fo SSL_get_client_random
63.Fa "const SSL *ssl"
64.Fa "unsigned char *out"
65.Fa "size_t outlen"
66.Fc
67.Ft size_t
68.Fo SSL_get_server_random
69.Fa "const SSL *ssl"
70.Fa "unsigned char *out"
71.Fa "size_t outlen"
72.Fc
73.Ft size_t
74.Fo SSL_SESSION_get_master_key
75.Fa "const SSL_SESSION *session"
76.Fa "unsigned char *out"
77.Fa "size_t outlen"
78.Fc
79.Sh DESCRIPTION
80.Fn SSL_get_client_random
81extracts the random value that was sent from the client to the server
82during the initial TLS handshake.
83It copies at most
84.Fa outlen
85bytes of this value into the buffer
86.Fa out .
87If
88.Fa outlen
89is zero, nothing is copied.
90.Pp
91.Fn SSL_get_server_random
92behaves the same, but extracts the random value that was sent
93from the server to the client during the initial TLS handshake.
94.Pp
95.Fn SSL_SESSION_get_master_key
96behaves the same, but extracts the master secret used to guarantee the
97security of the TLS session.
98The security of the TLS session depends on keeping the master key
99secret: do not expose it, or any information about it, to anybody.
100To calculate another secret value that depends on the master secret,
101use
102.Xr SSL_export_keying_material 3
103instead.
104.Pp
105All these functions expose internal values from the TLS handshake,
106for use in low-level protocols.
107Avoid using them unless implementing a feature
108that requires access to the internal protocol details.
109.Pp
110Despite the names of
111.Fn SSL_get_client_random
112and
113.Fn SSL_get_server_random ,
114they are not random number generators.
115Instead, they return the mostly-random values that were already
116generated and used in the TLS protocol.
117.Pp
118In current versions of the TLS protocols,
119the length of client_random and server_random is always
120.Dv SSL3_RANDOM_SIZE
121bytes.
122Support for other
123.Fa outlen
124arguments is provided for the unlikely event that a future
125version or variant of TLS uses some other length.
126.Pp
127Finally, though the client_random and server_random values are called
128.Dq random ,
129many TLS implementations generate four bytes of those values
130based on their view of the current time.
131.Sh RETURN VALUES
132If
133.Fa outlen
134is greater than 0, these functions return the number of bytes
135actually copied, which is less than or equal to
136.Fa outlen .
137If
138.Fa outlen
139is 0, these functions return the maximum number of bytes they would
140copy \(em that is, the length of the underlying field.
141.Sh SEE ALSO
142.Xr ssl 3 ,
143.Xr SSL_export_keying_material 3 ,
144.Xr SSL_SESSION_get_id 3 ,
145.Xr SSL_SESSION_get_time 3 ,
146.Xr SSL_SESSION_new 3
147.Sh HISTORY
148These functions first appeared in OpenSSL 1.1.0
149and have been available since
150.Ox 6.3 .
diff --git a/src/lib/libssl/man/SSL_get_current_cipher.3 b/src/lib/libssl/man/SSL_get_current_cipher.3
deleted file mode 100644
index 6b951d03ca..0000000000
--- a/src/lib/libssl/man/SSL_get_current_cipher.3
+++ /dev/null
@@ -1,122 +0,0 @@
1.\" $OpenBSD: SSL_get_current_cipher.3,v 1.4 2018/03/27 17:35:50 schwarze Exp $
2.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
5.\" Copyright (c) 2000, 2005, 2016 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: March 27 2018 $
52.Dt SSL_GET_CURRENT_CIPHER 3
53.Os
54.Sh NAME
55.Nm SSL_get_current_cipher ,
56.Nm SSL_get_cipher ,
57.Nm SSL_get_cipher_name ,
58.Nm SSL_get_cipher_bits ,
59.Nm SSL_get_cipher_version
60.Nd get SSL_CIPHER of a connection
61.Sh SYNOPSIS
62.In openssl/ssl.h
63.Ft const SSL_CIPHER *
64.Fn SSL_get_current_cipher "const SSL *ssl"
65.Ft const char *
66.Fn SSL_get_cipher "const SSL *ssl"
67.Ft const char *
68.Fn SSL_get_cipher_name "const SSL *ssl"
69.Ft int
70.Fn SSL_get_cipher_bits "const SSL *ssl" "int *np"
71.Ft char *
72.Fn SSL_get_cipher_version "const SSL *ssl"
73.Sh DESCRIPTION
74.Fn SSL_get_current_cipher
75returns a pointer to an
76.Vt SSL_CIPHER
77object containing the description of the actually used cipher of a connection
78established with the
79.Fa ssl
80object.
81See
82.Xr SSL_CIPHER_get_name 3
83for more details.
84.Pp
85.Fn SSL_get_cipher_name
86obtains the name of the currently used cipher.
87.Fn SSL_get_cipher
88is identical to
89.Fn SSL_get_cipher_name .
90.Pp
91.Fn SSL_get_cipher_bits
92obtains the number of secret/algorithm bits used and
93.Fn SSL_get_cipher_version
94returns the protocol name.
95.Pp
96.Fn SSL_get_cipher ,
97.Fn SSL_get_cipher_name ,
98.Fn SSL_get_cipher_bits ,
99and
100.Fn SSL_get_cipher_version
101are implemented as macros.
102.Sh RETURN VALUES
103.Fn SSL_get_current_cipher
104returns the cipher actually used, or
105.Dv NULL
106if no session has been established.
107.Sh SEE ALSO
108.Xr ssl 3 ,
109.Xr SSL_CIPHER_get_name 3
110.Sh HISTORY
111.Fn SSL_get_cipher
112appeared in SSLeay 0.4 or earlier.
113.Fn SSL_get_cipher_bits
114first appeared in SSLeay 0.6.4.
115.Fn SSL_get_cipher_name
116and
117.Fn SSL_get_cipher_version
118first appeared in SSLeay 0.8.0.
119.Fn SSL_get_current_cipher
120first appeared in SSLeay 0.8.1.
121These functions have been available since
122.Ox 2.4 .
diff --git a/src/lib/libssl/man/SSL_get_default_timeout.3 b/src/lib/libssl/man/SSL_get_default_timeout.3
deleted file mode 100644
index 47737d8ee0..0000000000
--- a/src/lib/libssl/man/SSL_get_default_timeout.3
+++ /dev/null
@@ -1,85 +0,0 @@
1.\" $OpenBSD: SSL_get_default_timeout.3,v 1.4 2018/03/27 17:35:50 schwarze Exp $
2.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
5.\" Copyright (c) 2001, 2005 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: March 27 2018 $
52.Dt SSL_GET_DEFAULT_TIMEOUT 3
53.Os
54.Sh NAME
55.Nm SSL_get_default_timeout
56.Nd get default session timeout value
57.Sh SYNOPSIS
58.In openssl/ssl.h
59.Ft long
60.Fn SSL_get_default_timeout "const SSL *ssl"
61.Sh DESCRIPTION
62.Fn SSL_get_default_timeout
63returns the default timeout value assigned to
64.Vt SSL_SESSION
65objects negotiated for the protocol valid for
66.Fa ssl .
67.Pp
68Whenever a new session is negotiated, it is assigned a timeout value,
69after which it will not be accepted for session reuse.
70If the timeout value was not explicitly set using
71.Xr SSL_CTX_set_timeout 3 ,
72the hardcoded default timeout for the protocol will be used.
73.Pp
74.Fn SSL_get_default_timeout
75return this hardcoded value, which is 300 seconds for all currently supported
76protocols (SSLv2, SSLv3, and TLSv1).
77.Sh SEE ALSO
78.Xr ssl 3 ,
79.Xr SSL_CTX_flush_sessions 3 ,
80.Xr SSL_CTX_set_session_cache_mode 3 ,
81.Xr SSL_SESSION_get_time 3
82.Sh HISTORY
83.Fn SSL_get_default_timeout
84first appeared in SSLeay 0.8.0 and has been available since
85.Ox 2.4 .
diff --git a/src/lib/libssl/man/SSL_get_error.3 b/src/lib/libssl/man/SSL_get_error.3
deleted file mode 100644
index 5d325b3f56..0000000000
--- a/src/lib/libssl/man/SSL_get_error.3
+++ /dev/null
@@ -1,217 +0,0 @@
1.\" $OpenBSD: SSL_get_error.3,v 1.5 2018/04/29 07:37:01 guenther Exp $
2.\" OpenSSL a528d4f0 Oct 27 13:40:11 2015 -0400
3.\"
4.\" This file was written by Bodo Moeller <bodo@openssl.org>.
5.\" Copyright (c) 2000, 2001, 2002, 2005 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: April 29 2018 $
52.Dt SSL_GET_ERROR 3
53.Os
54.Sh NAME
55.Nm SSL_get_error
56.Nd obtain result code for TLS/SSL I/O operation
57.Sh SYNOPSIS
58.In openssl/ssl.h
59.Ft int
60.Fn SSL_get_error "const SSL *ssl" "int ret"
61.Sh DESCRIPTION
62.Fn SSL_get_error
63returns a result code (suitable for the C
64.Dq switch
65statement) for a preceding call to
66.Xr SSL_connect 3 ,
67.Xr SSL_accept 3 ,
68.Xr SSL_do_handshake 3 ,
69.Xr SSL_read 3 ,
70.Xr SSL_peek 3 ,
71or
72.Xr SSL_write 3
73on
74.Fa ssl .
75The value returned by that TLS/SSL I/O function must be passed to
76.Fn SSL_get_error
77in parameter
78.Fa ret .
79.Pp
80In addition to
81.Fa ssl
82and
83.Fa ret ,
84.Fn SSL_get_error
85inspects the current thread's OpenSSL error queue.
86Thus,
87.Fn SSL_get_error
88must be used in the same thread that performed the TLS/SSL I/O operation,
89and no other OpenSSL function calls should appear in between.
90The current thread's error queue must be empty before the TLS/SSL I/O operation
91is attempted, or
92.Fn SSL_get_error
93will not work reliably.
94.Sh RETURN VALUES
95The following return values can currently occur:
96.Bl -tag -width Ds
97.It Dv SSL_ERROR_NONE
98The TLS/SSL I/O operation completed.
99This result code is returned if and only if
100.Fa ret
101> 0.
102.It Dv SSL_ERROR_ZERO_RETURN
103The TLS/SSL connection has been closed.
104If the protocol version is SSL 3.0 or TLS 1.0, this result code is returned
105only if a closure alert has occurred in the protocol, i.e., if the connection
106has been closed cleanly.
107Note that in this case
108.Dv SSL_ERROR_ZERO_RETURN
109does not necessarily indicate that the underlying transport has been closed.
110.It Dv SSL_ERROR_WANT_READ , Dv SSL_ERROR_WANT_WRITE
111The operation did not complete;
112the same TLS/SSL I/O function should be called again later.
113If, by then, the underlying
114.Vt BIO
115has data available for reading (if the result code is
116.Dv SSL_ERROR_WANT_READ )
117or allows writing data
118.Pq Dv SSL_ERROR_WANT_WRITE ,
119then some TLS/SSL protocol progress will take place,
120i.e., at least part of a TLS/SSL record will be read or written.
121Note that the retry may again lead to a
122.Dv SSL_ERROR_WANT_READ
123or
124.Dv SSL_ERROR_WANT_WRITE
125condition.
126There is no fixed upper limit for the number of iterations that may be
127necessary until progress becomes visible at application protocol level.
128.Pp
129For socket
130.Fa BIO Ns
131s (e.g., when
132.Fn SSL_set_fd
133was used),
134.Xr select 2
135or
136.Xr poll 2
137on the underlying socket can be used to find out when the TLS/SSL I/O function
138should be retried.
139.Pp
140Caveat: Any TLS/SSL I/O function can lead to either of
141.Dv SSL_ERROR_WANT_READ
142and
143.Dv SSL_ERROR_WANT_WRITE .
144In particular,
145.Xr SSL_read 3
146or
147.Xr SSL_peek 3
148may want to write data and
149.Xr SSL_write 3
150may want
151to read data.
152This is mainly because TLS/SSL handshakes may occur at any time during the
153protocol (initiated by either the client or the server);
154.Xr SSL_read 3 ,
155.Xr SSL_peek 3 ,
156and
157.Xr SSL_write 3
158will handle any pending handshakes.
159.It Dv SSL_ERROR_WANT_CONNECT , Dv SSL_ERROR_WANT_ACCEPT
160The operation did not complete; the same TLS/SSL I/O function should be
161called again later.
162The underlying BIO was not connected yet to the peer and the call would block
163in
164.Xr connect 2 Ns / Ns
165.Xr accept 2 .
166The SSL function should be
167called again when the connection is established.
168These messages can only appear with a
169.Xr BIO_s_connect 3
170or
171.Xr BIO_s_accept 3
172.Vt BIO ,
173respectively.
174In order to find out when the connection has been successfully established,
175on many platforms
176.Xr select 2
177or
178.Xr poll 2
179for writing on the socket file descriptor can be used.
180.It Dv SSL_ERROR_WANT_X509_LOOKUP
181The operation did not complete because an application callback set by
182.Xr SSL_CTX_set_client_cert_cb 3
183has asked to be called again.
184The TLS/SSL I/O function should be called again later.
185Details depend on the application.
186.It Dv SSL_ERROR_SYSCALL
187Some I/O error occurred.
188The OpenSSL error queue may contain more information on the error.
189If the error queue is empty (i.e.,
190.Fn ERR_get_error
191returns 0),
192.Fa ret
193can be used to find out more about the error:
194If
195.Fa ret
196== 0, an
197.Dv EOF
198was observed that violates the protocol.
199If
200.Fa ret
201== \(mi1, the underlying
202.Vt BIO
203reported an
204I/O error (for socket I/O on Unix systems, consult
205.Dv errno
206for details).
207.It Dv SSL_ERROR_SSL
208A failure in the SSL library occurred, usually a protocol error.
209The OpenSSL error queue contains more information on the error.
210.El
211.Sh SEE ALSO
212.Xr err 3 ,
213.Xr ssl 3
214.Sh HISTORY
215.Fn SSL_get_error
216first appeared in SSLeay 0.8.0 and have been available since
217.Ox 2.4 .
diff --git a/src/lib/libssl/man/SSL_get_ex_data_X509_STORE_CTX_idx.3 b/src/lib/libssl/man/SSL_get_ex_data_X509_STORE_CTX_idx.3
deleted file mode 100644
index a249cda6ac..0000000000
--- a/src/lib/libssl/man/SSL_get_ex_data_X509_STORE_CTX_idx.3
+++ /dev/null
@@ -1,116 +0,0 @@
1.\" $OpenBSD: SSL_get_ex_data_X509_STORE_CTX_idx.3,v 1.5 2022/02/06 00:29:02 jsg Exp $
2.\" OpenSSL 9b86974e Aug 17 15:21:33 2015 -0400
3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
5.\" Copyright (c) 2001 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: February 6 2022 $
52.Dt SSL_GET_EX_DATA_X509_STORE_CTX_IDX 3
53.Os
54.Sh NAME
55.Nm SSL_get_ex_data_X509_STORE_CTX_idx
56.Nd get ex_data index to access SSL structure from X509_STORE_CTX
57.Sh SYNOPSIS
58.In openssl/ssl.h
59.Ft int
60.Fn SSL_get_ex_data_X509_STORE_CTX_idx void
61.Sh DESCRIPTION
62.Fn SSL_get_ex_data_X509_STORE_CTX_idx
63returns the index number under which the pointer to the
64.Vt SSL
65object is stored into the
66.Vt X509_STORE_CTX
67object.
68.Pp
69Whenever a
70.Vt X509_STORE_CTX
71object is created for the verification of the peer's certificate during a
72handshake, a pointer to the
73.Vt SSL
74object is stored into the
75.Vt X509_STORE_CTX
76object to identify the connection affected.
77To retrieve this pointer the
78.Xr X509_STORE_CTX_get_ex_data 3
79function can be used with the correct index.
80This index is globally the same for all
81.Vt X509_STORE_CTX
82objects and can be retrieved using
83.Fn SSL_get_ex_data_X509_STORE_CTX_idx .
84The index value is set when
85.Fn SSL_get_ex_data_X509_STORE_CTX_idx
86is first called either by the application program directly or indirectly during
87other SSL setup functions or during the handshake.
88.Pp
89The value depends on other index values defined for
90.Vt X509_STORE_CTX
91objects before the SSL index is created.
92.Sh RETURN VALUES
93.Bl -tag -width Ds
94.It \(>=0
95The index value to access the pointer.
96.It <0
97An error occurred, check the error stack for a detailed error message.
98.El
99.Sh EXAMPLES
100The index returned from
101.Fn SSL_get_ex_data_X509_STORE_CTX_idx
102provides access to
103.Vt SSL
104object for the connection during the
105.Fn verify_callback
106when checking the peer's certificate.
107Check the example in
108.Xr SSL_CTX_set_verify 3 .
109.Sh SEE ALSO
110.Xr CRYPTO_set_ex_data 3 ,
111.Xr ssl 3 ,
112.Xr SSL_CTX_set_verify 3
113.Sh HISTORY
114.Fn SSL_get_ex_data_X509_STORE_CTX_idx
115first appeared in SSLeay 0.9.1 and has been available since
116.Ox 2.6 .
diff --git a/src/lib/libssl/man/SSL_get_ex_new_index.3 b/src/lib/libssl/man/SSL_get_ex_new_index.3
deleted file mode 100644
index cecd25fa44..0000000000
--- a/src/lib/libssl/man/SSL_get_ex_new_index.3
+++ /dev/null
@@ -1,136 +0,0 @@
1.\" $OpenBSD: SSL_get_ex_new_index.3,v 1.4 2018/03/27 17:35:50 schwarze Exp $
2.\" OpenSSL 9b86974e Aug 17 15:21:33 2015 -0400
3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
5.\" Copyright (c) 2001, 2005 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: March 27 2018 $
52.Dt SSL_GET_EX_NEW_INDEX 3
53.Os
54.Sh NAME
55.Nm SSL_get_ex_new_index ,
56.Nm SSL_set_ex_data ,
57.Nm SSL_get_ex_data
58.Nd internal application specific data functions
59.Sh SYNOPSIS
60.In openssl/ssl.h
61.Ft int
62.Fo SSL_get_ex_new_index
63.Fa "long argl"
64.Fa "void *argp"
65.Fa "CRYPTO_EX_new *new_func"
66.Fa "CRYPTO_EX_dup *dup_func"
67.Fa "CRYPTO_EX_free *free_func"
68.Fc
69.Ft int
70.Fn SSL_set_ex_data "SSL *ssl" "int idx" "void *arg"
71.Ft void *
72.Fn SSL_get_ex_data "const SSL *ssl" "int idx"
73.Bd -literal
74typedef int new_func(void *parent, void *ptr, CRYPTO_EX_DATA *ad,
75 int idx, long argl, void *argp);
76typedef void free_func(void *parent, void *ptr, CRYPTO_EX_DATA *ad,
77 int idx, long argl, void *argp);
78typedef int dup_func(CRYPTO_EX_DATA *to, CRYPTO_EX_DATA *from, void *from_d,
79 int idx, long argl, void *argp);
80.Ed
81.Sh DESCRIPTION
82Several OpenSSL structures can have application specific data attached to them.
83These functions are used internally by OpenSSL to manipulate application
84specific data attached to a specific structure.
85.Pp
86.Fn SSL_get_ex_new_index
87is used to register a new index for application specific data.
88.Pp
89.Fn SSL_set_ex_data
90is used to store application data at
91.Fa arg
92for
93.Fa idx
94into the
95.Fa ssl
96object.
97.Pp
98.Fn SSL_get_ex_data
99is used to retrieve the information for
100.Fa idx
101from
102.Fa ssl .
103.Pp
104A detailed description for the
105.Fn *_get_ex_new_index
106functionality can be found in
107.Xr RSA_get_ex_new_index 3 .
108The
109.Fn *_get_ex_data
110and
111.Fn *_set_ex_data
112functionality is described in
113.Xr CRYPTO_set_ex_data 3 .
114.Sh EXAMPLES
115An example of how to use the functionality is included in the example
116.Fn verify_callback
117in
118.Xr SSL_CTX_set_verify 3 .
119.Sh SEE ALSO
120.Xr CRYPTO_set_ex_data 3 ,
121.Xr RSA_get_ex_new_index 3 ,
122.Xr ssl 3 ,
123.Xr SSL_CTX_set_verify 3
124.Sh HISTORY
125Precursor functions
126.Fn SSL_set_app_data
127and
128.Fn SSL_get_app_data
129first appeared in SSLeay 0.6.1.
130.Pp
131.Fn SSL_get_ex_new_index ,
132.Fn SSL_set_ex_data ,
133and
134.Fn SSL_get_ex_data
135first appeared in SSLeay 0.9.0 and have been available since
136.Ox 2.4 .
diff --git a/src/lib/libssl/man/SSL_get_fd.3 b/src/lib/libssl/man/SSL_get_fd.3
deleted file mode 100644
index 1e093424cb..0000000000
--- a/src/lib/libssl/man/SSL_get_fd.3
+++ /dev/null
@@ -1,103 +0,0 @@
1.\" $OpenBSD: SSL_get_fd.3,v 1.6 2018/03/27 17:35:50 schwarze Exp $
2.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
5.\" Copyright (c) 2000, 2005, 2013 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: March 27 2018 $
52.Dt SSL_GET_FD 3
53.Os
54.Sh NAME
55.Nm SSL_get_fd ,
56.Nm SSL_get_rfd ,
57.Nm SSL_get_wfd
58.Nd get file descriptor linked to an SSL object
59.Sh SYNOPSIS
60.In openssl/ssl.h
61.Ft int
62.Fn SSL_get_fd "const SSL *ssl"
63.Ft int
64.Fn SSL_get_rfd "const SSL *ssl"
65.Ft int
66.Fn SSL_get_wfd "const SSL *ssl"
67.Sh DESCRIPTION
68.Fn SSL_get_fd
69returns the file descriptor which is linked to
70.Fa ssl .
71.Fn SSL_get_rfd
72and
73.Fn SSL_get_wfd
74return the file descriptors for the read or the write channel,
75which can be different.
76If the read and the write channel are different,
77.Fn SSL_get_fd
78will return the file descriptor of the read channel.
79.Sh RETURN VALUES
80The following return values can occur:
81.Bl -tag -width Ds
82.It \(mi1
83The operation failed, because the underlying
84.Vt BIO
85is not of the correct type (suitable for file descriptors).
86.It \(>=0
87The file descriptor linked to
88.Fa ssl .
89.El
90.Sh SEE ALSO
91.Xr BIO_new 3 ,
92.Xr ssl 3 ,
93.Xr SSL_set_fd 3
94.Sh HISTORY
95.Fn SSL_get_fd
96appeared in SSLeay 0.4 or earlier and has been available since
97.Ox 2.4 .
98.Pp
99.Fn SSL_get_rfd
100and
101.Fn SSL_get_wfd
102first appeared in OpenSSL 0.9.6c and have been available since
103.Ox 3.2 .
diff --git a/src/lib/libssl/man/SSL_get_finished.3 b/src/lib/libssl/man/SSL_get_finished.3
deleted file mode 100644
index 3cfb655ea0..0000000000
--- a/src/lib/libssl/man/SSL_get_finished.3
+++ /dev/null
@@ -1,77 +0,0 @@
1.\" $OpenBSD: SSL_get_finished.3,v 1.2 2021/01/30 10:48:15 tb Exp $
2.\"
3.\" Copyright (c) 2020 Theo Buehler <tb@openbsd.org>
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd $Mdocdate: January 30 2021 $
18.Dt SSL_GET_FINISHED 3
19.Os
20.Sh NAME
21.Nm SSL_get_finished ,
22.Nm SSL_get_peer_finished
23.Nd get last sent or last expected finished message
24.Sh SYNOPSIS
25.In openssl/ssl.h
26.Ft size_t
27.Fn SSL_get_finished "const SSL *ssl" "void *buf" "size_t count"
28.Ft size_t
29.Fn SSL_get_peer_finished "const SSL *ssl" "void *buf" "size_t count"
30.Sh DESCRIPTION
31.Fn SSL_get_finished
32and
33.Fn SSL_get_peer_finished
34copy
35.Fa count
36bytes from the last finished message sent to the peer
37or expected from the peer into the
38caller-provided buffer
39.Fa buf .
40.Pp
41The finished message is computed from a checksum of the handshake records
42exchanged with the peer.
43Its length depends on the ciphersuite in use and is at most
44.Dv EVP_MAX_MD_SIZE ,
45i.e., 64 bytes.
46.\" In TLSv1.3 the length is equal to the length of the hash algorithm
47.\" used by the hash-based message authentication code (HMAC),
48.\" which is currently either 32 bytes for SHA-256 or 48 bytes for SHA-384.
49.\" In TLSv1.2 the length defaults to 12 bytes, but it can explicitly be
50.\" specified by the ciphersuite to be longer.
51.\" In TLS versions 1.1 and 1.0, the finished message has a fixed length
52.\" of 12 bytes.
53.Sh RETURN VALUES
54.Fn SSL_get_finished
55and
56.Fn SSL_get_peer_finished
57return the number of bytes copied into
58.Fa buf .
59The return value is zero if the handshake has not reached the
60finished message.
61.Sh SEE ALSO
62.Xr ssl 3 ,
63.Xr SSL_get_session 3 ,
64.Xr SSL_set_session 3
65.Sh STANDARDS
66RFC 8446: The Transport Layer Security (TLS) Protocol Version 1.3,
67section 4.4.4: Finished.
68.Pp
69RFC 5246: The Transport Layer Security (TLS) Protocol Version 1.2,
70section 7.4.9: Finished.
71.Sh HISTORY
72.Fn SSL_get_finished
73and
74.Fn SSL_get_peer_finished
75first appeared in SSLeay 0.9.5
76and have been available since
77.Ox 2.7 .
diff --git a/src/lib/libssl/man/SSL_get_peer_cert_chain.3 b/src/lib/libssl/man/SSL_get_peer_cert_chain.3
deleted file mode 100644
index eb2ae53dc4..0000000000
--- a/src/lib/libssl/man/SSL_get_peer_cert_chain.3
+++ /dev/null
@@ -1,107 +0,0 @@
1.\" $OpenBSD: SSL_get_peer_cert_chain.3,v 1.5 2018/03/27 17:35:50 schwarze Exp $
2.\" OpenSSL SSL_get_peer_cert_chain.pod 1f164c6f Jan 18 01:40:36 2017 +0100
3.\" OpenSSL SSL_get_peer_cert_chain.pod 9b86974e Aug 17 15:21:33 2015 -0400
4.\"
5.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
6.\" Copyright (c) 2000, 2005, 2014, 2016 The OpenSSL Project.
7.\" All rights reserved.
8.\"
9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions
11.\" are met:
12.\"
13.\" 1. Redistributions of source code must retain the above copyright
14.\" notice, this list of conditions and the following disclaimer.
15.\"
16.\" 2. Redistributions in binary form must reproduce the above copyright
17.\" notice, this list of conditions and the following disclaimer in
18.\" the documentation and/or other materials provided with the
19.\" distribution.
20.\"
21.\" 3. All advertising materials mentioning features or use of this
22.\" software must display the following acknowledgment:
23.\" "This product includes software developed by the OpenSSL Project
24.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
25.\"
26.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
27.\" endorse or promote products derived from this software without
28.\" prior written permission. For written permission, please contact
29.\" openssl-core@openssl.org.
30.\"
31.\" 5. Products derived from this software may not be called "OpenSSL"
32.\" nor may "OpenSSL" appear in their names without prior written
33.\" permission of the OpenSSL Project.
34.\"
35.\" 6. Redistributions of any form whatsoever must retain the following
36.\" acknowledgment:
37.\" "This product includes software developed by the OpenSSL Project
38.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
39.\"
40.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
41.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
42.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
43.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
44.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
45.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
46.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
47.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
49.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
50.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
51.\" OF THE POSSIBILITY OF SUCH DAMAGE.
52.\"
53.Dd $Mdocdate: March 27 2018 $
54.Dt SSL_GET_PEER_CERT_CHAIN 3
55.Os
56.Sh NAME
57.Nm SSL_get_peer_cert_chain
58.Nd get the X509 certificate chain sent by the peer
59.Sh SYNOPSIS
60.In openssl/ssl.h
61.Ft STACK_OF(X509) *
62.Fn SSL_get_peer_cert_chain "const SSL *ssl"
63.Sh DESCRIPTION
64.Fn SSL_get_peer_cert_chain
65returns a pointer to
66.Dv STACK_OF Ns Po Vt X509 Pc
67certificates forming the certificate chain of the peer.
68If called on the client side, the stack also contains the peer's certificate;
69if called on the server side, the peer's certificate must be obtained
70separately using
71.Xr SSL_get_peer_certificate 3 .
72If the peer did not present a certificate,
73.Dv NULL
74is returned.
75.Pp
76.Fn SSL_get_peer_cert_chain
77returns the peer chain as sent by the peer: it only consists of
78certificates the peer has sent (in the order the peer has sent them)
79and it is not a verified chain.
80.Pp
81If the session is resumed, peers do not send certificates, so a
82.Dv NULL
83pointer is returned.
84Applications can call
85.Fn SSL_session_reused
86to determine whether a session is resumed.
87.Pp
88The reference count of the
89.Dv STACK_OF Ns Po Vt X509 Pc
90object is not incremented.
91If the corresponding session is freed, the pointer must not be used any longer.
92.Sh RETURN VALUES
93The following return values can occur:
94.Bl -tag -width Ds
95.It Dv NULL
96No certificate was presented by the peer or no connection was established or
97the certificate chain is no longer available when a session is reused.
98.It Pointer to a Dv STACK_OF Ns Po X509 Pc
99The return value points to the certificate chain presented by the peer.
100.El
101.Sh SEE ALSO
102.Xr ssl 3 ,
103.Xr SSL_get_peer_certificate 3
104.Sh HISTORY
105.Fn SSL_get_peer_cert_chain
106first appeared in SSLeay 0.8.0 and has been available since
107.Ox 2.4 .
diff --git a/src/lib/libssl/man/SSL_get_peer_certificate.3 b/src/lib/libssl/man/SSL_get_peer_certificate.3
deleted file mode 100644
index 99f9330288..0000000000
--- a/src/lib/libssl/man/SSL_get_peer_certificate.3
+++ /dev/null
@@ -1,105 +0,0 @@
1.\" $OpenBSD: SSL_get_peer_certificate.3,v 1.6 2021/06/26 17:36:28 tb Exp $
2.\" full merge up to: OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
5.\" Copyright (c) 2000, 2001, 2005 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: June 26 2021 $
52.Dt SSL_GET_PEER_CERTIFICATE 3
53.Os
54.Sh NAME
55.Nm SSL_get_peer_certificate
56.Nd get the X509 certificate of the peer
57.Sh SYNOPSIS
58.In openssl/ssl.h
59.Ft X509 *
60.Fn SSL_get_peer_certificate "const SSL *ssl"
61.Sh DESCRIPTION
62.Fn SSL_get_peer_certificate
63returns a pointer to the X509 certificate the peer presented.
64If the peer did not present a certificate,
65.Dv NULL
66is returned.
67.Pp
68Due to the protocol definition, a TLS/SSL server will always send a
69certificate, if present.
70A client will only send a certificate when explicitly requested to do so by the
71server (see
72.Xr SSL_CTX_set_verify 3 ) .
73If an anonymous cipher is used, no certificates are sent.
74.Pp
75That a certificate is returned does not indicate information about the
76verification state.
77Use
78.Xr SSL_get_verify_result 3
79to check the verification state.
80.Pp
81The reference count of the
82.Vt X509
83object is incremented by one, so that it will not be destroyed when the session
84containing the peer certificate is freed.
85The
86.Vt X509
87object must be explicitly freed using
88.Xr X509_free 3 .
89.Sh RETURN VALUES
90The following return values can occur:
91.Bl -tag -width Ds
92.It Dv NULL
93No certificate was presented by the peer or no connection was established.
94.It Pointer to an X509 certificate
95The return value points to the certificate presented by the peer.
96.El
97.Sh SEE ALSO
98.Xr ssl 3 ,
99.Xr SSL_CTX_set_verify 3 ,
100.Xr SSL_get0_peername 3 ,
101.Xr SSL_get_verify_result 3
102.Sh HISTORY
103.Fn SSL_get_peer_certificate
104appeared in SSLeay 0.4 or earlier and has been available since
105.Ox 2.4 .
diff --git a/src/lib/libssl/man/SSL_get_rbio.3 b/src/lib/libssl/man/SSL_get_rbio.3
deleted file mode 100644
index 38096fbecf..0000000000
--- a/src/lib/libssl/man/SSL_get_rbio.3
+++ /dev/null
@@ -1,98 +0,0 @@
1.\" $OpenBSD: SSL_get_rbio.3,v 1.5 2018/03/27 17:35:50 schwarze Exp $
2.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
5.\" Copyright (c) 2000, 2013 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: March 27 2018 $
52.Dt SSL_GET_RBIO 3
53.Os
54.Sh NAME
55.Nm SSL_get_rbio ,
56.Nm SSL_get_wbio
57.Nd get BIO linked to an SSL object
58.Sh SYNOPSIS
59.In openssl/ssl.h
60.Ft BIO *
61.Fn SSL_get_rbio "SSL *ssl"
62.Ft BIO *
63.Fn SSL_get_wbio "SSL *ssl"
64.Sh DESCRIPTION
65.Fn SSL_get_rbio
66and
67.Fn SSL_get_wbio
68return pointers to the
69.Vt BIO Ns s
70for the read or the write channel, which can be different.
71The reference count of the
72.Vt BIO
73is not incremented.
74.Sh RETURN VALUES
75The following return values can occur:
76.Bl -tag -width Ds
77.It Dv NULL
78No
79.Vt BIO
80was connected to the
81.Vt SSL
82object.
83.It Any other pointer
84The
85.Vt BIO
86linked to
87.Fa ssl .
88.El
89.Sh SEE ALSO
90.Xr BIO_new 3 ,
91.Xr ssl 3 ,
92.Xr SSL_set_bio 3
93.Sh HISTORY
94.Fn SSL_get_rbio
95and
96.Fn SSL_get_wbio
97first appeared in SSLeay 0.6.0 and have been available since
98.Ox 2.4 .
diff --git a/src/lib/libssl/man/SSL_get_server_tmp_key.3 b/src/lib/libssl/man/SSL_get_server_tmp_key.3
deleted file mode 100644
index aeeb358240..0000000000
--- a/src/lib/libssl/man/SSL_get_server_tmp_key.3
+++ /dev/null
@@ -1,89 +0,0 @@
1.\" $OpenBSD: SSL_get_server_tmp_key.3,v 1.4 2019/06/12 09:36:30 schwarze Exp $
2.\" OpenSSL SSL_get_server_tmp_key.pod 508fafd8 Apr 3 15:41:21 2017 +0100
3.\"
4.\" This file was written by Matt Caswell <matt@openssl.org>
5.\" Copyright (c) 2017 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: June 12 2019 $
52.Dt SSL_GET_SERVER_TMP_KEY 3
53.Os
54.Sh NAME
55.Nm SSL_get_server_tmp_key
56.Nd temporary server key during a handshake
57.Sh SYNOPSIS
58.In openssl/ssl.h
59.Ft long
60.Fo SSL_get_server_tmp_key
61.Fa "SSL *ssl"
62.Fa "EVP_PKEY **key"
63.Fc
64.Sh DESCRIPTION
65.Fn SSL_get_server_tmp_key
66retrieves the temporary key provided by the server
67and used during key exchange.
68For example, if ECDHE is in use,
69this represents the server's public ECDHE key.
70.Pp
71In case of success, a copy of the key is stored in
72.Pf * Fa key .
73It is the caller's responsibility to free this key after use using
74.Xr EVP_PKEY_free 3 .
75.Pp
76This function may only be called by the client.
77.Pp
78This function is implemented as a macro.
79.Sh RETURN VALUES
80.Fn SSL_get_server_tmp_key
81returns 1 on success or 0 on failure.
82.Sh SEE ALSO
83.Xr EVP_PKEY_free 3 ,
84.Xr ssl 3 ,
85.Xr SSL_ctrl 3
86.Sh HISTORY
87.Fn SSL_get_server_tmp_key
88first appeared in OpenSSL 1.0.2 and has been available since
89.Ox 6.1 .
diff --git a/src/lib/libssl/man/SSL_get_session.3 b/src/lib/libssl/man/SSL_get_session.3
deleted file mode 100644
index 2ab43fdd3e..0000000000
--- a/src/lib/libssl/man/SSL_get_session.3
+++ /dev/null
@@ -1,163 +0,0 @@
1.\" $OpenBSD: SSL_get_session.3,v 1.8 2022/03/31 17:27:18 naddy Exp $
2.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
5.\" Copyright (c) 2000, 2001, 2005, 2013, 2016 The OpenSSL Project.
6.\" All rights reserved.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\"
12.\" 1. Redistributions of source code must retain the above copyright
13.\" notice, this list of conditions and the following disclaimer.
14.\"
15.\" 2. Redistributions in binary form must reproduce the above copyright
16.\" notice, this list of conditions and the following disclaimer in
17.\" the documentation and/or other materials provided with the
18.\" distribution.
19.\"
20.\" 3. All advertising materials mentioning features or use of this
21.\" software must display the following acknowledgment:
22.\" "This product includes software developed by the OpenSSL Project
23.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
24.\"
25.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
26.\" endorse or promote products derived from this software without
27.\" prior written permission. For written permission, please contact
28.\" openssl-core@openssl.org.
29.\"
30.\" 5. Products derived from this software may not be called "OpenSSL"
31.\" nor may "OpenSSL" appear in their names without prior written
32.\" permission of the OpenSSL Project.
33.\"
34.\" 6. Redistributions of any form whatsoever must retain the following
35.\" acknowledgment:
36.\" "This product includes software developed by the OpenSSL Project
37.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
38.\"
39.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
40.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
43.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50.\" OF THE POSSIBILITY OF SUCH DAMAGE.
51.\"
52.Dd $Mdocdate: March 31 2022 $
53.Dt SSL_GET_SESSION 3
54.Os
55.Sh NAME
56.Nm SSL_get_session ,
57.Nm SSL_get0_session ,
58.Nm SSL_get1_session
59.Nd retrieve TLS/SSL session data
60.Sh SYNOPSIS
61.In openssl/ssl.h
62.Ft SSL_SESSION *
63.Fn SSL_get_session "const SSL *ssl"
64.Ft SSL_SESSION *
65.Fn SSL_get0_session "const SSL *ssl"
66.Ft SSL_SESSION *
67.Fn SSL_get1_session "SSL *ssl"
68.Sh DESCRIPTION
69.Fn SSL_get_session
70returns a pointer to the
71.Vt SSL_SESSION
72actually used in
73.Fa ssl .
74The reference count of the
75.Vt SSL_SESSION
76is not incremented, so that the pointer can become invalid by other operations.
77.Pp
78.Fn SSL_get0_session
79is the same as
80.Fn SSL_get_session .
81.Pp
82.Fn SSL_get1_session
83is the same as
84.Fn SSL_get_session ,
85but the reference count of the
86.Vt SSL_SESSION
87is incremented by one.
88.Pp
89The
90.Fa ssl
91session contains all information required to re-establish the connection
92without a new handshake.
93.Pp
94.Fn SSL_get0_session
95returns a pointer to the actual session.
96As the reference counter is not incremented,
97the pointer is only valid while the connection is in use.
98If
99.Xr SSL_clear 3
100or
101.Xr SSL_free 3
102is called, the session may be removed completely (if considered bad),
103and the pointer obtained will become invalid.
104Even if the session is valid,
105it can be removed at any time due to timeout during
106.Xr SSL_CTX_flush_sessions 3 .
107.Pp
108If the data is to be kept,
109.Fn SSL_get1_session
110will increment the reference count, so that the session will not be implicitly
111removed by other operations but stays in memory.
112In order to remove the session,
113.Xr SSL_SESSION_free 3
114must be explicitly called once to decrement the reference count again.
115.Pp
116.Vt SSL_SESSION
117objects keep internal link information about the session cache list when being
118inserted into one
119.Vt SSL_CTX
120object's session cache.
121One
122.Vt SSL_SESSION
123object, regardless of its reference count, must therefore only be used with one
124.Vt SSL_CTX
125object (and the
126.Vt SSL
127objects created from this
128.Vt SSL_CTX
129object).
130.Sh RETURN VALUES
131The following return values can occur:
132.Bl -tag -width Ds
133.It Dv NULL
134There is no session available in
135.Fa ssl .
136.It Pointer to an Vt SSL_SESSION
137The return value points to the data of an
138.Vt SSL
139session.
140.El
141.Sh SEE ALSO
142.Xr ssl 3 ,
143.Xr SSL_clear 3 ,
144.Xr SSL_free 3 ,
145.Xr SSL_SESSION_free 3 ,
146.Xr SSL_SESSION_get0_peer 3 ,
147.Xr SSL_SESSION_get_compress_id 3 ,
148.Xr SSL_SESSION_get_id 3 ,
149.Xr SSL_SESSION_get_protocol_version 3 ,
150.Xr SSL_SESSION_get_time 3 ,
151.Xr SSL_SESSION_new 3 ,
152.Xr SSL_SESSION_print 3 ,
153.Xr SSL_set_session 3
154.Sh HISTORY
155.Fn SSL_get_session
156first appeared in SSLeay 0.5.2 and has been available since
157.Ox 2.4 .
158.Pp
159.Fn SSL_get0_session
160and
161.Fn SSL_get1_session
162first appeared in OpenSSL 0.9.5 and have been available since
163.Ox 2.7 .
diff --git a/src/lib/libssl/man/SSL_get_shared_ciphers.3 b/src/lib/libssl/man/SSL_get_shared_ciphers.3
deleted file mode 100644
index 207e8c42eb..0000000000
--- a/src/lib/libssl/man/SSL_get_shared_ciphers.3
+++ /dev/null
@@ -1,103 +0,0 @@
1.\" $OpenBSD: SSL_get_shared_ciphers.3,v 1.5 2021/01/09 10:50:02 tb Exp $
2.\"
3.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd $Mdocdate: January 9 2021 $
18.Dt SSL_GET_SHARED_CIPHERS 3
19.Os
20.Sh NAME
21.Nm SSL_get_shared_ciphers
22.Nd ciphers supported by both client and server
23.Sh SYNOPSIS
24.In openssl/ssl.h
25.Ft char *
26.Fo SSL_get_shared_ciphers
27.Fa "const SSL *ssl"
28.Fa "char *buf"
29.Fa "int len"
30.Fc
31.Sh DESCRIPTION
32If
33.Fa ssl
34contains a session in server mode,
35.Fn SSL_get_shared_ciphers
36puts as many names of ciphers that are supported by both the client
37and the server into the buffer
38.Fa buf
39as the buffer is long enough to contain.
40Names are separated by colons.
41At most
42.Fa len
43bytes are written to
44.Fa buf
45including the terminating NUL character.
46.Sh RETURN VALUES
47.Fn SSL_get_shared_ciphers
48returns
49.Fa buf
50on success or
51.Dv NULL
52on failure.
53The following situations cause failure:
54.Bl -bullet
55.It
56.Xr SSL_is_server 3
57is false, i.e.,
58.Ar ssl
59is not set to server mode.
60.It
61.Xr SSL_get_ciphers 3
62is
63.Dv NULL
64or empty, i.e., no ciphers are available for use by the server.
65.It
66.Xr SSL_get_session 3
67is
68.Dv NULL ,
69i.e.,
70.Ar ssl
71contains no session.
72.It
73.Xr SSL_get_client_ciphers 3
74is
75.Dv NULL
76or empty, i.e.,
77.Ar ssl
78contains no information about ciphers supported by the client,
79or the client does not support any ciphers.
80.It
81The
82.Fa len
83argument is less than 2.
84.El
85.Sh SEE ALSO
86.Xr ssl 3 ,
87.Xr SSL_get_ciphers 3
88.Sh HISTORY
89.Fn SSL_get_shared_ciphers
90first appeared in SSLeay 0.4.5b and has been available since
91.Ox 2.4 .
92.Sh BUGS
93If the list is too long to fit into
94.Fa len
95bytes, it is silently truncated after the last cipher name that fits,
96and all following ciphers are skipped.
97If the buffer is very short such that even the first cipher name
98does not fit, an empty string is returned even when some shared
99ciphers are actually available.
100.Pp
101There is no easy way to find out how much space is required for
102.Fa buf
103or whether the supplied space was sufficient.
diff --git a/src/lib/libssl/man/SSL_get_state.3 b/src/lib/libssl/man/SSL_get_state.3
deleted file mode 100644
index 297bbce876..0000000000
--- a/src/lib/libssl/man/SSL_get_state.3
+++ /dev/null
@@ -1,161 +0,0 @@
1.\" $OpenBSD: SSL_get_state.3,v 1.5 2019/06/12 09:36:30 schwarze Exp $
2.\"
3.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd $Mdocdate: June 12 2019 $
18.Dt SSL_GET_STATE 3
19.Os
20.Sh NAME
21.Nm SSL_get_state ,
22.Nm SSL_state ,
23.Nm SSL_in_accept_init ,
24.Nm SSL_in_before ,
25.Nm SSL_in_connect_init ,
26.Nm SSL_in_init ,
27.Nm SSL_is_init_finished
28.Nd inspect the state of the SSL state machine
29.Sh SYNOPSIS
30.In openssl/ssl.h
31.Ft int
32.Fo SSL_get_state
33.Fa "const SSL *ssl"
34.Fc
35.Ft int
36.Fo SSL_state
37.Fa "const SSL *ssl"
38.Fc
39.Ft int
40.Fo SSL_in_accept_init
41.Fa "const SSL *ssl"
42.Fc
43.Ft int
44.Fo SSL_in_before
45.Fa "const SSL *ssl"
46.Fc
47.Ft int
48.Fo SSL_in_connect_init
49.Fa "const SSL *ssl"
50.Fc
51.Ft int
52.Fo SSL_in_init
53.Fa "const SSL *ssl"
54.Fc
55.Ft int
56.Fo SSL_is_init_finished
57.Fa "const SSL *ssl"
58.Fc
59.Sh DESCRIPTION
60.Fn SSL_get_state
61returns an encoded representation of the current state of the SSL
62state machine.
63.Fn SSL_state
64is a deprecated alias for
65.Fn SSL_get_state .
66.Pp
67The following bits may be set:
68.Bl -tag -width Ds
69.It Dv SSL_ST_ACCEPT
70This bit is set by
71.Xr SSL_accept 3
72and by
73.Xr SSL_set_accept_state 3 .
74It indicates that
75.Fa ssl
76is set up for server mode and no client initiated the TLS handshake yet.
77The function
78.Fn SSL_in_accept_init
79returns non-zero if this bit is set or 0 otherwise.
80.It Dv SSL_ST_BEFORE
81This bit is set by the
82.Xr SSL_accept 3 ,
83.Xr SSL_connect 3 ,
84.Xr SSL_set_accept_state 3 ,
85and
86.Xr SSL_set_connect_state 3
87functions.
88It indicates that the TLS handshake was not initiated yet.
89The function
90.Fn SSL_in_before
91returns non-zero if this bit is set or 0 otherwise.
92.It Dv SSL_ST_CONNECT
93This bit is set by
94.Xr SSL_connect 3
95and by
96.Xr SSL_set_connect_state 3 .
97It indicates that
98.Fa ssl
99is set up for client mode and no TLS handshake was initiated yet.
100The function
101.Fn SSL_in_connect_init
102returns non-zero if this bit is set or 0 otherwise.
103.El
104.Pp
105The following masks can be used:
106.Bl -tag -width Ds
107.It Dv SSL_ST_INIT
108Set if
109.Dv SSL_ST_ACCEPT
110or
111.Dv SSL_ST_CONNECT
112is set.
113The function
114.Fn SSL_in_init
115returns a non-zero value if one of these is set or 0 otherwise.
116.It Dv SSL_ST_MASK
117This mask includes all bits except
118.Dv SSL_ST_ACCEPT ,
119.Dv SSL_ST_BEFORE ,
120and
121.Dv SSL_ST_CONNECT .
122.It Dv SSL_ST_OK
123The state is set to this value when a connection is established.
124The function
125.Fn SSL_is_init_finished
126returns a non-zero value if the state equals this constant, or 0 otherwise.
127.It Dv SSL_ST_RENEGOTIATE
128The program is about to renegotiate, for example when entering
129.Xr SSL_read 3
130or
131.Xr SSL_write 3
132right after
133.Xr SSL_renegotiate 3
134was called.
135.El
136.Pp
137The meaning of other bits is protocol-dependent.
138Application programs usually do not need to inspect any of those
139other bits.
140.Pp
141All these functions may be implemented as macros.
142.Sh SEE ALSO
143.Xr ssl 3 ,
144.Xr SSL_renegotiate 3 ,
145.Xr SSL_set_connect_state 3
146.Sh HISTORY
147.Fn SSL_is_init_finished
148first appeared in SSLeay 0.4.5b.
149.Fn SSL_state
150first appeared in SSLeay 0.5.2.
151.Fn SSL_in_accept_init ,
152.Fn SSL_in_connect_init ,
153and
154.Fn SSL_in_init
155first appeared in SSLeay 0.6.0.
156.Fn SSL_in_before
157first appeared in SSLeay 0.8.0.
158.Fn SSL_get_state
159first appeared in SSLeay 0.9.0.
160All these functions have been available since
161.Ox 2.4 .
diff --git a/src/lib/libssl/man/SSL_get_verify_result.3 b/src/lib/libssl/man/SSL_get_verify_result.3
deleted file mode 100644
index 180cf1bb73..0000000000
--- a/src/lib/libssl/man/SSL_get_verify_result.3
+++ /dev/null
@@ -1,102 +0,0 @@
1.\" $OpenBSD: SSL_get_verify_result.3,v 1.6 2021/06/26 17:36:28 tb Exp $
2.\" full merge up to: OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
5.\" Copyright (c) 2000, 2001, 2005 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: June 26 2021 $
52.Dt SSL_GET_VERIFY_RESULT 3
53.Os
54.Sh NAME
55.Nm SSL_get_verify_result
56.Nd get result of peer certificate verification
57.Sh SYNOPSIS
58.In openssl/ssl.h
59.Ft long
60.Fn SSL_get_verify_result "const SSL *ssl"
61.Sh DESCRIPTION
62.Fn SSL_get_verify_result
63returns the result of the verification of the X509 certificate presented by the
64peer, if any.
65.Pp
66.Fn SSL_get_verify_result
67can only return one error code while the verification of a certificate can fail
68because of many reasons at the same time.
69Only the last verification error that occurred during the processing is
70available from
71.Fn SSL_get_verify_result .
72.Pp
73The verification result is part of the established session and is restored when
74a session is reused.
75.Sh RETURN VALUES
76The following return values can currently occur:
77.Bl -tag -width Ds
78.It Dv X509_V_OK
79The verification succeeded or no peer certificate was presented.
80.It Any other value
81Documented in
82.Xr openssl 1 .
83.El
84.Sh SEE ALSO
85.Xr openssl 1 ,
86.Xr ssl 3 ,
87.Xr SSL_CTX_set_verify 3 ,
88.Xr SSL_get0_peername 3 ,
89.Xr SSL_get_peer_certificate 3 ,
90.Xr SSL_set_verify_result 3
91.Sh HISTORY
92.Fn SSL_get_verify_result
93first appeared in SSLeay 0.6.1 and has been available since
94.Ox 2.4 .
95.Sh BUGS
96If no peer certificate was presented, the returned result code is
97.Dv X509_V_OK .
98This is because no verification error occurred;
99however, it does not indicate success.
100.Fn SSL_get_verify_result
101is only useful in connection with
102.Xr SSL_get_peer_certificate 3 .
diff --git a/src/lib/libssl/man/SSL_get_version.3 b/src/lib/libssl/man/SSL_get_version.3
deleted file mode 100644
index a6cefb055b..0000000000
--- a/src/lib/libssl/man/SSL_get_version.3
+++ /dev/null
@@ -1,123 +0,0 @@
1.\" $OpenBSD: SSL_get_version.3,v 1.9 2021/04/15 16:13:22 tb Exp $
2.\" full merge up to: OpenSSL e417070c Jun 8 11:37:06 2016 -0400
3.\" selective merge up to: OpenSSL df75c2bf Dec 9 01:02:36 2018 +0100
4.\"
5.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
6.\" Copyright (c) 2001, 2005, 2014 The OpenSSL Project. All rights reserved.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\"
12.\" 1. Redistributions of source code must retain the above copyright
13.\" notice, this list of conditions and the following disclaimer.
14.\"
15.\" 2. Redistributions in binary form must reproduce the above copyright
16.\" notice, this list of conditions and the following disclaimer in
17.\" the documentation and/or other materials provided with the
18.\" distribution.
19.\"
20.\" 3. All advertising materials mentioning features or use of this
21.\" software must display the following acknowledgment:
22.\" "This product includes software developed by the OpenSSL Project
23.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
24.\"
25.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
26.\" endorse or promote products derived from this software without
27.\" prior written permission. For written permission, please contact
28.\" openssl-core@openssl.org.
29.\"
30.\" 5. Products derived from this software may not be called "OpenSSL"
31.\" nor may "OpenSSL" appear in their names without prior written
32.\" permission of the OpenSSL Project.
33.\"
34.\" 6. Redistributions of any form whatsoever must retain the following
35.\" acknowledgment:
36.\" "This product includes software developed by the OpenSSL Project
37.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
38.\"
39.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
40.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
43.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50.\" OF THE POSSIBILITY OF SUCH DAMAGE.
51.\"
52.Dd $Mdocdate: April 15 2021 $
53.Dt SSL_GET_VERSION 3
54.Os
55.Sh NAME
56.Nm SSL_get_version ,
57.Nm SSL_is_dtls ,
58.Nm SSL_version
59.\" The following are intentionally undocumented because
60.\" - the longer term plan is to remove them
61.\" - nothing appears to be using them in the wild
62.\" - and they have the wrong namespace prefix
63.\" Nm TLS1_get_version
64.\" Nm TLS1_get_client_version
65.Nd get the protocol information of a connection
66.Sh SYNOPSIS
67.In openssl/ssl.h
68.Ft const char *
69.Fn SSL_get_version "const SSL *ssl"
70.Ft int
71.Fn SSL_is_dtls "const SSL *ssl"
72.Ft int
73.Fn SSL_version "const SSL *ssl"
74.Sh DESCRIPTION
75.Fn SSL_get_version
76returns the name of the protocol used for the connection
77.Fa ssl .
78.Pp
79.Fn SSL_is_dtls
80returns 1 if the connection is using DTLS, 0 if not.
81.Pp
82.Fn SSL_version
83returns an integer constant representing that protocol.
84.Pp
85These functions only return reliable results
86after the initial handshake has been completed.
87.Sh RETURN VALUES
88The following strings or integers can be returned by
89.Fn SSL_get_version
90and
91.Fn SSL_version :
92.Bl -tag -width Ds
93.It Qo TLSv1 Qc No or Dv TLS1_VERSION
94The connection uses the TLSv1.0 protocol.
95.It Qo TLSv1.1 Qc No or Dv TLS1_1_VERSION
96The connection uses the TLSv1.1 protocol.
97.It Qo TLSv1.2 Qc No or Dv TLS1_2_VERSION
98The connection uses the TLSv1.2 protocol.
99.It Qo TLSv1.3 Qc No or Dv TLS1_3_VERSION
100The connection uses the TLSv1.3 protocol.
101.It Qo DTLSv1 Qc No or Dv DTLS1_VERSION
102The connection uses the Datagram Transport Layer Security 1.0 protocol.
103.It Qo DTLSv1.2 Qc No or Dv DTLS1_2_VERSION
104The connection uses the Datagram Transport Layer Security 1.2 protocol.
105.It Qq unknown
106This indicates an unknown protocol version;
107it cannot currently happen with LibreSSL.
108.El
109.Pp
110.Fn SSL_is_dtls
111returns 1 if the connection uses DTLS, 0 if not.
112.Sh SEE ALSO
113.Xr ssl 3
114.Sh HISTORY
115.Fn SSL_get_version
116and
117.Fn SSL_version
118first appeared in SSLeay 0.8.0 and have been available since
119.Ox 2.4 .
120.Pp
121.Fn SSL_is_dtls
122first appeared in OpenSSL 1.1.0 and has been available since
123.Ox 6.9 .
diff --git a/src/lib/libssl/man/SSL_library_init.3 b/src/lib/libssl/man/SSL_library_init.3
deleted file mode 100644
index 053c1e6fcb..0000000000
--- a/src/lib/libssl/man/SSL_library_init.3
+++ /dev/null
@@ -1,98 +0,0 @@
1.\" $OpenBSD: SSL_library_init.3,v 1.7 2019/06/14 13:41:31 schwarze Exp $
2.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
5.\" Copyright (c) 2000, 2006, 2010 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: June 14 2019 $
52.Dt SSL_LIBRARY_INIT 3
53.Os
54.Sh NAME
55.Nm SSL_library_init ,
56.Nm OpenSSL_add_ssl_algorithms ,
57.Nm SSLeay_add_ssl_algorithms
58.Nd initialize SSL library by registering algorithms
59.Sh SYNOPSIS
60.In openssl/ssl.h
61.Ft int
62.Fn SSL_library_init void
63.Ft int
64.Fn OpenSSL_add_ssl_algorithms void
65.Ft int
66.Fn SSLeay_add_ssl_algorithms void
67.Sh DESCRIPTION
68These functions are deprecated.
69It is never useful for any application program to call any of them explicitly.
70The library automatically calls them internally whenever needed.
71.Pp
72.Fn SSL_library_init
73registers the available ciphers and digests
74which are used directly or indirectly by TLS.
75.Pp
76.Fn OpenSSL_add_ssl_algorithms
77and
78.Fn SSLeay_add_ssl_algorithms
79are synonyms for
80.Fn SSL_library_init
81and are implemented as macros.
82.Sh RETURN VALUES
83.Fn SSL_library_init
84always returns 1.
85.Sh SEE ALSO
86.Xr ssl 3
87.Sh HISTORY
88.Fn SSLeay_add_ssl_algorithms
89first appeared in SSLeay 0.8.0 and has been available since
90.Ox 2.4 .
91.Pp
92.Fn SSL_library_init
93first appeared in OpenSSL 0.9.2b and has been available since
94.Ox 2.6 .
95.Pp
96.Fn OpenSSL_add_ssl_algorithms
97first appeared in OpenSSL 0.9.5 and has been available since
98.Ox 2.7 .
diff --git a/src/lib/libssl/man/SSL_load_client_CA_file.3 b/src/lib/libssl/man/SSL_load_client_CA_file.3
deleted file mode 100644
index f782d96dce..0000000000
--- a/src/lib/libssl/man/SSL_load_client_CA_file.3
+++ /dev/null
@@ -1,185 +0,0 @@
1.\" $OpenBSD: SSL_load_client_CA_file.3,v 1.9 2019/06/12 09:36:30 schwarze Exp $
2.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3.\"
4.\" This file is a derived work.
5.\" The changes are covered by the following Copyright and license:
6.\"
7.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
8.\"
9.\" Permission to use, copy, modify, and distribute this software for any
10.\" purpose with or without fee is hereby granted, provided that the above
11.\" copyright notice and this permission notice appear in all copies.
12.\"
13.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
14.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
15.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
16.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
17.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
18.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
19.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20.\"
21.\" The original file was written by Lutz Jaenicke <jaenicke@openssl.org>.
22.\" Copyright (c) 2000 The OpenSSL Project. All rights reserved.
23.\"
24.\" Redistribution and use in source and binary forms, with or without
25.\" modification, are permitted provided that the following conditions
26.\" are met:
27.\"
28.\" 1. Redistributions of source code must retain the above copyright
29.\" notice, this list of conditions and the following disclaimer.
30.\"
31.\" 2. Redistributions in binary form must reproduce the above copyright
32.\" notice, this list of conditions and the following disclaimer in
33.\" the documentation and/or other materials provided with the
34.\" distribution.
35.\"
36.\" 3. All advertising materials mentioning features or use of this
37.\" software must display the following acknowledgment:
38.\" "This product includes software developed by the OpenSSL Project
39.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
40.\"
41.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
42.\" endorse or promote products derived from this software without
43.\" prior written permission. For written permission, please contact
44.\" openssl-core@openssl.org.
45.\"
46.\" 5. Products derived from this software may not be called "OpenSSL"
47.\" nor may "OpenSSL" appear in their names without prior written
48.\" permission of the OpenSSL Project.
49.\"
50.\" 6. Redistributions of any form whatsoever must retain the following
51.\" acknowledgment:
52.\" "This product includes software developed by the OpenSSL Project
53.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
54.\"
55.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
56.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
57.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
58.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
59.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
60.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
61.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
62.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
63.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
64.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
65.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
66.\" OF THE POSSIBILITY OF SUCH DAMAGE.
67.\"
68.Dd $Mdocdate: June 12 2019 $
69.Dt SSL_LOAD_CLIENT_CA_FILE 3
70.Os
71.Sh NAME
72.Nm SSL_load_client_CA_file ,
73.Nm SSL_add_file_cert_subjects_to_stack ,
74.Nm SSL_add_dir_cert_subjects_to_stack
75.Nd load certificate names from files
76.Sh SYNOPSIS
77.In openssl/ssl.h
78.Ft STACK_OF(X509_NAME) *
79.Fn SSL_load_client_CA_file "const char *file"
80.Ft int
81.Fo SSL_add_file_cert_subjects_to_stack
82.Fa "STACK_OF(X509_NAME) *stack"
83.Fa "const char *file"
84.Fc
85.Ft int
86.Fo SSL_add_dir_cert_subjects_to_stack
87.Fa "STACK_OF(X509_NAME) *stack"
88.Fa "const char *dir"
89.Fc
90.Sh DESCRIPTION
91.Fn SSL_load_client_CA_file
92reads PEM formatted certificates from
93.Fa file
94and returns a new
95.Vt STACK_OF(X509_NAME)
96with the subject names found.
97While the name suggests the specific usage as a support function for
98.Xr SSL_CTX_set_client_CA_list 3 ,
99it is not limited to CA certificates.
100.Pp
101.Fn SSL_add_file_cert_subjects_to_stack
102is similar except that the names are added to the existing
103.Fa stack .
104.Pp
105.Fn SSL_add_dir_cert_subjects_to_stack
106calls
107.Fn SSL_add_file_cert_subjects_to_stack
108on every file in the directory
109.Fa dir .
110.Pp
111If a name is already on the stack, all these functions skip it and
112do not add it again.
113.Sh RETURN VALUES
114.Fn SSL_load_client_CA_file
115returns a pointer to the new
116.Vt STACK_OF(X509_NAME)
117or
118.Dv NULL on failure .
119.Pp
120.Fn SSL_add_file_cert_subjects_to_stack
121and
122.Fn SSL_add_dir_cert_subjects_to_stack
123return 1 for success or 0 for failure.
124.Pp
125All these functions treat empty files and directories as failures.
126.Pp
127In some cases of failure, the reason can be determined with
128.Xr ERR_get_error 3 .
129.Sh EXAMPLES
130Load names of CAs from a file and use it as a client CA list:
131.Bd -literal
132SSL_CTX *ctx;
133STACK_OF(X509_NAME) *cert_names;
134\&...
135cert_names = SSL_load_client_CA_file("/path/to/CAfile.pem");
136if (cert_names != NULL)
137 SSL_CTX_set_client_CA_list(ctx, cert_names);
138else
139 error_handling();
140\&...
141.Ed
142.Sh SEE ALSO
143.Xr PEM_read_bio_X509 3 ,
144.Xr ssl 3 ,
145.Xr SSL_CTX_set_client_CA_list 3 ,
146.Xr X509_get_subject_name 3 ,
147.Xr X509_NAME_new 3
148.Sh HISTORY
149.Fn SSL_load_client_CA_file
150first appeared in SSLeay 0.8.0 and has been available since
151.Ox 2.4 .
152.Pp
153.Fn SSL_add_file_cert_subjects_to_stack
154and
155.Fn SSL_add_dir_cert_subjects_to_stack
156first appeared in OpenSSL 0.9.2b and have been available since
157.Ox 2.6 .
158.Sh AUTHORS
159.Fn SSL_add_file_cert_subjects_to_stack
160and
161.Fn SSL_add_dir_cert_subjects_to_stack
162were written by
163.An Ben Laurie Aq Mt ben@openssl.org
164in 1999.
165.Sh BUGS
166In some cases of failure, for example for empty files and directories,
167these functions fail to report an error, in the sense that
168.Xr ERR_get_error 3
169does not work.
170.Pp
171Even in case of failure, for example when parsing one of the
172files or certificates fails,
173.Fn SSL_add_file_cert_subjects_to_stack
174and
175.Fn SSL_add_dir_cert_subjects_to_stack
176may still have added some certificates to the stack.
177.Pp
178The behaviour of
179.Fn SSL_add_dir_cert_subjects_to_stack
180is non-deterministic.
181If parsing one file fails, parsing of the whole directory is aborted.
182Files in the directory are not parsed in any specific order.
183For example, adding an empty file to
184.Fa dir
185may or may not cause some of the other files to be ignored.
diff --git a/src/lib/libssl/man/SSL_new.3 b/src/lib/libssl/man/SSL_new.3
deleted file mode 100644
index 22c5dbf2db..0000000000
--- a/src/lib/libssl/man/SSL_new.3
+++ /dev/null
@@ -1,110 +0,0 @@
1.\" $OpenBSD: SSL_new.3,v 1.7 2022/07/13 22:05:53 schwarze Exp $
2.\" full merge up to: OpenSSL 1c7ae3dd Mar 29 19:17:55 2017 +1000
3.\"
4.\" This file was written by Richard Levitte <levitte@openssl.org>
5.\" and Matt Caswell <matt@openssl.org>.
6.\" Copyright (c) 2000, 2016 The OpenSSL Project. All rights reserved.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\"
12.\" 1. Redistributions of source code must retain the above copyright
13.\" notice, this list of conditions and the following disclaimer.
14.\"
15.\" 2. Redistributions in binary form must reproduce the above copyright
16.\" notice, this list of conditions and the following disclaimer in
17.\" the documentation and/or other materials provided with the
18.\" distribution.
19.\"
20.\" 3. All advertising materials mentioning features or use of this
21.\" software must display the following acknowledgment:
22.\" "This product includes software developed by the OpenSSL Project
23.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
24.\"
25.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
26.\" endorse or promote products derived from this software without
27.\" prior written permission. For written permission, please contact
28.\" openssl-core@openssl.org.
29.\"
30.\" 5. Products derived from this software may not be called "OpenSSL"
31.\" nor may "OpenSSL" appear in their names without prior written
32.\" permission of the OpenSSL Project.
33.\"
34.\" 6. Redistributions of any form whatsoever must retain the following
35.\" acknowledgment:
36.\" "This product includes software developed by the OpenSSL Project
37.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
38.\"
39.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
40.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
43.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50.\" OF THE POSSIBILITY OF SUCH DAMAGE.
51.\"
52.Dd $Mdocdate: July 13 2022 $
53.Dt SSL_NEW 3
54.Os
55.Sh NAME
56.Nm SSL_new ,
57.Nm SSL_up_ref
58.Nd create a new SSL structure for a connection
59.Sh SYNOPSIS
60.In openssl/ssl.h
61.Ft SSL *
62.Fn SSL_new "SSL_CTX *ctx"
63.Ft int
64.Fn SSL_up_ref "SSL *ssl"
65.Sh DESCRIPTION
66.Fn SSL_new
67creates a new
68.Vt SSL
69structure which is needed to hold the data for a TLS/SSL connection.
70The new structure inherits the settings of the underlying context
71.Fa ctx :
72connection method, options, verification settings,
73timeout settings, security level.
74The reference count of the new structure is set to 1.
75.Pp
76.Fn SSL_up_ref
77increments the reference count of
78.Fa ssl
79by 1.
80.Sh RETURN VALUES
81The following return values can occur:
82.Bl -tag -width Ds
83.It Dv NULL
84The creation of a new
85.Vt SSL
86structure failed.
87Check the error stack to find out the reason.
88.It Pointer to an Vt SSL No structure
89The return value points to an allocated
90.Vt SSL
91structure.
92.El
93.Pp
94.Fn SSL_up_ref
95returns 1 for success or 0 for failure.
96.Sh SEE ALSO
97.Xr ssl 3 ,
98.Xr SSL_clear 3 ,
99.Xr SSL_CTX_set_options 3 ,
100.Xr SSL_CTX_set_security_level 3 ,
101.Xr SSL_free 3 ,
102.Xr SSL_get_SSL_CTX 3
103.Sh HISTORY
104.Fn SSL_new
105appeared in SSLeay 0.4 or earlier and has been available since
106.Ox 2.4 .
107.Pp
108.Fn SSL_up_ref
109first appeared in OpenSSL 1.1.0 and has been available since
110.Ox 6.3 .
diff --git a/src/lib/libssl/man/SSL_num_renegotiations.3 b/src/lib/libssl/man/SSL_num_renegotiations.3
deleted file mode 100644
index 6a81b76a60..0000000000
--- a/src/lib/libssl/man/SSL_num_renegotiations.3
+++ /dev/null
@@ -1,75 +0,0 @@
1.\" $OpenBSD: SSL_num_renegotiations.3,v 1.5 2019/06/12 09:36:30 schwarze Exp $
2.\"
3.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd $Mdocdate: June 12 2019 $
18.Dt SSL_NUM_RENEGOTIATIONS 3
19.Os
20.Sh NAME
21.Nm SSL_num_renegotiations ,
22.Nm SSL_clear_num_renegotiations ,
23.Nm SSL_total_renegotiations
24.Nd renegotiation counters
25.Sh SYNOPSIS
26.In openssl/ssl.h
27.Ft long
28.Fo SSL_num_renegotiations
29.Fa "SSL *ssl"
30.Fc
31.Ft long
32.Fo SSL_clear_num_renegotiations
33.Fa "SSL *ssl"
34.Fc
35.Ft long
36.Fo SSL_total_renegotiations
37.Fa "SSL *ssl"
38.Fc
39.Sh DESCRIPTION
40.Fn SSL_num_renegotiations
41reports the number of renegotiations initiated in
42.Fa ssl
43since
44.Xr SSL_new 3 ,
45.Xr SSL_clear 3 ,
46or
47.Fn SSL_clear_num_renegotiations
48was last called on that object.
49.Pp
50.Fn SSL_clear_num_renegotiations
51does the same and additionally resets the renegotiation counter to 0.
52.Pp
53.Fn SSL_total_renegotiations
54reports the number of renegotiations initiated in
55.Fa ssl
56since
57.Xr SSL_new 3
58or
59.Xr SSL_clear 3
60was last called on that object.
61.Pp
62These functions are implemented as macros.
63.Sh RETURN VALUES
64All these functions return a number of renegotiations.
65.Sh SEE ALSO
66.Xr BIO_set_ssl_renegotiate_bytes 3 ,
67.Xr ssl 3 ,
68.Xr SSL_ctrl 3 ,
69.Xr SSL_read 3 ,
70.Xr SSL_renegotiate 3 ,
71.Xr SSL_write 3
72.Sh HISTORY
73These functions first appeared in SSLeay 0.9.0
74and have been available since
75.Ox 2.4 .
diff --git a/src/lib/libssl/man/SSL_pending.3 b/src/lib/libssl/man/SSL_pending.3
deleted file mode 100644
index bbc2e9bdd2..0000000000
--- a/src/lib/libssl/man/SSL_pending.3
+++ /dev/null
@@ -1,90 +0,0 @@
1.\" $OpenBSD: SSL_pending.3,v 1.5 2020/01/23 03:40:18 beck Exp $
2.\" OpenSSL a528d4f0 Oct 27 13:40:11 2015 -0400
3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>,
5.\" Bodo Moeller <bodo@openssl.org>, and Matt Caswell <matt@openssl.org>.
6.\" Copyright (c) 2000, 2005, 2015, 2016 The OpenSSL Project.
7.\" All rights reserved.
8.\"
9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions
11.\" are met:
12.\"
13.\" 1. Redistributions of source code must retain the above copyright
14.\" notice, this list of conditions and the following disclaimer.
15.\"
16.\" 2. Redistributions in binary form must reproduce the above copyright
17.\" notice, this list of conditions and the following disclaimer in
18.\" the documentation and/or other materials provided with the
19.\" distribution.
20.\"
21.\" 3. All advertising materials mentioning features or use of this
22.\" software must display the following acknowledgment:
23.\" "This product includes software developed by the OpenSSL Project
24.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
25.\"
26.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
27.\" endorse or promote products derived from this software without
28.\" prior written permission. For written permission, please contact
29.\" openssl-core@openssl.org.
30.\"
31.\" 5. Products derived from this software may not be called "OpenSSL"
32.\" nor may "OpenSSL" appear in their names without prior written
33.\" permission of the OpenSSL Project.
34.\"
35.\" 6. Redistributions of any form whatsoever must retain the following
36.\" acknowledgment:
37.\" "This product includes software developed by the OpenSSL Project
38.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
39.\"
40.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
41.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
42.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
43.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
44.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
45.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
46.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
47.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
49.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
50.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
51.\" OF THE POSSIBILITY OF SUCH DAMAGE.
52.\"
53.Dd $Mdocdate: January 23 2020 $
54.Dt SSL_PENDING 3
55.Os
56.Sh NAME
57.Nm SSL_pending
58.Nd obtain number of readable bytes buffered in an SSL object
59.Sh SYNOPSIS
60.In openssl/ssl.h
61.Ft int
62.Fn SSL_pending "const SSL *ssl"
63.Sh DESCRIPTION
64Data is received in whole blocks known as records from the peer.
65A whole record is processed, for example decrypted, in one go and
66is buffered until it is read by the application via a call to
67.Xr SSL_read 3 .
68.Pp
69.Fn SSL_pending
70returns the number of bytes of application data which are available
71for immediate read.
72.Pp
73.Fn SSL_pending
74takes into account only bytes from the TLS/SSL record that is
75currently being processed (if any).
76.Sh RETURN VALUES
77.Fn SSL_pending
78returns the number of buffered and processed application data
79bytes that are pending and are available for immediate read.
80.Sh SEE ALSO
81.Xr ssl 3 ,
82.Xr SSL_read 3
83.Sh HISTORY
84.Fn SSL_pending
85appeared in SSLeay 0.4 or earlier and has been available since
86.Ox 2.4 .
87.Sh BUGS
88Up to OpenSSL 0.9.6,
89.Fn SSL_pending
90did not check if the record type of pending data is application data.
diff --git a/src/lib/libssl/man/SSL_read.3 b/src/lib/libssl/man/SSL_read.3
deleted file mode 100644
index bb72a8ed82..0000000000
--- a/src/lib/libssl/man/SSL_read.3
+++ /dev/null
@@ -1,278 +0,0 @@
1.\" $OpenBSD: SSL_read.3,v 1.8 2021/10/24 15:10:13 schwarze Exp $
2.\" full merge up to: OpenSSL 5a2443ae Nov 14 11:37:36 2016 +0000
3.\" partial merge up to: OpenSSL 24a535ea Sep 22 13:14:20 2020 +0100
4.\"
5.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org> and
6.\" Matt Caswell <matt@openssl.org>.
7.\" Copyright (c) 2000, 2001, 2008, 2016 The OpenSSL Project.
8.\" All rights reserved.
9.\"
10.\" Redistribution and use in source and binary forms, with or without
11.\" modification, are permitted provided that the following conditions
12.\" are met:
13.\"
14.\" 1. Redistributions of source code must retain the above copyright
15.\" notice, this list of conditions and the following disclaimer.
16.\"
17.\" 2. Redistributions in binary form must reproduce the above copyright
18.\" notice, this list of conditions and the following disclaimer in
19.\" the documentation and/or other materials provided with the
20.\" distribution.
21.\"
22.\" 3. All advertising materials mentioning features or use of this
23.\" software must display the following acknowledgment:
24.\" "This product includes software developed by the OpenSSL Project
25.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
26.\"
27.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
28.\" endorse or promote products derived from this software without
29.\" prior written permission. For written permission, please contact
30.\" openssl-core@openssl.org.
31.\"
32.\" 5. Products derived from this software may not be called "OpenSSL"
33.\" nor may "OpenSSL" appear in their names without prior written
34.\" permission of the OpenSSL Project.
35.\"
36.\" 6. Redistributions of any form whatsoever must retain the following
37.\" acknowledgment:
38.\" "This product includes software developed by the OpenSSL Project
39.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
40.\"
41.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
42.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
44.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
45.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
46.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
47.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
48.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
49.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
50.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
51.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
52.\" OF THE POSSIBILITY OF SUCH DAMAGE.
53.\"
54.Dd $Mdocdate: October 24 2021 $
55.Dt SSL_READ 3
56.Os
57.Sh NAME
58.Nm SSL_read_ex ,
59.Nm SSL_read ,
60.Nm SSL_peek_ex ,
61.Nm SSL_peek
62.Nd read bytes from a TLS connection
63.Sh SYNOPSIS
64.In openssl/ssl.h
65.Ft int
66.Fn SSL_read_ex "SSL *ssl" "void *buf" "size_t num" "size_t *readbytes"
67.Ft int
68.Fn SSL_read "SSL *ssl" "void *buf" "int num"
69.Ft int
70.Fn SSL_peek_ex "SSL *ssl" "void *buf" "size_t num" "size_t *readbytes"
71.Ft int
72.Fn SSL_peek "SSL *ssl" "void *buf" "int num"
73.Sh DESCRIPTION
74.Fn SSL_read_ex
75and
76.Fn SSL_read
77try to read
78.Fa num
79bytes from the specified
80.Fa ssl
81into the buffer
82.Fa buf .
83On success
84.Fn SSL_read_ex
85stores the number of bytes actually read in
86.Pf * Fa readbytes .
87.Pp
88.Fn SSL_peek_ex
89and
90.Fn SSL_peek
91are identical to
92.Fn SSL_read_ex
93and
94.Fn SSL_read ,
95respectively,
96except that no bytes are removed from the underlying BIO during
97the read, such that a subsequent call to
98.Fn SSL_read_ex
99or
100.Fn SSL_read
101will yield at least the same bytes once again.
102.Pp
103In the following,
104.Fn SSL_read_ex ,
105.Fn SSL_read ,
106.Fn SSL_peek_ex ,
107and
108.Fn SSL_peek
109are called
110.Dq read functions .
111.Pp
112If necessary, a read function will negotiate a TLS session, if
113not already explicitly performed by
114.Xr SSL_connect 3
115or
116.Xr SSL_accept 3 .
117If the peer requests a re-negotiation, it will be performed
118transparently during the read function operation.
119The behaviour of the read functions depends on the underlying
120.Vt BIO .
121.Pp
122For the transparent negotiation to succeed, the
123.Fa ssl
124must have been initialized to client or server mode.
125This is done by calling
126.Xr SSL_set_connect_state 3
127or
128.Xr SSL_set_accept_state 3
129before the first call to a read function.
130.Pp
131The read functions work based on the TLS records.
132The data are received in records (with a maximum record size of 16kB).
133Only when a record has been completely received, it can be processed
134(decrypted and checked for integrity).
135Therefore, data that was not retrieved at the last read call can
136still be buffered inside the TLS layer and will be retrieved on the
137next read call.
138If
139.Fa num
140is higher than the number of bytes buffered, the read functions
141will return with the bytes buffered.
142If no more bytes are in the buffer, the read functions will trigger
143the processing of the next record.
144Only when the record has been received and processed completely
145will the read functions return reporting success.
146At most the contents of the record will be returned.
147As the size of a TLS record may exceed the maximum packet size
148of the underlying transport (e.g., TCP), it may be necessary to
149read several packets from the transport layer before the record is
150complete and the read call can succeed.
151.Pp
152If the underlying
153.Vt BIO
154is blocking,
155a read function will only return once the read operation has been
156finished or an error occurred, except when a renegotiation takes
157place, in which case an
158.Dv SSL_ERROR_WANT_READ
159may occur.
160This behavior can be controlled with the
161.Dv SSL_MODE_AUTO_RETRY
162flag of the
163.Xr SSL_CTX_set_mode 3
164call.
165.Pp
166If the underlying
167.Vt BIO
168is non-blocking, a read function will also return when the underlying
169.Vt BIO
170could not satisfy the needs of the function to continue the operation.
171In this case a call to
172.Xr SSL_get_error 3
173with the return value of the read function will yield
174.Dv SSL_ERROR_WANT_READ
175or
176.Dv SSL_ERROR_WANT_WRITE .
177As at any time a re-negotiation is possible, a read function may
178also cause write operations.
179The calling process must then repeat the call after taking appropriate
180action to satisfy the needs of the read function.
181The action depends on the underlying
182.Vt BIO .
183When using a non-blocking socket, nothing is to be done, but
184.Xr select 2
185can be used to check for the required condition.
186When using a buffering
187.Vt BIO ,
188like a
189.Vt BIO
190pair, data must be written into or retrieved out of the
191.Vt BIO
192before being able to continue.
193.Pp
194.Xr SSL_pending 3
195can be used to find out whether there are buffered bytes available for
196immediate retrieval.
197In this case a read function can be called without blocking or
198actually receiving new data from the underlying socket.
199.Pp
200When a read function operation has to be repeated because of
201.Dv SSL_ERROR_WANT_READ
202or
203.Dv SSL_ERROR_WANT_WRITE ,
204it must be repeated with the same arguments.
205.Sh RETURN VALUES
206.Fn SSL_read_ex
207and
208.Fn SSL_peek_ex
209return 1 for success or 0 for failure.
210Success means that one or more application data bytes
211have been read from the SSL connection.
212Failure means that no bytes could be read from the SSL connection.
213Failures can be retryable (e.g. we are waiting for more bytes to be
214delivered by the network) or non-retryable (e.g. a fatal network error).
215In the event of a failure, call
216.Xr SSL_get_error 3
217to find out the reason which indicates whether the call is retryable or not.
218.Pp
219For
220.Fn SSL_read
221and
222.Fn SSL_peek ,
223the following return values can occur:
224.Bl -tag -width Ds
225.It >0
226The read operation was successful.
227The return value is the number of bytes actually read from the
228TLS connection.
229.It 0
230The read operation was not successful.
231The reason may either be a clean shutdown due to a
232.Dq close notify
233alert sent by the peer (in which case the
234.Dv SSL_RECEIVED_SHUTDOWN
235flag in the ssl shutdown state is set (see
236.Xr SSL_shutdown 3
237and
238.Xr SSL_set_shutdown 3 ) .
239It is also possible that the peer simply shut down the underlying transport and
240the shutdown is incomplete.
241Call
242.Xr SSL_get_error 3
243with the return value to find out whether an error occurred or the connection
244was shut down cleanly
245.Pq Dv SSL_ERROR_ZERO_RETURN .
246.It <0
247The read operation was not successful, because either an error occurred or
248action must be taken by the calling process.
249Call
250.Xr SSL_get_error 3
251with the return value to find out the reason.
252.El
253.Sh SEE ALSO
254.Xr BIO_new 3 ,
255.Xr ssl 3 ,
256.Xr SSL_accept 3 ,
257.Xr SSL_connect 3 ,
258.Xr SSL_CTX_new 3 ,
259.Xr SSL_CTX_set_mode 3 ,
260.Xr SSL_get_error 3 ,
261.Xr SSL_pending 3 ,
262.Xr SSL_set_connect_state 3 ,
263.Xr SSL_set_shutdown 3 ,
264.Xr SSL_shutdown 3 ,
265.Xr SSL_write 3
266.Sh HISTORY
267.Fn SSL_read
268appeared in SSLeay 0.4 or earlier.
269.Fn SSL_peek
270first appeared in SSLeay 0.6.6.
271Both functions have been available since
272.Ox 2.4 .
273.Pp
274.Fn SSL_read_ex
275and
276.Fn SSL_peek_ex
277first appeared in OpenSSL 1.1.1 and have been available since
278.Ox 7.1 .
diff --git a/src/lib/libssl/man/SSL_read_early_data.3 b/src/lib/libssl/man/SSL_read_early_data.3
deleted file mode 100644
index 1435c15935..0000000000
--- a/src/lib/libssl/man/SSL_read_early_data.3
+++ /dev/null
@@ -1,174 +0,0 @@
1.\" $OpenBSD: SSL_read_early_data.3,v 1.4 2021/11/26 13:48:22 jsg Exp $
2.\" content checked up to: OpenSSL 6328d367 Jul 4 21:58:30 2020 +0200
3.\"
4.\" Copyright (c) 2020 Ingo Schwarze <schwarze@openbsd.org>
5.\"
6.\" Permission to use, copy, modify, and distribute this software for any
7.\" purpose with or without fee is hereby granted, provided that the above
8.\" copyright notice and this permission notice appear in all copies.
9.\"
10.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17.\"
18.Dd $Mdocdate: November 26 2021 $
19.Dt SSL_READ_EARLY_DATA 3
20.Os
21.Sh NAME
22.Nm SSL_CTX_set_max_early_data ,
23.Nm SSL_set_max_early_data ,
24.Nm SSL_SESSION_set_max_early_data ,
25.Nm SSL_CTX_get_max_early_data ,
26.Nm SSL_get_max_early_data ,
27.Nm SSL_SESSION_get_max_early_data ,
28.Nm SSL_write_early_data ,
29.Nm SSL_read_early_data ,
30.Nm SSL_get_early_data_status
31.Nd transmit application data during the handshake
32.Sh SYNOPSIS
33.In openssl/ssl.h
34.Ft int
35.Fo SSL_CTX_set_max_early_data
36.Fa "SSL_CTX *ctx"
37.Fa "uint32_t max_bytes"
38.Fc
39.Ft int
40.Fo SSL_set_max_early_data
41.Fa "SSL *ssl"
42.Fa "uint32_t max_bytes"
43.Fc
44.Ft int
45.Fo SSL_SESSION_set_max_early_data
46.Fa "SSL_SESSION *session"
47.Fa "uint32_t max_bytes"
48.Fc
49.Ft uint32_t
50.Fo SSL_CTX_get_max_early_data
51.Fa "const SSL_CTX *ctx"
52.Fc
53.Ft uint32_t
54.Fo SSL_get_max_early_data
55.Fa "const SSL *ssl"
56.Fc
57.Ft uint32_t
58.Fo SSL_SESSION_get_max_early_data
59.Fa "const SSL_SESSION *session"
60.Fc
61.Ft int
62.Fo SSL_write_early_data
63.Fa "SSL *ssl"
64.Fa "const void *buf"
65.Fa "size_t len"
66.Fa "size_t *written"
67.Fc
68.Ft int
69.Fo SSL_read_early_data
70.Fa "SSL *ssl"
71.Fa "void *buf"
72.Fa "size_t maxlen"
73.Fa "size_t *readbytes"
74.Fc
75.Ft int
76.Fo SSL_get_early_data_status
77.Fa "const SSL *ssl"
78.Fc
79.Sh DESCRIPTION
80In LibreSSL, these functions have no effect.
81They are only provided because some application programs
82expect the API to be available when TLSv1.3 is supported.
83Using these functions is strongly discouraged because they provide
84marginal benefit in the first place even when implemented and
85used as designed, because they have absurdly complicated semantics,
86and because when they are used, inconspicuous oversights are likely
87to cause serious security vulnerabilities.
88.Pp
89If these functions are used, other TLS implementations
90may allow the transfer of application data during the initial handshake.
91Even when used as designed, security of the connection is compromised;
92in particular, application data is exchanged with unauthenticated peers,
93and there is no forward secrecy.
94Other downsides include an increased risk of replay attacks.
95.Pp
96.Fn SSL_CTX_set_max_early_data ,
97.Fn SSL_set_max_early_data ,
98and
99.Fn SSL_SESSION_set_max_early_data
100are intended to configure the maximum number of bytes per session
101that can be transmitted during the handshake.
102With LibreSSL, all arguments are ignored.
103.Pp
104An endpoint can attempt to send application data with
105.Fn SSL_write_early_data
106during the handshake.
107With LibreSSL, such attempts always fail and set
108.Pf * Fa written
109to 0.
110.Pp
111A server can attempt to read application data from the client using
112.Fn SSL_read_early_data
113during the handshake.
114With LibreSSL, no such data is ever accepted and
115.Pf * Fa readbytes
116is always set to 0.
117.Sh RETURN VALUES
118.Fn SSL_CTX_set_max_early_data ,
119.Fn SSL_set_max_early_data ,
120and
121.Fn SSL_SESSION_set_max_early_data
122return 1 for success or 0 for failure.
123With LibreSSL, they always succeed.
124.Pp
125.Fn SSL_CTX_get_max_early_data ,
126.Fn SSL_get_max_early_data ,
127and
128.Fn SSL_SESSION_get_max_early_data
129return the maximum number of bytes of application data
130that will be accepted from the peer during the handshake.
131With LibreSSL, they always return 0.
132.Pp
133.Fn SSL_write_early_data
134returns 1 for success or 0 for failure.
135With LibreSSL, it always fails.
136.Pp
137With LibreSSL,
138.Fn SSL_read_early_data
139always returns
140.Dv SSL_READ_EARLY_DATA_FINISH
141on the server side and
142.Dv SSL_READ_EARLY_DATA_ERROR
143on the client side.
144.Dv SSL_READ_EARLY_DATA_SUCCESS
145can occur with other implementations, but not with LibreSSL.
146.Pp
147With LibreSSL,
148.Fn SSL_get_early_data_status
149always returns
150.Dv SSL_EARLY_DATA_REJECTED .
151With other implementations, it might also return
152.Dv SSL_EARLY_DATA_NOT_SENT
153or
154.Dv SSL_EARLY_DATA_ACCEPTED .
155.Sh SEE ALSO
156.Xr ssl 3 ,
157.Xr SSL_read 3 ,
158.Xr SSL_write 3
159.Sh STANDARDS
160RFC 8446: The Transport Layer Security (TLS) Protocol Version 1.3:
161.Bl -tag -width "section 4.2.10" -compact
162.It Section 2.3
1630-RTT data
164.It Section 4.2.10
165Early Data Indication
166.It Section 8
1670-RTT and Anti-Replay
168.It Appendix E.5
169Replay Attacks on 0-RTT
170.El
171.Sh HISTORY
172These functions first appeared in OpenSSL 1.1.1
173and have been available since
174.Ox 7.0 .
diff --git a/src/lib/libssl/man/SSL_renegotiate.3 b/src/lib/libssl/man/SSL_renegotiate.3
deleted file mode 100644
index 8188d37323..0000000000
--- a/src/lib/libssl/man/SSL_renegotiate.3
+++ /dev/null
@@ -1,166 +0,0 @@
1.\" $OpenBSD: SSL_renegotiate.3,v 1.9 2019/06/12 09:36:30 schwarze Exp $
2.\" OpenSSL SSL_key_update.pod 4fbfe86a Feb 16 17:04:40 2017 +0000
3.\"
4.\" This file is a derived work.
5.\" Some parts are covered by the following Copyright and license:
6.\"
7.\" Copyright (c) 2016, 2017 Ingo Schwarze <schwarze@openbsd.org>
8.\"
9.\" Permission to use, copy, modify, and distribute this software for any
10.\" purpose with or without fee is hereby granted, provided that the above
11.\" copyright notice and this permission notice appear in all copies.
12.\"
13.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
14.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
15.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
16.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
17.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
18.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
19.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20.\"
21.\" Other parts were written by Matt Caswell <matt@openssl.org>.
22.\" Copyright (c) 2017 The OpenSSL Project. All rights reserved.
23.\"
24.\" Redistribution and use in source and binary forms, with or without
25.\" modification, are permitted provided that the following conditions
26.\" are met:
27.\"
28.\" 1. Redistributions of source code must retain the above copyright
29.\" notice, this list of conditions and the following disclaimer.
30.\"
31.\" 2. Redistributions in binary form must reproduce the above copyright
32.\" notice, this list of conditions and the following disclaimer in
33.\" the documentation and/or other materials provided with the
34.\" distribution.
35.\"
36.\" 3. All advertising materials mentioning features or use of this
37.\" software must display the following acknowledgment:
38.\" "This product includes software developed by the OpenSSL Project
39.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
40.\"
41.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
42.\" endorse or promote products derived from this software without
43.\" prior written permission. For written permission, please contact
44.\" openssl-core@openssl.org.
45.\"
46.\" 5. Products derived from this software may not be called "OpenSSL"
47.\" nor may "OpenSSL" appear in their names without prior written
48.\" permission of the OpenSSL Project.
49.\"
50.\" 6. Redistributions of any form whatsoever must retain the following
51.\" acknowledgment:
52.\" "This product includes software developed by the OpenSSL Project
53.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
54.\"
55.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
56.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
57.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
58.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
59.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
60.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
61.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
62.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
63.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
64.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
65.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
66.\" OF THE POSSIBILITY OF SUCH DAMAGE.
67.\"
68.Dd $Mdocdate: June 12 2019 $
69.Dt SSL_RENEGOTIATE 3
70.Os
71.Sh NAME
72.Nm SSL_renegotiate ,
73.Nm SSL_renegotiate_abbreviated ,
74.Nm SSL_renegotiate_pending
75.Nd initiate a new TLS handshake
76.Sh SYNOPSIS
77.In openssl/ssl.h
78.Ft int
79.Fo SSL_renegotiate
80.Fa "SSL *ssl"
81.Fc
82.Ft int
83.Fo SSL_renegotiate_abbreviated
84.Fa "SSL *ssl"
85.Fc
86.Ft int
87.Fo SSL_renegotiate_pending
88.Fa "SSL *ssl"
89.Fc
90.Sh DESCRIPTION
91When called from the client side,
92.Fn SSL_renegotiate
93schedules a completely new handshake over an existing TLS connection.
94The next time an I/O operation such as
95.Fn SSL_read
96or
97.Fn SSL_write
98takes place on the connection, a check is performed to confirm
99that it is a suitable time to start a renegotiation.
100If so, a new handshake is initiated immediately.
101An existing session associated with the connection is not resumed.
102.Pp
103This function is automatically called by
104.Xr SSL_read 3
105and
106.Xr SSL_write 3
107whenever the renegotiation byte count set by
108.Xr BIO_set_ssl_renegotiate_bytes 3
109or the timeout set by
110.Xr BIO_set_ssl_renegotiate_timeout 3
111are exceeded.
112.Pp
113When called from the client side,
114.Fn SSL_renegotiate_abbreviated
115is similar to
116.Fn SSL_renegotiate
117except that resuming the session associated with the current
118connection is attempted in the new handshake.
119.Pp
120When called from the server side,
121.Fn SSL_renegotiate
122and
123.Fn SSL_renegotiate_abbreviated
124behave identically.
125They both schedule a request for a new handshake to be sent to the client.
126The next time an I/O operation is performed, the same checks as on
127the client side are performed and then, if appropriate, the request
128is sent.
129The client may or may not respond with a new handshake and it may
130or may not attempt to resume an existing session.
131If a new handshake is started, it is handled transparently during
132any I/O function.
133.Pp
134If a LibreSSL client receives a renegotiation request from a server,
135it is also handled transparently during any I/O function.
136The client attempts to resume the current session in the new
137handshake.
138For historical reasons, DTLS clients do not attempt to resume
139the session in the new handshake.
140.Sh RETURN VALUES
141.Fn SSL_renegotiate
142and
143.Fn SSL_renegotiate_abbreviated
144return 1 on success or 0 on error.
145.Pp
146.Fn SSL_renegotiate_pending
147returns 1 if a renegotiation or renegotiation request has been
148scheduled but not yet acted on, or 0 otherwise.
149.Sh SEE ALSO
150.Xr ssl 3 ,
151.Xr SSL_do_handshake 3 ,
152.Xr SSL_num_renegotiations 3 ,
153.Xr SSL_read 3 ,
154.Xr SSL_write 3
155.Sh HISTORY
156.Fn SSL_renegotiate
157first appeared in SSLeay 0.8.0 and has been available since
158.Ox 2.4 .
159.Pp
160.Fn SSL_renegotiate_pending
161first appeared in OpenSSL 0.9.7 and has been available since
162.Ox 3.2 .
163.Pp
164.Fn SSL_renegotiate_abbreviated
165first appeared in OpenSSL 1.0.1 and has been available since
166.Ox 5.3 .
diff --git a/src/lib/libssl/man/SSL_rstate_string.3 b/src/lib/libssl/man/SSL_rstate_string.3
deleted file mode 100644
index 99613ba3c0..0000000000
--- a/src/lib/libssl/man/SSL_rstate_string.3
+++ /dev/null
@@ -1,108 +0,0 @@
1.\" $OpenBSD: SSL_rstate_string.3,v 1.4 2018/03/27 17:35:50 schwarze Exp $
2.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
5.\" Copyright (c) 2001 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: March 27 2018 $
52.Dt SSL_RSTATE_STRING 3
53.Os
54.Sh NAME
55.Nm SSL_rstate_string ,
56.Nm SSL_rstate_string_long
57.Nd get textual description of state of an SSL object during read operation
58.Sh SYNOPSIS
59.In openssl/ssl.h
60.Ft const char *
61.Fn SSL_rstate_string "SSL *ssl"
62.Ft const char *
63.Fn SSL_rstate_string_long "SSL *ssl"
64.Sh DESCRIPTION
65.Fn SSL_rstate_string
66returns a 2-letter string indicating the current read state of the
67.Vt SSL
68object
69.Fa ssl .
70.Pp
71.Fn SSL_rstate_string_long
72returns a string indicating the current read state of the
73.Vt SSL
74object
75.Fa ssl .
76.Pp
77When performing a read operation, the SSL/TLS engine must parse the record,
78consisting of header and body.
79When working in a blocking environment,
80.Fn SSL_rstate_string[_long]
81should always return
82.Qo RD Qc Ns / Ns Qo read done Qc .
83.Pp
84This function should only seldom be needed in applications.
85.Sh RETURN VALUES
86.Fn SSL_rstate_string
87and
88.Fn SSL_rstate_string_long
89can return the following values:
90.Bl -tag -width Ds
91.It Qo RH Qc Ns / Ns Qo read header Qc
92The header of the record is being evaluated.
93.It Qo RB Qc Ns / Ns Qo read body Qc
94The body of the record is being evaluated.
95.It Qo RD Qc Ns / Ns Qo read done Qc
96The record has been completely processed.
97.It Qo unknown Qc Ns / Ns Qo unknown Qc
98The read state is unknown.
99This should never happen.
100.El
101.Sh SEE ALSO
102.Xr ssl 3
103.Sh HISTORY
104.Fn SSL_rstate_string
105and
106.Fn SSL_rstate_string_long
107first appeared in SSLeay 0.6.0 and have been available since
108.Ox 2.4 .
diff --git a/src/lib/libssl/man/SSL_session_reused.3 b/src/lib/libssl/man/SSL_session_reused.3
deleted file mode 100644
index add61a904b..0000000000
--- a/src/lib/libssl/man/SSL_session_reused.3
+++ /dev/null
@@ -1,84 +0,0 @@
1.\" $OpenBSD: SSL_session_reused.3,v 1.6 2019/06/12 09:36:30 schwarze Exp $
2.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
5.\" Copyright (c) 2001 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: June 12 2019 $
52.Dt SSL_SESSION_REUSED 3
53.Os
54.Sh NAME
55.Nm SSL_session_reused
56.Nd query whether a reused session was negotiated during handshake
57.Sh SYNOPSIS
58.In openssl/ssl.h
59.Ft int
60.Fn SSL_session_reused "SSL *ssl"
61.Sh DESCRIPTION
62Query whether a reused session was negotiated during the handshake.
63.Pp
64During the negotiation, a client can propose to reuse a session.
65The server then looks up the session in its cache.
66If both client and server agree on the session,
67it will be reused and a flag is set that can be queried by the application.
68.Sh RETURN VALUES
69The following return values can occur:
70.Bl -tag -width Ds
71.It 0
72A new session was negotiated.
73.It 1
74A session was reused.
75.El
76.Sh SEE ALSO
77.Xr ssl 3 ,
78.Xr SSL_ctrl 3 ,
79.Xr SSL_CTX_set_session_cache_mode 3 ,
80.Xr SSL_set_session 3
81.Sh HISTORY
82.Fn SSL_session_reused
83first appeared in SSLeay 0.8.0 and has been available since
84.Ox 2.4 .
diff --git a/src/lib/libssl/man/SSL_set1_host.3 b/src/lib/libssl/man/SSL_set1_host.3
deleted file mode 100644
index 2a3935c3f2..0000000000
--- a/src/lib/libssl/man/SSL_set1_host.3
+++ /dev/null
@@ -1,172 +0,0 @@
1.\" $OpenBSD: SSL_set1_host.3,v 1.4 2021/03/31 16:56:46 tb Exp $
2.\" selective merge up to: OpenSSL 6328d367 Jul 4 21:58:30 2020 +0200
3.\"
4.\" This file was written by Viktor Dukhovni <viktor@openssl.org>
5.\" Copyright (c) 2015 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: March 31 2021 $
52.Dt SSL_SET1_HOST 3
53.Os
54.Sh NAME
55.Nm SSL_set1_host ,
56.Nm SSL_set_hostflags ,
57.Nm SSL_get0_peername
58.Nd SSL server verification parameters
59.Sh SYNOPSIS
60.In openssl/ssl.h
61.Ft int
62.Fo SSL_set1_host
63.Fa "SSL *ssl"
64.Fa "const char *hostname"
65.Fc
66.Ft void
67.Fo SSL_set_hostflags
68.Fa "SSL *ssl"
69.Fa "unsigned int flags"
70.Fc
71.Ft const char *
72.Fo SSL_get0_peername
73.Fa "SSL *ssl"
74.Fc
75.Sh DESCRIPTION
76.Fn SSL_set1_host
77configures a server hostname check in the
78.Fa ssl
79client, setting the expected DNS hostname to
80.Fa hostname
81and clearing any previously specified hostname.
82If
83.Fa hostname
84is
85.Dv NULL
86or the empty string, name checks are not performed on the peer certificate.
87If a nonempty
88.Fa hostname
89is specified, certificate verification automatically checks the peer
90hostname via
91.Xr X509_check_host 3
92with
93.Fa flags
94set to 0.
95.Pp
96.Fn SSL_set_hostflags
97sets the flags that will be passed to
98.Xr X509_check_host 3
99when name checks are applicable,
100by default the flags value is 0.
101See
102.Xr X509_check_host 3
103for the list of available flags and their meaning.
104.Pp
105.Fn SSL_get0_peername
106returns the DNS hostname or subject CommonName from the peer certificate
107that matched one of the reference identifiers.
108Unless wildcard matching is disabled, the name matched in the peer
109certificate may be a wildcard name.
110A reference identifier starting with
111.Sq \&.
112indicates a parent domain prefix rather than a fixed name.
113In this case, the matched peername may be a sub-domain
114of the reference identifier.
115The returned string is owned by the library and is no longer valid
116once the associated
117.Fa ssl
118object is cleared or freed, or if a renegotiation takes place.
119Applications must not free the return value.
120.Pp
121SSL clients are advised to use these functions in preference to
122explicitly calling
123.Xr X509_check_host 3 .
124.Sh RETURN VALUES
125.Fn SSL_set1_host
126returns 1 for success or 0 for failure.
127.Pp
128.Fn SSL_get0_peername
129returns the matched peername or
130.Dv NULL
131if peername verification is not applicable
132or no trusted peername was matched.
133Use
134.Xr SSL_get_verify_result 3
135to determine whether verification succeeded.
136.Sh EXAMPLES
137The calls below check the hostname.
138Wildcards are supported, but they must match the entire label.
139The actual name matched in the certificate (which might be a wildcard)
140is retrieved, and must be copied by the application if it is to be
141retained beyond the lifetime of the SSL connection.
142.Bd -literal
143if (!SSL_set1_host(ssl, "smtp.example.com"))
144 /* error */
145
146/* XXX: Perform SSL_connect() handshake and handle errors here */
147
148if (SSL_get_verify_result(ssl) == X509_V_OK) {
149 const char *peername = SSL_get0_peername(ssl);
150
151 if (peername != NULL)
152 /* Name checks were in scope and matched the peername */
153}
154.Ed
155.Sh SEE ALSO
156.Xr ssl 3 ,
157.Xr SSL_CTX_set_verify 3 ,
158.Xr SSL_get_peer_certificate 3 ,
159.Xr SSL_get_verify_result 3 ,
160.Xr X509_check_host 3 ,
161.Xr X509_VERIFY_PARAM_set1_host 3
162.Sh HISTORY
163All three functions first appeared in OpenSSL 1.1.0.
164.Fn SSL_set1_host
165has been available since
166.Ox 6.5 ,
167and
168.Fn SSL_set_hostflags
169and
170.Fn SSL_get0_peername
171since
172.Ox 6.9 .
diff --git a/src/lib/libssl/man/SSL_set1_param.3 b/src/lib/libssl/man/SSL_set1_param.3
deleted file mode 100644
index cd8ad40ad0..0000000000
--- a/src/lib/libssl/man/SSL_set1_param.3
+++ /dev/null
@@ -1,137 +0,0 @@
1.\" $OpenBSD: SSL_set1_param.3,v 1.6 2022/09/10 10:22:46 jsg Exp $
2.\" full merge up to:
3.\" OpenSSL man3/SSL_CTX_get0_param 99d63d46 Oct 26 13:56:48 2016 -0400
4.\"
5.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
6.\" Copyright (c) 2015 The OpenSSL Project. All rights reserved.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\"
12.\" 1. Redistributions of source code must retain the above copyright
13.\" notice, this list of conditions and the following disclaimer.
14.\"
15.\" 2. Redistributions in binary form must reproduce the above copyright
16.\" notice, this list of conditions and the following disclaimer in
17.\" the documentation and/or other materials provided with the
18.\" distribution.
19.\"
20.\" 3. All advertising materials mentioning features or use of this
21.\" software must display the following acknowledgment:
22.\" "This product includes software developed by the OpenSSL Project
23.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
24.\"
25.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
26.\" endorse or promote products derived from this software without
27.\" prior written permission. For written permission, please contact
28.\" openssl-core@openssl.org.
29.\"
30.\" 5. Products derived from this software may not be called "OpenSSL"
31.\" nor may "OpenSSL" appear in their names without prior written
32.\" permission of the OpenSSL Project.
33.\"
34.\" 6. Redistributions of any form whatsoever must retain the following
35.\" acknowledgment:
36.\" "This product includes software developed by the OpenSSL Project
37.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
38.\"
39.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
40.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
43.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50.\" OF THE POSSIBILITY OF SUCH DAMAGE.
51.\"
52.Dd $Mdocdate: September 10 2022 $
53.Dt SSL_SET1_PARAM 3
54.Os
55.Sh NAME
56.Nm SSL_CTX_get0_param ,
57.Nm SSL_get0_param ,
58.Nm SSL_CTX_set1_param ,
59.Nm SSL_set1_param
60.Nd get and set verification parameters
61.Sh SYNOPSIS
62.In openssl/ssl.h
63.Ft X509_VERIFY_PARAM *
64.Fo SSL_CTX_get0_param
65.Fa "SSL_CTX *ctx"
66.Fc
67.Ft X509_VERIFY_PARAM *
68.Fo SSL_get0_param
69.Fa "SSL *ssl"
70.Fc
71.Ft int
72.Fo SSL_CTX_set1_param
73.Fa "SSL_CTX *ctx"
74.Fa "X509_VERIFY_PARAM *vpm"
75.Fc
76.Ft int
77.Fo SSL_set1_param
78.Fa "SSL *ssl"
79.Fa "X509_VERIFY_PARAM *vpm"
80.Fc
81.Sh DESCRIPTION
82.Fn SSL_CTX_get0_param
83and
84.Fn SSL_get0_param
85retrieve an internal pointer to the verification parameters for
86.Fa ctx
87or
88.Fa ssl ,
89respectively.
90The returned pointer must not be freed by the calling application,
91but the application can modify the parameters pointed to,
92to suit its needs: for example to add a hostname check.
93.Pp
94.Fn SSL_CTX_set1_param
95and
96.Fn SSL_set1_param
97set the verification parameters to
98.Fa vpm
99for
100.Fa ctx
101or
102.Fa ssl .
103.Sh RETURN VALUES
104.Fn SSL_CTX_get0_param
105and
106.Fn SSL_get0_param
107return a pointer to an
108.Vt X509_VERIFY_PARAM
109structure.
110.Pp
111.Fn SSL_CTX_set1_param
112and
113.Fn SSL_set1_param
114return 1 for success or 0 for failure.
115.Sh EXAMPLES
116Check that the hostname matches
117.Pa www.foo.com
118in the peer certificate:
119.Bd -literal -offset indent
120X509_VERIFY_PARAM *vpm = SSL_get0_param(ssl);
121X509_VERIFY_PARAM_set1_host(vpm, "www.foo.com", 0);
122.Ed
123.Sh SEE ALSO
124.Xr ssl 3 ,
125.Xr X509_VERIFY_PARAM_set_flags 3
126.Sh HISTORY
127.Fn SSL_CTX_set1_param
128and
129.Fn SSL_set1_param
130first appeared in OpenSSL 1.0.0 and have been available since
131.Ox 4.9 .
132.Pp
133.Fn SSL_CTX_get0_param
134and
135.Fn SSL_get0_param
136first appeared in OpenSSL 1.0.2 and have been available since
137.Ox 6.3 .
diff --git a/src/lib/libssl/man/SSL_set_SSL_CTX.3 b/src/lib/libssl/man/SSL_set_SSL_CTX.3
deleted file mode 100644
index 2abaefb292..0000000000
--- a/src/lib/libssl/man/SSL_set_SSL_CTX.3
+++ /dev/null
@@ -1,67 +0,0 @@
1.\" $OpenBSD: SSL_set_SSL_CTX.3,v 1.4 2022/07/13 22:05:53 schwarze Exp $
2.\"
3.\" Copyright (c) 2020 Ingo Schwarze <schwarze@openbsd.org>
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd $Mdocdate: July 13 2022 $
18.Dt SSL_SET_SSL_CTX 3
19.Os
20.Sh NAME
21.Nm SSL_set_SSL_CTX
22.Nd modify an SSL connection object to use another context
23.Sh SYNOPSIS
24.In openssl/ssl.h
25.Ft SSL_CTX *
26.Fo SSL_set_SSL_CTX
27.Fa "SSL *ssl"
28.Fa "SSL_CTX* ctx"
29.Fc
30.Sh DESCRIPTION
31.Fn SSL_set_SSL_CTX
32causes
33.Fa ssl
34to use the context
35.Fa ctx .
36.Pp
37If
38.Fa ctx
39is
40.Dv NULL ,
41.Fa ssl
42reverts to using the context that it was initially created from with
43.Xr SSL_new 3 .
44.Pp
45If
46.Fa ssl
47already uses
48.Fa ctx ,
49no action occurs.
50.Sh RETURN VALUES
51.Fn SSL_set_SSL_CTX
52returns an internal pointer to the context that
53.Fa ssl
54is using as a result of the call, or
55.Dv NULL
56if memory allocation fails.
57.Sh SEE ALSO
58.Xr ssl 3 ,
59.Xr SSL_clear 3 ,
60.Xr SSL_CTX_new 3 ,
61.Xr SSL_get_SSL_CTX 3 ,
62.Xr SSL_new 3 ,
63.Xr SSL_set_security_level 3
64.Sh HISTORY
65.Fn SSL_set_SSL_CTX
66first appeared in OpenSSL 0.9.8f and has been available since
67.Ox 4.5 .
diff --git a/src/lib/libssl/man/SSL_set_bio.3 b/src/lib/libssl/man/SSL_set_bio.3
deleted file mode 100644
index e727f442d6..0000000000
--- a/src/lib/libssl/man/SSL_set_bio.3
+++ /dev/null
@@ -1,99 +0,0 @@
1.\" $OpenBSD: SSL_set_bio.3,v 1.6 2020/10/08 18:21:30 tb Exp $
2.\" OpenSSL acb5b343 Sep 16 16:00:38 2000 +0000
3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
5.\" Copyright (c) 2000 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: October 8 2020 $
52.Dt SSL_SET_BIO 3
53.Os
54.Sh NAME
55.Nm SSL_set_bio
56.Nd connect the SSL object with a BIO
57.Sh SYNOPSIS
58.In openssl/ssl.h
59.Ft void
60.Fn SSL_set_bio "SSL *ssl" "BIO *rbio" "BIO *wbio"
61.Sh DESCRIPTION
62.Fn SSL_set_bio
63connects the
64.Vt BIO Ns
65s
66.Fa rbio
67and
68.Fa wbio
69for the read and write operations of the TLS/SSL (encrypted) side of
70.Fa ssl .
71.Pp
72The SSL engine inherits the behaviour of
73.Fa rbio
74and
75.Fa wbio ,
76respectively.
77If a
78.Vt BIO
79is non-blocking, the
80.Fa ssl
81will also have non-blocking behaviour.
82.Pp
83If there was already a
84.Vt BIO
85connected to
86.Fa ssl ,
87.Xr BIO_free 3
88will be called (for both the reading and writing side, if different).
89.Sh SEE ALSO
90.Xr BIO_new 3 ,
91.Xr ssl 3 ,
92.Xr SSL_accept 3 ,
93.Xr SSL_connect 3 ,
94.Xr SSL_get_rbio 3 ,
95.Xr SSL_shutdown 3
96.Sh HISTORY
97.Fn SSL_set_bio
98first appeared in SSLeay 0.6.0 and has been available since
99.Ox 2.4 .
diff --git a/src/lib/libssl/man/SSL_set_connect_state.3 b/src/lib/libssl/man/SSL_set_connect_state.3
deleted file mode 100644
index c2072c4370..0000000000
--- a/src/lib/libssl/man/SSL_set_connect_state.3
+++ /dev/null
@@ -1,153 +0,0 @@
1.\" $OpenBSD: SSL_set_connect_state.3,v 1.6 2018/03/27 17:35:50 schwarze Exp $
2.\" full merge up to OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400
3.\" selective merge up to: OpenSSL dbd007d7 Jul 28 13:31:27 2017 +0800
4.\"
5.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>
6.\" and Paul Yang <yang.yang@baishancloud.com>.
7.\" Copyright (c) 2001, 2017 The OpenSSL Project. All rights reserved.
8.\"
9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions
11.\" are met:
12.\"
13.\" 1. Redistributions of source code must retain the above copyright
14.\" notice, this list of conditions and the following disclaimer.
15.\"
16.\" 2. Redistributions in binary form must reproduce the above copyright
17.\" notice, this list of conditions and the following disclaimer in
18.\" the documentation and/or other materials provided with the
19.\" distribution.
20.\"
21.\" 3. All advertising materials mentioning features or use of this
22.\" software must display the following acknowledgment:
23.\" "This product includes software developed by the OpenSSL Project
24.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
25.\"
26.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
27.\" endorse or promote products derived from this software without
28.\" prior written permission. For written permission, please contact
29.\" openssl-core@openssl.org.
30.\"
31.\" 5. Products derived from this software may not be called "OpenSSL"
32.\" nor may "OpenSSL" appear in their names without prior written
33.\" permission of the OpenSSL Project.
34.\"
35.\" 6. Redistributions of any form whatsoever must retain the following
36.\" acknowledgment:
37.\" "This product includes software developed by the OpenSSL Project
38.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
39.\"
40.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
41.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
42.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
43.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
44.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
45.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
46.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
47.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
49.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
50.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
51.\" OF THE POSSIBILITY OF SUCH DAMAGE.
52.\"
53.Dd $Mdocdate: March 27 2018 $
54.Dt SSL_SET_CONNECT_STATE 3
55.Os
56.Sh NAME
57.Nm SSL_set_connect_state ,
58.Nm SSL_set_accept_state ,
59.Nm SSL_is_server
60.Nd prepare SSL object to work in client or server mode
61.Sh SYNOPSIS
62.In openssl/ssl.h
63.Ft void
64.Fn SSL_set_connect_state "SSL *ssl"
65.Ft void
66.Fn SSL_set_accept_state "SSL *ssl"
67.Ft int
68.Fn SSL_is_server "const SSL *ssl"
69.Sh DESCRIPTION
70.Fn SSL_set_connect_state
71sets
72.Fa ssl
73to work in client mode.
74.Pp
75.Fn SSL_set_accept_state
76sets
77.Fa ssl
78to work in server mode.
79.Pp
80.Fn SSL_is_server
81checks whether
82.Fa ssl
83is set to server mode.
84.Pp
85When the
86.Vt SSL_CTX
87object was created with
88.Xr SSL_CTX_new 3 ,
89it was either assigned a dedicated client method, a dedicated server method, or
90a generic method, that can be used for both client and server connections.
91(The method might have been changed with
92.Xr SSL_CTX_set_ssl_version 3
93or
94.Xr SSL_set_ssl_method 3 . )
95.Pp
96When beginning a new handshake, the SSL engine must know whether it must call
97the connect (client) or accept (server) routines.
98Even though it may be clear from the method chosen whether client or server
99mode was requested, the handshake routines must be explicitly set.
100.Pp
101When using the
102.Xr SSL_connect 3
103or
104.Xr SSL_accept 3
105routines, the correct handshake routines are automatically set.
106When performing a transparent negotiation using
107.Xr SSL_write 3
108or
109.Xr SSL_read 3 ,
110the handshake routines must be explicitly set in advance using either
111.Fn SSL_set_connect_state
112or
113.Fn SSL_set_accept_state .
114.Pp
115If
116.Fn SSL_is_server
117is called before
118.Fn SSL_set_connect_state
119or
120.Fn SSL_set_accept_state
121was called either automatically or explicitly,
122the result depends on what method was used when the
123.Fa SSL_CTX
124was created.
125If a generic method or a dedicated server method was passed to
126.Xr SSL_CTX_new 3 ,
127.Fn SSL_is_server
128returns 1; otherwise, it returns 0.
129.Sh RETURN VALUES
130.Fn SSL_is_server
131returns 1 if
132.Fa ssl
133is set to server mode or 0 if it is set to client mode.
134.Sh SEE ALSO
135.Xr ssl 3 ,
136.Xr SSL_accept 3 ,
137.Xr SSL_connect 3 ,
138.Xr SSL_CTX_new 3 ,
139.Xr SSL_CTX_set_ssl_version 3 ,
140.Xr SSL_do_handshake 3 ,
141.Xr SSL_new 3 ,
142.Xr SSL_read 3 ,
143.Xr SSL_write 3
144.Sh HISTORY
145.Fn SSL_set_connect_state
146and
147.Fn SSL_set_accept_state
148first appeared in SSLeay 0.6.0 and have been available since
149.Ox 2.4 .
150.Pp
151.Fn SSL_is_server
152first appeared in OpenSSL 1.0.2 and has been available since
153.Ox 6.3 .
diff --git a/src/lib/libssl/man/SSL_set_fd.3 b/src/lib/libssl/man/SSL_set_fd.3
deleted file mode 100644
index 7b9727e9ad..0000000000
--- a/src/lib/libssl/man/SSL_set_fd.3
+++ /dev/null
@@ -1,129 +0,0 @@
1.\" $OpenBSD: SSL_set_fd.3,v 1.5 2018/03/27 17:35:50 schwarze Exp $
2.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
5.\" Copyright (c) 2000, 2013 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: March 27 2018 $
52.Dt SSL_SET_FD 3
53.Os
54.Sh NAME
55.Nm SSL_set_fd ,
56.Nm SSL_set_rfd ,
57.Nm SSL_set_wfd
58.Nd connect the SSL object with a file descriptor
59.Sh SYNOPSIS
60.In openssl/ssl.h
61.Ft int
62.Fn SSL_set_fd "SSL *ssl" "int fd"
63.Ft int
64.Fn SSL_set_rfd "SSL *ssl" "int fd"
65.Ft int
66.Fn SSL_set_wfd "SSL *ssl" "int fd"
67.Sh DESCRIPTION
68.Fn SSL_set_fd
69sets the file descriptor
70.Fa fd
71as the input/output facility for the TLS/SSL (encrypted) side of
72.Fa ssl .
73.Fa fd
74will typically be the socket file descriptor of a network connection.
75.Pp
76When performing the operation, a socket
77.Vt BIO
78is automatically created to interface between the
79.Fa ssl
80and
81.Fa fd .
82The
83.Vt BIO
84and hence the SSL engine inherit the behaviour of
85.Fa fd .
86If
87.Fa fd
88is non-blocking, the
89.Fa ssl
90will also have non-blocking behaviour.
91.Pp
92If there was already a
93.Vt BIO
94connected to
95.Fa ssl ,
96.Xr BIO_free 3
97will be called (for both the reading and writing side, if different).
98.Pp
99.Fn SSL_set_rfd
100and
101.Fn SSL_set_wfd
102perform the respective action, but only for the read channel or the write
103channel, which can be set independently.
104.Sh RETURN VALUES
105The following return values can occur:
106.Bl -tag -width Ds
107.It 0
108The operation failed.
109Check the error stack to find out why.
110.It 1
111The operation succeeded.
112.El
113.Sh SEE ALSO
114.Xr BIO_new 3 ,
115.Xr ssl 3 ,
116.Xr SSL_accept 3 ,
117.Xr SSL_connect 3 ,
118.Xr SSL_get_fd 3 ,
119.Xr SSL_set_bio 3 ,
120.Xr SSL_shutdown 3
121.Sh HISTORY
122.Fn SSL_set_fd
123appeared in SSLeay 0.4 or earlier.
124.Fn SSL_set_rfd
125and
126.Fn SSL_set_wfd
127first appeared in SSLeay 0.6.0.
128These functions have been available since
129.Ox 2.4 .
diff --git a/src/lib/libssl/man/SSL_set_max_send_fragment.3 b/src/lib/libssl/man/SSL_set_max_send_fragment.3
deleted file mode 100644
index 7de087a743..0000000000
--- a/src/lib/libssl/man/SSL_set_max_send_fragment.3
+++ /dev/null
@@ -1,97 +0,0 @@
1.\" $OpenBSD: SSL_set_max_send_fragment.3,v 1.5 2019/06/12 09:36:30 schwarze Exp $
2.\" OpenSSL doc/man3/SSL_CTX_set_split_send_fragment.pod
3.\" OpenSSL 6782e5fd Oct 21 16:16:20 2016 +0100
4.\"
5.\" This file was written by Matt Caswell <matt@openssl.org>.
6.\" Copyright (c) 2016 The OpenSSL Project. All rights reserved.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\"
12.\" 1. Redistributions of source code must retain the above copyright
13.\" notice, this list of conditions and the following disclaimer.
14.\"
15.\" 2. Redistributions in binary form must reproduce the above copyright
16.\" notice, this list of conditions and the following disclaimer in
17.\" the documentation and/or other materials provided with the
18.\" distribution.
19.\"
20.\" 3. All advertising materials mentioning features or use of this
21.\" software must display the following acknowledgment:
22.\" "This product includes software developed by the OpenSSL Project
23.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
24.\"
25.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
26.\" endorse or promote products derived from this software without
27.\" prior written permission. For written permission, please contact
28.\" openssl-core@openssl.org.
29.\"
30.\" 5. Products derived from this software may not be called "OpenSSL"
31.\" nor may "OpenSSL" appear in their names without prior written
32.\" permission of the OpenSSL Project.
33.\"
34.\" 6. Redistributions of any form whatsoever must retain the following
35.\" acknowledgment:
36.\" "This product includes software developed by the OpenSSL Project
37.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
38.\"
39.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
40.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
43.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50.\" OF THE POSSIBILITY OF SUCH DAMAGE.
51.\"
52.Dd $Mdocdate: June 12 2019 $
53.Dt SSL_SET_MAX_SEND_FRAGMENT 3
54.Os
55.Sh NAME
56.Nm SSL_CTX_set_max_send_fragment ,
57.Nm SSL_set_max_send_fragment
58.Nd control fragment sizes
59.Sh SYNOPSIS
60.In openssl/ssl.h
61.Ft long
62.Fo SSL_CTX_set_max_send_fragment
63.Fa "SSL_CTX *ctx"
64.Fa "long m"
65.Fc
66.Ft long
67.Fo SSL_set_max_send_fragment
68.Fa "SSL *ssl"
69.Fa "long m"
70.Fc
71.Sh DESCRIPTION
72.Fn SSL_CTX_set_max_send_fragment
73and
74.Fn SSL_set_max_send_fragment
75set the
76.Sy max_send_fragment
77parameter for SSL_CTX and SSL objects respectively.
78This value restricts the amount of plaintext bytes that will be sent in
79any one SSL/TLS record.
80By default its value is SSL3_RT_MAX_PLAIN_LENGTH (16384).
81These functions will only accept a value in the range 512 -
82SSL3_RT_MAX_PLAIN_LENGTH.
83.Pp
84These functions are implemented using macros.
85.Sh RETURN VALUES
86These functions return 1 on success or 0 on failure.
87.Sh SEE ALSO
88.Xr ssl 3 ,
89.Xr SSL_ctrl 3 ,
90.Xr SSL_CTX_set_read_ahead 3 ,
91.Xr SSL_pending 3
92.Sh HISTORY
93.Fn SSL_CTX_set_max_send_fragment
94and
95.Fn SSL_set_max_send_fragment
96first appeared in OpenSSL 1.0.0 and have been available since
97.Ox 4.9 .
diff --git a/src/lib/libssl/man/SSL_set_psk_use_session_callback.3 b/src/lib/libssl/man/SSL_set_psk_use_session_callback.3
deleted file mode 100644
index 7f2bfcc010..0000000000
--- a/src/lib/libssl/man/SSL_set_psk_use_session_callback.3
+++ /dev/null
@@ -1,86 +0,0 @@
1.\" $OpenBSD: SSL_set_psk_use_session_callback.3,v 1.1 2021/09/14 14:30:57 schwarze Exp $
2.\" OpenSSL man3/SSL_CTX_set_psk_client_callback.pod
3.\" checked up to 24a535ea Sep 22 13:14:20 2020 +0100
4.\"
5.\" Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org>
6.\"
7.\" Permission to use, copy, modify, and distribute this software for any
8.\" purpose with or without fee is hereby granted, provided that the above
9.\" copyright notice and this permission notice appear in all copies.
10.\"
11.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18.\"
19.Dd $Mdocdate: September 14 2021 $
20.Dt SSL_SET_PSK_USE_SESSION_CALLBACK 3
21.Os
22.Sh NAME
23.Nm SSL_set_psk_use_session_callback ,
24.Nm SSL_psk_use_session_cb_func
25.Nd set TLS pre-shared key client callback
26.Sh SYNOPSIS
27.In openssl/ssl.h
28.Ft typedef int
29.Fo (*SSL_psk_use_session_cb_func)
30.Fa "SSL *ssl"
31.Fa "const EVP_MD *md"
32.Fa "const unsigned char **id"
33.Fa "size_t *idlen"
34.Fa "SSL_SESSION **session"
35.Fc
36.Ft void
37.Fo SSL_set_psk_use_session_callback
38.Fa "SSL *ssl"
39.Fa "SSL_psk_use_session_cb_func cb"
40.Fc
41.Sh DESCRIPTION
42LibreSSL provides the stub function
43.Fn SSL_set_psk_use_session_callback
44to allow compiling application programs
45that contain optional support for TLSv1.3 pre-shared keys.
46.Pp
47LibreSSL does not support TLS pre-shared keys,
48and no action occurs when
49.Fn SSL_set_psk_use_session_callback
50is called.
51In particular, both arguments are ignored.
52During session negotiation,
53LibreSSL never calls the callback
54.Fa cb
55and always behaves as if that callback succeeded and set the
56.Pf * Fa session
57pointer to
58.Dv NULL .
59That is, LibreSSL never sends a pre-shared key to the server
60and never aborts the handshake for lack of a pre-shared key.
61.Pp
62With OpenSSL, a client application wishing to use TLSv1.3 pre-shared keys
63can install a callback function
64.Fa cb
65using
66.Fn SSL_set_psk_use_session_callback .
67The OpenSSL library may call
68.Fa cb
69once or twice during session negotiation.
70If the callback fails, OpenSSL aborts connection setup.
71If the callback succeeds but sets the
72.Pf * Fa session
73pointer to
74.Dv NULL ,
75OpenSSL continues the handshake
76but does not send a pre-shared key to the server.
77.Sh RETURN VALUES
78The
79.Fn SSL_psk_use_session_cb_func
80callback is expected to return 1 on success or 0 on failure.
81.Sh HISTORY
82.Fn SSL_set_psk_use_session_callback
83and
84.Fn SSL_psk_use_session_cb_func
85first appeared in OpenSSL 1.1.1 and have been available since
86.Ox 7.0 .
diff --git a/src/lib/libssl/man/SSL_set_session.3 b/src/lib/libssl/man/SSL_set_session.3
deleted file mode 100644
index 7d85f5ad0c..0000000000
--- a/src/lib/libssl/man/SSL_set_session.3
+++ /dev/null
@@ -1,119 +0,0 @@
1.\" $OpenBSD: SSL_set_session.3,v 1.4 2018/03/27 17:35:50 schwarze Exp $
2.\" OpenSSL 05ea606a May 20 20:52:46 2016 -0400
3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
5.\" Copyright (c) 2000, 2001, 2016 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: March 27 2018 $
52.Dt SSL_SET_SESSION 3
53.Os
54.Sh NAME
55.Nm SSL_set_session
56.Nd set a TLS/SSL session to be used during TLS/SSL connect
57.Sh SYNOPSIS
58.In openssl/ssl.h
59.Ft int
60.Fn SSL_set_session "SSL *ssl" "SSL_SESSION *session"
61.Sh DESCRIPTION
62.Fn SSL_set_session
63sets
64.Fa session
65to be used when the TLS/SSL connection is to be established.
66.Fn SSL_set_session
67is only useful for TLS/SSL clients.
68When the session is set, the reference count of
69.Fa session
70is incremented
71by 1.
72If the session is not reused, the reference count is decremented again during
73.Fn SSL_connect .
74Whether the session was reused can be queried with the
75.Xr SSL_session_reused 3
76call.
77.Pp
78If there is already a session set inside
79.Fa ssl
80(because it was set with
81.Fn SSL_set_session
82before or because the same
83.Fa ssl
84was already used for a connection),
85.Xr SSL_SESSION_free 3
86will be called for that session.
87.Pp
88.Vt SSL_SESSION
89objects keep internal link information about the session cache list when being
90inserted into one
91.Vt SSL_CTX
92object's session cache.
93One
94.Vt SSL_SESSION
95object, regardless of its reference count, must therefore only be used with one
96.Vt SSL_CTX
97object (and the
98.Vt SSL
99objects created from this
100.Vt SSL_CTX
101object).
102.Sh RETURN VALUES
103The following return values can occur:
104.Bl -tag -width Ds
105.It 0
106The operation failed; check the error stack to find out the reason.
107.It 1
108The operation succeeded.
109.El
110.Sh SEE ALSO
111.Xr ssl 3 ,
112.Xr SSL_CTX_set_session_cache_mode 3 ,
113.Xr SSL_get_session 3 ,
114.Xr SSL_SESSION_free 3 ,
115.Xr SSL_session_reused 3
116.Sh HISTORY
117.Fn SSL_set_session
118first appeared in SSLeay 0.5.2 and has been available since
119.Ox 2.4 .
diff --git a/src/lib/libssl/man/SSL_set_shutdown.3 b/src/lib/libssl/man/SSL_set_shutdown.3
deleted file mode 100644
index ef8c004f76..0000000000
--- a/src/lib/libssl/man/SSL_set_shutdown.3
+++ /dev/null
@@ -1,138 +0,0 @@
1.\" $OpenBSD: SSL_set_shutdown.3,v 1.7 2024/12/19 06:45:21 jmc Exp $
2.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
5.\" Copyright (c) 2001, 2005 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: December 19 2024 $
52.Dt SSL_SET_SHUTDOWN 3
53.Os
54.Sh NAME
55.Nm SSL_set_shutdown ,
56.Nm SSL_get_shutdown
57.Nd manipulate shutdown state of an SSL connection
58.Sh SYNOPSIS
59.In openssl/ssl.h
60.Ft void
61.Fn SSL_set_shutdown "SSL *ssl" "int mode"
62.Ft int
63.Fn SSL_get_shutdown "const SSL *ssl"
64.Sh DESCRIPTION
65.Fn SSL_set_shutdown
66sets the shutdown state of
67.Fa ssl
68to
69.Fa mode .
70.Pp
71.Fn SSL_get_shutdown
72returns the shutdown mode of
73.Fa ssl .
74.Pp
75The shutdown state of an ssl connection is a bitmask of:
76.Bl -tag -width Ds
77.It 0
78No shutdown setting, yet.
79.It Dv SSL_SENT_SHUTDOWN
80A
81.Dq close notify
82shutdown alert was sent to the peer; the connection is being considered closed
83and the session is closed and correct.
84.It Dv SSL_RECEIVED_SHUTDOWN
85A shutdown alert was received from the peer, either a normal
86.Dq close notify
87or a fatal error.
88.El
89.Pp
90.Dv SSL_SENT_SHUTDOWN
91and
92.Dv SSL_RECEIVED_SHUTDOWN
93can be set at the same time.
94.Pp
95The shutdown state of the connection is used to determine the state of the
96.Fa ssl
97session.
98If the session is still open when
99.Xr SSL_clear 3
100or
101.Xr SSL_free 3
102is called, it is considered bad and removed according to RFC 2246.
103The actual condition for a correctly closed session is
104.Dv SSL_SENT_SHUTDOWN
105(according to the TLS RFC, it is acceptable to only send the
106.Dq close notify
107alert but to not wait for the peer's answer when the underlying connection is
108closed).
109.Fn SSL_set_shutdown
110can be used to set this state without sending a close alert to the peer (see
111.Xr SSL_shutdown 3 ) .
112.Pp
113If a
114.Dq close notify
115was received,
116.Dv SSL_RECEIVED_SHUTDOWN
117will be set, but to set
118.Dv SSL_SENT_SHUTDOWN
119the application must still call
120.Xr SSL_shutdown 3
121or
122.Fn SSL_set_shutdown
123itself.
124.Sh RETURN VALUES
125.Fn SSL_get_shutdown
126returns the current setting.
127.Sh SEE ALSO
128.Xr ssl 3 ,
129.Xr SSL_clear 3 ,
130.Xr SSL_CTX_set_quiet_shutdown 3 ,
131.Xr SSL_free 3 ,
132.Xr SSL_shutdown 3
133.Sh HISTORY
134.Fn SSL_set_shutdown
135and
136.Fn SSL_get_shutdown
137first appeared in SSLeay 0.8.0 and have been available since
138.Ox 2.4 .
diff --git a/src/lib/libssl/man/SSL_set_tmp_ecdh.3 b/src/lib/libssl/man/SSL_set_tmp_ecdh.3
deleted file mode 100644
index 8fd2d9fd5b..0000000000
--- a/src/lib/libssl/man/SSL_set_tmp_ecdh.3
+++ /dev/null
@@ -1,119 +0,0 @@
1.\" $OpenBSD: SSL_set_tmp_ecdh.3,v 1.6 2021/11/30 15:58:08 jsing Exp $
2.\"
3.\" Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org>
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd $Mdocdate: November 30 2021 $
18.Dt SSL_SET_TMP_ECDH 3
19.Os
20.Sh NAME
21.Nm SSL_set_tmp_ecdh ,
22.Nm SSL_CTX_set_tmp_ecdh ,
23.Nm SSL_set_ecdh_auto ,
24.Nm SSL_CTX_set_ecdh_auto ,
25.Nm SSL_set_tmp_ecdh_callback ,
26.Nm SSL_CTX_set_tmp_ecdh_callback
27.Nd select a curve for ECDH ephemeral key exchange
28.Sh SYNOPSIS
29.In openssl/ssl.h
30.Ft long
31.Fo SSL_set_tmp_ecdh
32.Fa "SSL *ssl"
33.Fa "EC_KEY *ecdh"
34.Fc
35.Ft long
36.Fo SSL_CTX_set_tmp_ecdh
37.Fa "SSL_CTX *ctx"
38.Fa "EC_KEY *ecdh"
39.Fc
40.Ft long
41.Fo SSL_set_ecdh_auto
42.Fa "SSL *ssl"
43.Fa "int state"
44.Fc
45.Ft long
46.Fo SSL_CTX_set_ecdh_auto
47.Fa "SSL_CTX *ctx"
48.Fa "int state"
49.Fc
50.Ft void
51.Fo SSL_set_tmp_ecdh_callback
52.Fa "SSL *ssl"
53.Fa "EC_KEY *(*ecdh)(SSL *ssl, int is_export, int keylength)"
54.Fc
55.Ft void
56.Fo SSL_CTX_set_tmp_ecdh_callback
57.Fa "SSL_CTX *ctx"
58.Fa "EC_KEY *(*ecdh)(SSL *ssl, int is_export, int keylength)"
59.Fc
60.Sh DESCRIPTION
61Automatic EC curve selection and generation is always enabled in
62LibreSSL, and applications cannot manually provide EC keys for use
63with ECDH key exchange.
64.Pp
65The only remaining effect of
66.Fn SSL_set_tmp_ecdh
67is that the curve of the given
68.Fa ecdh
69key becomes the only curve enabled for the
70.Fa ssl
71connection, so it is equivalent to calling
72.Xr SSL_set1_groups_list 3
73with the same single curve name.
74.Pp
75.Fn SSL_CTX_set_tmp_ecdh
76has the same effect on all connections that will be created from
77.Fa ctx
78in the future.
79.Pp
80The functions
81.Fn SSL_set_ecdh_auto ,
82.Fn SSL_CTX_set_ecdh_auto ,
83.Fn SSL_set_tmp_ecdh_callback ,
84and
85.Fn SSL_CTX_set_tmp_ecdh_callback
86are deprecated and have no effect.
87.Sh RETURN VALUES
88.Fn SSL_set_tmp_ecdh
89and
90.Fn SSL_CTX_set_tmp_ecdh
91return 1 on success or 0 on failure.
92.Pp
93.Fn SSL_set_ecdh_auto ,
94.Fn SSL_CTX_set_ecdh_auto ,
95.Fn SSL_set_tmp_ecdh_callback ,
96and
97.Fn SSL_CTX_set_tmp_ecdh_callback
98always return 1.
99.Sh SEE ALSO
100.Xr ssl 3 ,
101.Xr SSL_CTX_set1_groups 3 ,
102.Xr SSL_CTX_set_cipher_list 3 ,
103.Xr SSL_CTX_set_options 3 ,
104.Xr SSL_CTX_set_tmp_dh_callback 3 ,
105.Xr SSL_new 3
106.Sh HISTORY
107.Fn SSL_set_tmp_ecdh ,
108.Fn SSL_CTX_set_tmp_ecdh ,
109.Fn SSL_set_tmp_ecdh_callback ,
110and
111.Fn SSL_CTX_set_tmp_ecdh_callback
112first appeared in OpenSSL 0.9.8 and have been available since
113.Ox 4.5 .
114.Pp
115.Fn SSL_CTX_set_ecdh_auto
116and
117.Fn SSL_set_ecdh_auto
118first appeared in OpenSSL 1.0.2 and have been available since
119.Ox 5.7 .
diff --git a/src/lib/libssl/man/SSL_set_verify_result.3 b/src/lib/libssl/man/SSL_set_verify_result.3
deleted file mode 100644
index 4b7cc6ec3c..0000000000
--- a/src/lib/libssl/man/SSL_set_verify_result.3
+++ /dev/null
@@ -1,90 +0,0 @@
1.\" $OpenBSD: SSL_set_verify_result.3,v 1.5 2020/03/29 17:05:02 schwarze Exp $
2.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
5.\" Copyright (c) 2000 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: March 29 2020 $
52.Dt SSL_SET_VERIFY_RESULT 3
53.Os
54.Sh NAME
55.Nm SSL_set_verify_result
56.Nd override result of peer certificate verification
57.Sh SYNOPSIS
58.In openssl/ssl.h
59.Ft void
60.Fn SSL_set_verify_result "SSL *ssl" "long verify_result"
61.Sh DESCRIPTION
62.Fn SSL_set_verify_result
63sets
64.Fa verify_result
65of the object
66.Fa ssl
67to be the result of the verification of the X509 certificate presented by the
68peer, if any.
69.Pp
70.Fn SSL_set_verify_result
71overrides the verification result.
72It only changes the verification result of the
73.Fa ssl
74object.
75It does not become part of the established session, so if the session is to be
76reused later, the original value will reappear.
77.Pp
78The valid codes for
79.Fa verify_result
80are documented in
81.Xr openssl 1 .
82.Sh SEE ALSO
83.Xr openssl 1 ,
84.Xr ssl 3 ,
85.Xr SSL_get_peer_certificate 3 ,
86.Xr SSL_get_verify_result 3
87.Sh HISTORY
88.Fn SSL_set_verify_result
89first appeared in SSLeay 0.6.1 and has been available since
90.Ox 2.4 .
diff --git a/src/lib/libssl/man/SSL_shutdown.3 b/src/lib/libssl/man/SSL_shutdown.3
deleted file mode 100644
index bfb1e91ea7..0000000000
--- a/src/lib/libssl/man/SSL_shutdown.3
+++ /dev/null
@@ -1,253 +0,0 @@
1.\" $OpenBSD: SSL_shutdown.3,v 1.5 2018/03/27 17:35:50 schwarze Exp $
2.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
5.\" Copyright (c) 2000, 2001, 2004, 2014 The OpenSSL Project.
6.\" All rights reserved.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\"
12.\" 1. Redistributions of source code must retain the above copyright
13.\" notice, this list of conditions and the following disclaimer.
14.\"
15.\" 2. Redistributions in binary form must reproduce the above copyright
16.\" notice, this list of conditions and the following disclaimer in
17.\" the documentation and/or other materials provided with the
18.\" distribution.
19.\"
20.\" 3. All advertising materials mentioning features or use of this
21.\" software must display the following acknowledgment:
22.\" "This product includes software developed by the OpenSSL Project
23.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
24.\"
25.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
26.\" endorse or promote products derived from this software without
27.\" prior written permission. For written permission, please contact
28.\" openssl-core@openssl.org.
29.\"
30.\" 5. Products derived from this software may not be called "OpenSSL"
31.\" nor may "OpenSSL" appear in their names without prior written
32.\" permission of the OpenSSL Project.
33.\"
34.\" 6. Redistributions of any form whatsoever must retain the following
35.\" acknowledgment:
36.\" "This product includes software developed by the OpenSSL Project
37.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
38.\"
39.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
40.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
43.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50.\" OF THE POSSIBILITY OF SUCH DAMAGE.
51.\"
52.Dd $Mdocdate: March 27 2018 $
53.Dt SSL_SHUTDOWN 3
54.Os
55.Sh NAME
56.Nm SSL_shutdown
57.Nd shut down a TLS/SSL connection
58.Sh SYNOPSIS
59.In openssl/ssl.h
60.Ft int
61.Fn SSL_shutdown "SSL *ssl"
62.Sh DESCRIPTION
63.Fn SSL_shutdown
64shuts down an active TLS/SSL connection.
65It sends the
66.Dq close notify
67shutdown alert to the peer.
68.Pp
69.Fn SSL_shutdown
70tries to send the
71.Dq close notify
72shutdown alert to the peer.
73Whether the operation succeeds or not, the
74.Dv SSL_SENT_SHUTDOWN
75flag is set and a currently open session is considered closed and good and will
76be kept in the session cache for further reuse.
77.Pp
78The shutdown procedure consists of 2 steps: the sending of the
79.Dq close notify
80shutdown alert and the reception of the peer's
81.Dq close notify
82shutdown alert.
83According to the TLS standard, it is acceptable for an application to only send
84its shutdown alert and then close the underlying connection without waiting for
85the peer's response (this way resources can be saved, as the process can
86already terminate or serve another connection).
87When the underlying connection shall be used for more communications,
88the complete shutdown procedure (bidirectional
89.Dq close notify
90alerts) must be performed, so that the peers stay synchronized.
91.Pp
92.Fn SSL_shutdown
93supports both uni- and bidirectional shutdown by its 2 step behavior.
94.Pp
95When the application is the first party to send the
96.Dq close notify
97alert,
98.Fn SSL_shutdown
99will only send the alert and then set the
100.Dv SSL_SENT_SHUTDOWN
101flag (so that the session is considered good and will be kept in cache).
102.Fn SSL_shutdown
103will then return 0.
104If a unidirectional shutdown is enough
105(the underlying connection shall be closed anyway), this first call to
106.Fn SSL_shutdown
107is sufficient.
108In order to complete the bidirectional shutdown handshake,
109.Fn SSL_shutdown
110must be called again.
111The second call will make
112.Fn SSL_shutdown
113wait for the peer's
114.Dq close notify
115shutdown alert.
116On success, the second call to
117.Fn SSL_shutdown
118will return 1.
119.Pp
120If the peer already sent the
121.Dq close notify
122alert and it was already processed implicitly inside another function
123.Pq Xr SSL_read 3 ,
124the
125.Dv SSL_RECEIVED_SHUTDOWN
126flag is set.
127.Fn SSL_shutdown
128will send the
129.Dq close notify
130alert, set the
131.Dv SSL_SENT_SHUTDOWN
132flag and will immediately return with 1.
133Whether
134.Dv SSL_RECEIVED_SHUTDOWN
135is already set can be checked using the
136.Fn SSL_get_shutdown
137(see also the
138.Xr SSL_set_shutdown 3
139call).
140.Pp
141It is therefore recommended to check the return value of
142.Fn SSL_shutdown
143and call
144.Fn SSL_shutdown
145again, if the bidirectional shutdown is not yet complete (return value of the
146first call is 0).
147.Pp
148The behaviour of
149.Fn SSL_shutdown
150additionally depends on the underlying
151.Vt BIO .
152.Pp
153If the underlying
154.Vt BIO
155is
156.Em blocking ,
157.Fn SSL_shutdown
158will only return once the
159handshake step has been finished or an error occurred.
160.Pp
161If the underlying
162.Vt BIO
163is
164.Em non-blocking ,
165.Fn SSL_shutdown
166will also return when the underlying
167.Vt BIO
168could not satisfy the needs of
169.Fn SSL_shutdown
170to continue the handshake.
171In this case a call to
172.Xr SSL_get_error 3
173with the
174return value of
175.Fn SSL_shutdown
176will yield
177.Dv SSL_ERROR_WANT_READ
178or
179.Dv SSL_ERROR_WANT_WRITE .
180The calling process then must repeat the call after taking appropriate action
181to satisfy the needs of
182.Fn SSL_shutdown .
183The action depends on the underlying
184.Vt BIO .
185When using a non-blocking socket, nothing is to be done, but
186.Xr select 2
187can be used to check for the required condition.
188When using a buffering
189.Vt BIO ,
190like a
191.Vt BIO
192pair, data must be written into or retrieved out of the
193.Vt BIO
194before being able to continue.
195.Pp
196.Fn SSL_shutdown
197can be modified to only set the connection to
198.Dq shutdown
199state but not actually send the
200.Dq close notify
201alert messages; see
202.Xr SSL_CTX_set_quiet_shutdown 3 .
203When
204.Dq quiet shutdown
205is enabled,
206.Fn SSL_shutdown
207will always succeed and return 1.
208.Sh RETURN VALUES
209The following return values can occur:
210.Bl -tag -width Ds
211.It 0
212The shutdown is not yet finished.
213Call
214.Fn SSL_shutdown
215for a second time, if a bidirectional shutdown shall be performed.
216The output of
217.Xr SSL_get_error 3
218may be misleading, as an erroneous
219.Dv SSL_ERROR_SYSCALL
220may be flagged even though no error occurred.
221.It 1
222The shutdown was successfully completed.
223The
224.Dq close notify
225alert was sent and the peer's
226.Dq close notify
227alert was received.
228.It \(mi1
229The shutdown was not successful because a fatal error occurred either
230at the protocol level or a connection failure occurred.
231It can also occur if action is need to continue the operation for non-blocking
232.Vt BIO Ns
233s.
234Call
235.Xr SSL_get_error 3
236with the return value
237.Fa ret
238to find out the reason.
239.El
240.Sh SEE ALSO
241.Xr BIO_new 3 ,
242.Xr ssl 3 ,
243.Xr SSL_accept 3 ,
244.Xr SSL_clear 3 ,
245.Xr SSL_connect 3 ,
246.Xr SSL_CTX_set_quiet_shutdown 3 ,
247.Xr SSL_free 3 ,
248.Xr SSL_get_error 3 ,
249.Xr SSL_set_shutdown 3
250.Sh HISTORY
251.Fn SSL_shutdown
252first appeared in SSLeay 0.8.0 and has been available since
253.Ox 2.4 .
diff --git a/src/lib/libssl/man/SSL_state_string.3 b/src/lib/libssl/man/SSL_state_string.3
deleted file mode 100644
index 1070335448..0000000000
--- a/src/lib/libssl/man/SSL_state_string.3
+++ /dev/null
@@ -1,110 +0,0 @@
1.\" $OpenBSD: SSL_state_string.3,v 1.4 2018/03/27 17:35:50 schwarze Exp $
2.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
5.\" Copyright (c) 2001, 2005 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: March 27 2018 $
52.Dt SSL_STATE_STRING 3
53.Os
54.Sh NAME
55.Nm SSL_state_string ,
56.Nm SSL_state_string_long
57.Nd get textual description of state of an SSL object
58.Sh SYNOPSIS
59.In openssl/ssl.h
60.Ft const char *
61.Fn SSL_state_string "const SSL *ssl"
62.Ft const char *
63.Fn SSL_state_string_long "const SSL *ssl"
64.Sh DESCRIPTION
65.Fn SSL_state_string
66returns a 6 letter string indicating the current state of the
67.Vt SSL
68object
69.Fa ssl .
70.Pp
71.Fn SSL_state_string_long
72returns a string indicating the current state of the
73.Vt SSL
74object
75.Fa ssl .
76.Pp
77During its use, an
78.Vt SSL
79object passes several states.
80The state is internally maintained.
81Querying the state information is not very informative before or when a
82connection has been established.
83It however can be of significant interest during the handshake.
84.Pp
85When using non-blocking sockets,
86the function call performing the handshake may return with
87.Dv SSL_ERROR_WANT_READ
88or
89.Dv SSL_ERROR_WANT_WRITE
90condition, so that
91.Fn SSL_state_string[_long]
92may be called.
93.Pp
94For both blocking or non-blocking sockets,
95the details state information can be used within the
96.Fn info_callback
97function set with the
98.Xr SSL_set_info_callback 3
99call.
100.Sh RETURN VALUES
101Detailed description of possible states to be included later.
102.Sh SEE ALSO
103.Xr ssl 3 ,
104.Xr SSL_CTX_set_info_callback 3
105.Sh HISTORY
106.Fn SSL_state_string
107and
108.Fn SSL_state_string_long
109first appeared in SSLeay 0.6.0 and have been available since
110.Ox 2.4 .
diff --git a/src/lib/libssl/man/SSL_want.3 b/src/lib/libssl/man/SSL_want.3
deleted file mode 100644
index 24e8645ba8..0000000000
--- a/src/lib/libssl/man/SSL_want.3
+++ /dev/null
@@ -1,161 +0,0 @@
1.\" $OpenBSD: SSL_want.3,v 1.5 2018/03/27 17:35:50 schwarze Exp $
2.\" OpenSSL 9b86974e Aug 17 15:21:33 2015 -0400
3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
5.\" Copyright (c) 2001, 2005 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: March 27 2018 $
52.Dt SSL_WANT 3
53.Os
54.Sh NAME
55.Nm SSL_want ,
56.Nm SSL_want_nothing ,
57.Nm SSL_want_read ,
58.Nm SSL_want_write ,
59.Nm SSL_want_x509_lookup
60.Nd obtain state information TLS/SSL I/O operation
61.Sh SYNOPSIS
62.In openssl/ssl.h
63.Ft int
64.Fn SSL_want "const SSL *ssl"
65.Ft int
66.Fn SSL_want_nothing "const SSL *ssl"
67.Ft int
68.Fn SSL_want_read "const SSL *ssl"
69.Ft int
70.Fn SSL_want_write "const SSL *ssl"
71.Ft int
72.Fn SSL_want_x509_lookup "const SSL *ssl"
73.Sh DESCRIPTION
74.Fn SSL_want
75returns state information for the
76.Vt SSL
77object
78.Fa ssl .
79.Pp
80The other
81.Fn SSL_want_*
82calls are shortcuts for the possible states returned by
83.Fn SSL_want .
84.Pp
85.Fn SSL_want
86examines the internal state information of the
87.Vt SSL
88object.
89Its return values are similar to those of
90.Xr SSL_get_error 3 .
91Unlike
92.Xr SSL_get_error 3 ,
93which also evaluates the error queue,
94the results are obtained by examining an internal state flag only.
95The information must therefore only be used for normal operation under
96non-blocking I/O.
97Error conditions are not handled and must be treated using
98.Xr SSL_get_error 3 .
99.Pp
100The result returned by
101.Fn SSL_want
102should always be consistent with the result of
103.Xr SSL_get_error 3 .
104.Sh RETURN VALUES
105The following return values can currently occur for
106.Fn SSL_want :
107.Bl -tag -width Ds
108.It Dv SSL_NOTHING
109There is no data to be written or to be read.
110.It Dv SSL_WRITING
111There are data in the SSL buffer that must be written to the underlying
112.Vt BIO
113layer in order to complete the actual
114.Fn SSL_*
115operation.
116A call to
117.Xr SSL_get_error 3
118should return
119.Dv SSL_ERROR_WANT_WRITE .
120.It Dv SSL_READING
121More data must be read from the underlying
122.Vt BIO
123layer in order to
124complete the actual
125.Fn SSL_*
126operation.
127A call to
128.Xr SSL_get_error 3
129should return
130.Dv SSL_ERROR_WANT_READ .
131.It Dv SSL_X509_LOOKUP
132The operation did not complete because an application callback set by
133.Xr SSL_CTX_set_client_cert_cb 3
134has asked to be called again.
135A call to
136.Xr SSL_get_error 3
137should return
138.Dv SSL_ERROR_WANT_X509_LOOKUP .
139.El
140.Pp
141.Fn SSL_want_nothing ,
142.Fn SSL_want_read ,
143.Fn SSL_want_write ,
144and
145.Fn SSL_want_x509_lookup
146return 1 when the corresponding condition is true or 0 otherwise.
147.Sh SEE ALSO
148.Xr err 3 ,
149.Xr ssl 3 ,
150.Xr SSL_get_error 3
151.Sh HISTORY
152.Fn SSL_want ,
153.Fn SSL_want_nothing ,
154.Fn SSL_want_read ,
155and
156.Fn SSL_want_write
157first appeared in SSLeay 0.5.2.
158.Fn SSL_want_x509_lookup
159first appeared in SSLeay 0.6.0.
160These functions have been available since
161.Ox 2.4 .
diff --git a/src/lib/libssl/man/SSL_write.3 b/src/lib/libssl/man/SSL_write.3
deleted file mode 100644
index 2c6fbcef08..0000000000
--- a/src/lib/libssl/man/SSL_write.3
+++ /dev/null
@@ -1,249 +0,0 @@
1.\" $OpenBSD: SSL_write.3,v 1.7 2021/10/24 15:10:13 schwarze Exp $
2.\" full merge up to: OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3.\" partial merge up to: OpenSSL 24a535ea Sep 22 13:14:20 2020 +0100
4.\"
5.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>
6.\" and Matt Caswell <matt@openssl.org>.
7.\" Copyright (c) 2000, 2001, 2002, 2016 The OpenSSL Project.
8.\" All rights reserved.
9.\"
10.\" Redistribution and use in source and binary forms, with or without
11.\" modification, are permitted provided that the following conditions
12.\" are met:
13.\"
14.\" 1. Redistributions of source code must retain the above copyright
15.\" notice, this list of conditions and the following disclaimer.
16.\"
17.\" 2. Redistributions in binary form must reproduce the above copyright
18.\" notice, this list of conditions and the following disclaimer in
19.\" the documentation and/or other materials provided with the
20.\" distribution.
21.\"
22.\" 3. All advertising materials mentioning features or use of this
23.\" software must display the following acknowledgment:
24.\" "This product includes software developed by the OpenSSL Project
25.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
26.\"
27.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
28.\" endorse or promote products derived from this software without
29.\" prior written permission. For written permission, please contact
30.\" openssl-core@openssl.org.
31.\"
32.\" 5. Products derived from this software may not be called "OpenSSL"
33.\" nor may "OpenSSL" appear in their names without prior written
34.\" permission of the OpenSSL Project.
35.\"
36.\" 6. Redistributions of any form whatsoever must retain the following
37.\" acknowledgment:
38.\" "This product includes software developed by the OpenSSL Project
39.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
40.\"
41.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
42.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
44.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
45.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
46.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
47.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
48.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
49.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
50.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
51.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
52.\" OF THE POSSIBILITY OF SUCH DAMAGE.
53.\"
54.Dd $Mdocdate: October 24 2021 $
55.Dt SSL_WRITE 3
56.Os
57.Sh NAME
58.Nm SSL_write_ex ,
59.Nm SSL_write
60.Nd write bytes to a TLS connection
61.Sh SYNOPSIS
62.In openssl/ssl.h
63.Ft int
64.Fn SSL_write_ex "SSL *ssl" "const void *buf" "size_t num" "size_t *written"
65.Ft int
66.Fn SSL_write "SSL *ssl" "const void *buf" "int num"
67.Sh DESCRIPTION
68.Fn SSL_write_ex
69and
70.Fn SSL_write
71write
72.Fa num
73bytes from the buffer
74.Fa buf
75into the specified
76.Fa ssl
77connection.
78On success
79.Fn SSL_write_ex
80stores the number of bytes written in
81.Pf * Fa written .
82.Pp
83In the following,
84.Fn SSL_write_ex
85and
86.Fn SSL_write
87are called
88.Dq write functions .
89.Pp
90If necessary, a write function negotiates a TLS session,
91if not already explicitly performed by
92.Xr SSL_connect 3
93or
94.Xr SSL_accept 3 .
95If the peer requests a re-negotiation,
96it will be performed transparently during the
97write function operation.
98The behaviour of the write functions depends on the underlying
99.Vt BIO .
100.Pp
101For the transparent negotiation to succeed, the
102.Fa ssl
103must have been initialized to client or server mode.
104This is done by calling
105.Xr SSL_set_connect_state 3
106or
107.Xr SSL_set_accept_state 3
108before the first call to a write function.
109.Pp
110If the underlying
111.Vt BIO
112is
113.Em blocking ,
114the write function
115will only return once the write operation has been finished or an error
116occurred, except when a renegotiation takes place, in which case a
117.Dv SSL_ERROR_WANT_READ
118may occur.
119This behaviour can be controlled with the
120.Dv SSL_MODE_AUTO_RETRY
121flag of the
122.Xr SSL_CTX_set_mode 3
123call.
124.Pp
125If the underlying
126.Vt BIO
127is
128.Em non-blocking ,
129the write function will also return when the underlying
130.Vt BIO
131could not satisfy the needs of the function to continue the operation.
132In this case a call to
133.Xr SSL_get_error 3
134with the return value of the write function will yield
135.Dv SSL_ERROR_WANT_READ
136or
137.Dv SSL_ERROR_WANT_WRITE .
138As at any time a re-negotiation is possible, a call to
139a write function can also cause read operations.
140The calling process then must repeat the call after taking appropriate action
141to satisfy the needs of the write function.
142The action depends on the underlying
143.Vt BIO .
144When using a non-blocking socket, nothing is to be done, but
145.Xr select 2
146can be used to check for the required condition.
147When using a buffering
148.Vt BIO ,
149like a
150.Vt BIO
151pair, data must be written into or retrieved out of the BIO before being able
152to continue.
153.Pp
154The write functions
155will only return with success when the complete contents of
156.Fa buf
157of length
158.Fa num
159have been written.
160This default behaviour can be changed with the
161.Dv SSL_MODE_ENABLE_PARTIAL_WRITE
162option of
163.Xr SSL_CTX_set_mode 3 .
164When this flag is set, the write functions will also return with
165success when a partial write has been successfully completed.
166In this case the write function operation is considered completed.
167The bytes are sent and a new write call with a new buffer (with the
168already sent bytes removed) must be started.
169A partial write is performed with the size of a message block,
170which is 16kB.
171.Pp
172When a write function call has to be repeated because
173.Xr SSL_get_error 3
174returned
175.Dv SSL_ERROR_WANT_READ
176or
177.Dv SSL_ERROR_WANT_WRITE ,
178it must be repeated with the same arguments.
179.Pp
180When calling
181.Fn SSL_write
182with
183.Fa num Ns =0
184bytes to be sent, the behaviour is undefined.
185.Fn SSL_write_ex
186can be called with
187.Fa num Ns =0 ,
188but will not send application data to the peer.
189.Sh RETURN VALUES
190.Fn SSL_write_ex
191returns 1 for success or 0 for failure.
192Success means that all requested application data bytes have been
193written to the TLS connection or, if
194.Dv SSL_MODE_ENABLE_PARTIAL_WRITE
195is in use, at least one application data byte has been written
196to the TLS connection.
197Failure means that not all the requested bytes have been written yet (if
198.Dv SSL_MODE_ENABLE_PARTIAL_WRITE
199is not in use) or no bytes could be written to the TLS connection (if
200.Dv SSL_MODE_ENABLE_PARTIAL_WRITE
201is in use).
202Failures can be retryable (e.g. the network write buffer has temporarily
203filled up) or non-retryable (e.g. a fatal network error).
204In the event of a failure, call
205.Xr SSL_get_error 3
206to find out the reason
207which indicates whether the call is retryable or not.
208.Pp
209For
210.Fn SSL_write ,
211the following return values can occur:
212.Bl -tag -width Ds
213.It >0
214The write operation was successful.
215The return value is the number of bytes actually written to the TLS
216connection.
217.It 0
218The write operation was not successful.
219Probably the underlying connection was closed.
220Call
221.Xr SSL_get_error 3
222with the return value to find out whether an error occurred or the connection
223was shut down cleanly
224.Pq Dv SSL_ERROR_ZERO_RETURN .
225.It <0
226The write operation was not successful, because either an error occurred or
227action must be taken by the calling process.
228Call
229.Xr SSL_get_error 3
230with the return value to find out the reason.
231.El
232.Sh SEE ALSO
233.Xr BIO_new 3 ,
234.Xr ssl 3 ,
235.Xr SSL_accept 3 ,
236.Xr SSL_connect 3 ,
237.Xr SSL_CTX_new 3 ,
238.Xr SSL_CTX_set_mode 3 ,
239.Xr SSL_get_error 3 ,
240.Xr SSL_read 3 ,
241.Xr SSL_set_connect_state 3
242.Sh HISTORY
243.Fn SSL_write
244appeared in SSLeay 0.4 or earlier and has been available since
245.Ox 2.4 .
246.Pp
247.Fn SSL_write_ex
248first appeared in OpenSSL 1.1.1 and has been available since
249.Ox 7.1 .
diff --git a/src/lib/libssl/man/d2i_SSL_SESSION.3 b/src/lib/libssl/man/d2i_SSL_SESSION.3
deleted file mode 100644
index 7a2bc529ab..0000000000
--- a/src/lib/libssl/man/d2i_SSL_SESSION.3
+++ /dev/null
@@ -1,181 +0,0 @@
1.\" $OpenBSD: d2i_SSL_SESSION.3,v 1.7 2019/06/08 15:25:43 schwarze Exp $
2.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
5.\" Copyright (c) 2001, 2005, 2014 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: June 8 2019 $
52.Dt D2I_SSL_SESSION 3
53.Os
54.Sh NAME
55.Nm d2i_SSL_SESSION ,
56.Nm i2d_SSL_SESSION
57.Nd convert SSL_SESSION object from/to ASN1 representation
58.Sh SYNOPSIS
59.In openssl/ssl.h
60.Ft SSL_SESSION *
61.Fn d2i_SSL_SESSION "SSL_SESSION **a" "const unsigned char **pp" "long length"
62.Ft int
63.Fn i2d_SSL_SESSION "SSL_SESSION *in" "unsigned char **pp"
64.Sh DESCRIPTION
65.Fn d2i_SSL_SESSION
66transforms the external ASN1 representation of an SSL/TLS session,
67stored as binary data at location
68.Fa pp
69with length
70.Fa length ,
71into
72an
73.Vt SSL_SESSION
74object.
75.Pp
76.Fn i2d_SSL_SESSION
77transforms the
78.Vt SSL_SESSION
79object
80.Fa in
81into the ASN1 representation and stores it into the memory location pointed to
82by
83.Fa pp .
84The length of the resulting ASN1 representation is returned.
85If
86.Fa pp
87is the
88.Dv NULL
89pointer, only the length is calculated and returned.
90.Pp
91The
92.Vt SSL_SESSION
93object is built from several
94.Xr malloc 3 Ns
95-ed parts; it can therefore not be moved, copied or stored directly.
96In order to store session data on disk or into a database,
97it must be transformed into a binary ASN1 representation.
98.Pp
99When using
100.Fn d2i_SSL_SESSION ,
101the
102.Vt SSL_SESSION
103object is automatically allocated.
104The reference count is 1, so that the session must be explicitly removed using
105.Xr SSL_SESSION_free 3 ,
106unless the
107.Vt SSL_SESSION
108object is completely taken over, when being called inside the
109.Fn get_session_cb ,
110see
111.Xr SSL_CTX_sess_set_get_cb 3 .
112.Pp
113.Vt SSL_SESSION
114objects keep internal link information about the session cache list when being
115inserted into one
116.Vt SSL_CTX
117object's session cache.
118One
119.Vt SSL_SESSION
120object, regardless of its reference count, must therefore only be used with one
121.Vt SSL_CTX
122object (and the
123.Vt SSL
124objects created from this
125.Vt SSL_CTX
126object).
127.Pp
128When using
129.Fn i2d_SSL_SESSION ,
130the memory location pointed to by
131.Fa pp
132must be large enough to hold the binary representation of the session.
133There is no known limit on the size of the created ASN1 representation,
134so call
135.Fn i2d_SSL_SESSION
136first with
137.Fa pp Ns = Ns Dv NULL
138to obtain the encoded size, before allocating the required amount of memory and
139calling
140.Fn i2d_SSL_SESSION
141again.
142Note that this will advance the value contained in
143.Fa *pp
144so it is necessary to save a copy of the original allocation.
145For example:
146.Bd -literal -offset indent
147char *p, *pp;
148int elen, len;
149
150elen = i2d_SSL_SESSION(sess, NULL);
151p = pp = malloc(elen);
152if (p != NULL) {
153 len = i2d_SSL_SESSION(sess, &pp);
154 assert(elen == len);
155 assert(p + len == pp);
156}
157.Ed
158.Sh RETURN VALUES
159.Fn d2i_SSL_SESSION
160returns a pointer to the newly allocated
161.Vt SSL_SESSION
162object.
163In case of failure a
164.Dv NULL
165pointer is returned and the error message can be retrieved from the error
166stack.
167.Pp
168.Fn i2d_SSL_SESSION
169returns the size of the ASN1 representation in bytes.
170When the session is not valid, 0 is returned and no operation is performed.
171.Sh SEE ALSO
172.Xr d2i_X509 3 ,
173.Xr ssl 3 ,
174.Xr SSL_CTX_sess_set_get_cb 3 ,
175.Xr SSL_SESSION_free 3
176.Sh HISTORY
177.Fn d2i_SSL_SESSION
178and
179.Fn i2d_SSL_SESSION
180first appeared in SSLeay 0.5.2 and have been available since
181.Ox 2.4 .
diff --git a/src/lib/libssl/man/ssl.3 b/src/lib/libssl/man/ssl.3
deleted file mode 100644
index 314a1b0a94..0000000000
--- a/src/lib/libssl/man/ssl.3
+++ /dev/null
@@ -1,353 +0,0 @@
1.\" $OpenBSD: ssl.3,v 1.26 2024/08/31 10:51:48 tb Exp $
2.\" full merge up to: OpenSSL e330f55d Nov 11 00:51:04 2016 +0100
3.\" selective merge up to: OpenSSL 322755cc Sep 1 08:40:51 2018 +0800
4.\"
5.\" This file was written by Ralf S. Engelschall <rse@openssl.org>,
6.\" Ben Laurie <ben@openssl.org>, and Ulf Moeller <ulf@openssl.org>.
7.\" Copyright (c) 1998-2002, 2005, 2013, 2015 The OpenSSL Project.
8.\" All rights reserved.
9.\"
10.\" Redistribution and use in source and binary forms, with or without
11.\" modification, are permitted provided that the following conditions
12.\" are met:
13.\"
14.\" 1. Redistributions of source code must retain the above copyright
15.\" notice, this list of conditions and the following disclaimer.
16.\"
17.\" 2. Redistributions in binary form must reproduce the above copyright
18.\" notice, this list of conditions and the following disclaimer in
19.\" the documentation and/or other materials provided with the
20.\" distribution.
21.\"
22.\" 3. All advertising materials mentioning features or use of this
23.\" software must display the following acknowledgment:
24.\" "This product includes software developed by the OpenSSL Project
25.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
26.\"
27.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
28.\" endorse or promote products derived from this software without
29.\" prior written permission. For written permission, please contact
30.\" openssl-core@openssl.org.
31.\"
32.\" 5. Products derived from this software may not be called "OpenSSL"
33.\" nor may "OpenSSL" appear in their names without prior written
34.\" permission of the OpenSSL Project.
35.\"
36.\" 6. Redistributions of any form whatsoever must retain the following
37.\" acknowledgment:
38.\" "This product includes software developed by the OpenSSL Project
39.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
40.\"
41.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
42.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
44.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
45.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
46.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
47.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
48.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
49.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
50.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
51.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
52.\" OF THE POSSIBILITY OF SUCH DAMAGE.
53.\"
54.Dd $Mdocdate: August 31 2024 $
55.Dt SSL 3
56.Os
57.Sh NAME
58.Nm ssl
59.Nd OpenSSL TLS library
60.Sh DESCRIPTION
61The
62.Nm ssl
63library implements the Transport Layer Security (TLS) protocol,
64the successor to the Secure Sockets Layer (SSL) protocol.
65.Pp
66An
67.Vt SSL_CTX
68object is created as a framework to establish TLS/SSL enabled connections (see
69.Xr SSL_CTX_new 3 ) .
70Various options regarding certificates, algorithms, etc., can be set in this
71object.
72.Pp
73When a network connection has been created, it can be assigned to an
74.Vt SSL
75object.
76After the
77.Vt SSL
78object has been created using
79.Xr SSL_new 3 ,
80.Xr SSL_set_fd 3
81or
82.Xr SSL_set_bio 3
83can be used to associate the network connection with the object.
84.Pp
85Then the TLS/SSL handshake is performed using
86.Xr SSL_accept 3
87or
88.Xr SSL_connect 3
89respectively.
90.Xr SSL_read 3
91and
92.Xr SSL_write 3
93are used to read and write data on the TLS/SSL connection.
94.Xr SSL_shutdown 3
95can be used to shut down the TLS/SSL connection.
96.Sh DATA STRUCTURES
97Currently the
98.Nm ssl
99library functions deal with the following data structures:
100.Bl -tag -width Ds
101.It Vt SSL_METHOD No (SSL Method)
102That's a dispatch structure describing the internal
103.Nm ssl
104library methods/functions which implement the various protocol versions.
105It's needed to create an
106.Vt SSL_CTX .
107See
108.Xr TLS_method 3
109for constructors.
110.It Vt SSL_CIPHER No (SSL Cipher)
111This structure holds the algorithm information for a particular cipher which
112is a core part of the SSL/TLS protocol.
113The available ciphers are configured on an
114.Vt SSL_CTX
115basis and the actually used ones are then part of the
116.Vt SSL_SESSION .
117.It Vt SSL_CTX No (SSL Context)
118That's the global context structure which is created by a server or client
119once per program lifetime and which holds mainly default values for the
120.Vt SSL
121structures which are later created for the connections.
122.It Vt SSL_SESSION No (SSL Session)
123This is a structure containing the current TLS/SSL session details for a
124connection:
125.Vt SSL_CIPHER Ns s ,
126client and server certificates, keys, etc.
127.It Vt SSL No (SSL Connection)
128That's the main SSL/TLS structure which is created by a server or client per
129established connection.
130This actually is the core structure in the SSL API.
131At run-time the application usually deals with this structure which has
132links to mostly all other structures.
133.El
134.Sh HEADER FILES
135Currently the
136.Nm ssl
137library provides the following C header files containing the prototypes for the
138data structures and functions:
139.Bl -tag -width Ds
140.It Pa ssl.h
141That's the common header file for the SSL/TLS API.
142Include it into your program to make the API of the
143.Nm ssl
144library available.
145It internally includes both more private SSL headers and headers from the
146.Em crypto
147library.
148Whenever you need hardcore details on the internals of the SSL API, look inside
149this header file.
150.It Pa ssl3.h
151That's the sub header file dealing with the SSLv3 protocol only.
152.Bf Em
153Usually you don't have to include it explicitly because it's already included
154by
155.Pa ssl.h .
156.Ef
157.It Pa tls1.h
158That's the sub header file dealing with the TLSv1 protocol only.
159.Bf Em
160Usually you don't have to include it explicitly because it's already included
161by
162.Pa ssl.h .
163.Ef
164.El
165.Sh API FUNCTIONS
166.Ss Ciphers
167The following pages describe functions acting on
168.Vt SSL_CIPHER
169objects:
170.Xr SSL_get_ciphers 3 ,
171.Xr SSL_get_current_cipher 3 ,
172.Xr SSL_CIPHER_get_name 3
173.Ss Protocol contexts
174The following pages describe functions acting on
175.Vt SSL_CTX
176objects.
177.Pp
178Constructors and destructors:
179.Xr SSL_CTX_new 3 ,
180.Xr SSL_CTX_set_ssl_version 3 ,
181.Xr SSL_CTX_free 3
182.Pp
183Certificate configuration:
184.Xr SSL_CTX_add_extra_chain_cert 3 ,
185.Xr SSL_CTX_get0_certificate 3 ,
186.Xr SSL_CTX_load_verify_locations 3 ,
187.Xr SSL_CTX_set_cert_store 3 ,
188.Xr SSL_CTX_set_cert_verify_callback 3 ,
189.Xr SSL_CTX_set_client_cert_cb 3 ,
190.Xr SSL_CTX_set_default_passwd_cb 3 ,
191.Xr SSL_CTX_set_tlsext_status_cb 3
192.Pp
193Session configuration:
194.Xr SSL_CTX_add_session 3 ,
195.Xr SSL_CTX_flush_sessions 3 ,
196.Xr SSL_CTX_sess_number 3 ,
197.Xr SSL_CTX_sess_set_cache_size 3 ,
198.Xr SSL_CTX_sess_set_get_cb 3 ,
199.Xr SSL_CTX_sessions 3 ,
200.Xr SSL_CTX_set_session_cache_mode 3 ,
201.Xr SSL_CTX_set_timeout 3 ,
202.Xr SSL_CTX_set_tlsext_ticket_key_cb 3
203.Pp
204Various configuration:
205.Xr SSL_CTX_get_ex_new_index 3 ,
206.Xr SSL_CTX_set_tlsext_servername_callback 3
207.Ss Common configuration of contexts and connections
208The functions on the following pages each come in two variants:
209one to directly configure a single
210.Vt SSL
211connection and another to be called on an
212.Vt SSL_CTX
213object, to set up defaults for all future
214.Vt SSL
215connections created from that context.
216.Pp
217Protocol and algorithm configuration:
218.Xr SSL_CTX_set_alpn_select_cb 3 ,
219.Xr SSL_CTX_set_cipher_list 3 ,
220.Xr SSL_CTX_set_min_proto_version 3 ,
221.Xr SSL_CTX_set_options 3 ,
222.Xr SSL_CTX_set_security_level 3 ,
223.Xr SSL_CTX_set_tlsext_use_srtp 3 ,
224.Xr SSL_CTX_set_tmp_dh_callback 3 ,
225.Xr SSL_CTX_set1_groups 3
226.Pp
227Certificate configuration:
228.Xr SSL_CTX_add1_chain_cert 3 ,
229.Xr SSL_CTX_get_verify_mode 3 ,
230.Xr SSL_CTX_set_client_CA_list 3 ,
231.Xr SSL_CTX_set_max_cert_list 3 ,
232.Xr SSL_CTX_set_verify 3 ,
233.Xr SSL_CTX_use_certificate 3 ,
234.Xr SSL_get_client_CA_list 3
235.Xr SSL_set1_param 3
236.Pp
237Session configuration:
238.Xr SSL_CTX_set_generate_session_id 3 ,
239.Xr SSL_CTX_set_session_id_context 3
240.Pp
241Various configuration:
242.Xr SSL_CTX_ctrl 3 ,
243.Xr SSL_CTX_set_info_callback 3 ,
244.Xr SSL_CTX_set_mode 3 ,
245.Xr SSL_CTX_set_msg_callback 3 ,
246.Xr SSL_CTX_set_quiet_shutdown 3 ,
247.Xr SSL_CTX_set_read_ahead 3 ,
248.Xr SSL_set_max_send_fragment 3
249.Ss Sessions
250The following pages describe functions acting on
251.Vt SSL_SESSION
252objects.
253.Pp
254Constructors and destructors:
255.Xr SSL_SESSION_new 3 ,
256.Xr SSL_SESSION_free 3
257.Pp
258Accessors:
259.Xr SSL_SESSION_get_compress_id 3 ,
260.Xr SSL_SESSION_get_ex_new_index 3 ,
261.Xr SSL_SESSION_get_id 3 ,
262.Xr SSL_SESSION_get_protocol_version 3 ,
263.Xr SSL_SESSION_get_time 3 ,
264.Xr SSL_SESSION_get0_peer 3 ,
265.Xr SSL_SESSION_has_ticket 3 ,
266.Xr SSL_SESSION_set1_id_context 3
267.Pp
268Encoding and decoding:
269.Xr d2i_SSL_SESSION 3 ,
270.Xr PEM_read_SSL_SESSION 3 ,
271.Xr SSL_SESSION_print 3
272.Ss Connections
273The following pages describe functions acting on
274.Vt SSL
275connection objects:
276.Pp
277Constructors and destructors:
278.Xr SSL_new 3 ,
279.Xr SSL_dup 3 ,
280.Xr SSL_free 3 ,
281.Xr BIO_f_ssl 3
282.Pp
283To change the configuration:
284.Xr SSL_clear 3 ,
285.Xr SSL_set_SSL_CTX 3 ,
286.Xr SSL_copy_session_id 3 ,
287.Xr SSL_set_bio 3 ,
288.Xr SSL_set_connect_state 3 ,
289.Xr SSL_set_fd 3 ,
290.Xr SSL_set_session 3 ,
291.Xr SSL_set1_host 3 ,
292.Xr SSL_set_verify_result 3
293.Pp
294To inspect the configuration:
295.Xr SSL_get_certificate 3 ,
296.Xr SSL_get_default_timeout 3 ,
297.Xr SSL_get_ex_new_index 3 ,
298.Xr SSL_get_fd 3 ,
299.Xr SSL_get_rbio 3 ,
300.Xr SSL_get_SSL_CTX 3
301.Pp
302To transmit data:
303.Xr DTLSv1_listen 3 ,
304.Xr SSL_accept 3 ,
305.Xr SSL_connect 3 ,
306.Xr SSL_do_handshake 3 ,
307.Xr SSL_read 3 ,
308.Xr SSL_read_early_data 3 ,
309.Xr SSL_renegotiate 3 ,
310.Xr SSL_shutdown 3 ,
311.Xr SSL_write 3
312.Pp
313To inspect the state after a connection is established:
314.Xr SSL_export_keying_material 3 ,
315.Xr SSL_get_client_random 3 ,
316.Xr SSL_get_ex_data_X509_STORE_CTX_idx 3 ,
317.Xr SSL_get_peer_cert_chain 3 ,
318.Xr SSL_get_peer_certificate 3 ,
319.Xr SSL_get_server_tmp_key 3 ,
320.Xr SSL_get_servername 3 ,
321.Xr SSL_get_session 3 ,
322.Xr SSL_get_shared_ciphers 3 ,
323.Xr SSL_get_verify_result 3 ,
324.Xr SSL_get_version 3 ,
325.Xr SSL_session_reused 3
326.Pp
327To inspect the state during ongoing communication:
328.Xr SSL_get_error 3 ,
329.Xr SSL_get_shutdown 3 ,
330.Xr SSL_get_state 3 ,
331.Xr SSL_num_renegotiations 3 ,
332.Xr SSL_pending 3 ,
333.Xr SSL_rstate_string 3 ,
334.Xr SSL_state_string 3 ,
335.Xr SSL_want 3
336.Ss Utility functions
337.Xr SSL_alert_type_string 3 ,
338.Xr SSL_dup_CA_list 3 ,
339.Xr SSL_load_client_CA_file 3
340.Ss Obsolete functions
341.Xr OPENSSL_init_ssl 3 ,
342.Xr SSL_COMP_get_compression_methods 3 ,
343.Xr SSL_CTX_set_tmp_rsa_callback 3 ,
344.Xr SSL_library_init 3 ,
345.Xr SSL_set_tmp_ecdh 3
346.Sh SEE ALSO
347.Xr openssl 1 ,
348.Xr crypto 3 ,
349.Xr tls_init 3
350.Sh HISTORY
351The
352.Nm
353document appeared in OpenSSL 0.9.2.