summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschwarze <>2020-09-21 08:53:56 +0000
committerschwarze <>2020-09-21 08:53:56 +0000
commitb4cb0b6340ab8cc6bc259824012ca232d8590410 (patch)
treed53f82f2944050e1bed1bf6e33f6a472b99204ca
parentb10a5db99b3dc600dbc2bcb0285204a7b9a669bf (diff)
downloadopenbsd-b4cb0b6340ab8cc6bc259824012ca232d8590410.tar.gz
openbsd-b4cb0b6340ab8cc6bc259824012ca232d8590410.tar.bz2
openbsd-b4cb0b6340ab8cc6bc259824012ca232d8590410.zip
In ssl.h rev. 1.174 to 1.176, tb@ added some stubs related to 0-RTT data.
Write documentation from scratch explaining why we don't support 0-RTT but how we stub it out instead. Tweaks and OK tb@. ... and beck@ pointed out that this OpenSSL API is akin to adding a laser sighting system to a giant blackpowder cannon that one keeps blowing one's own feet to mangled scraps with ...
-rw-r--r--src/lib/libssl/man/Makefile5
-rw-r--r--src/lib/libssl/man/SSL_read_early_data.3175
-rw-r--r--src/lib/libssl/man/ssl.37
3 files changed, 183 insertions, 4 deletions
diff --git a/src/lib/libssl/man/Makefile b/src/lib/libssl/man/Makefile
index f8e5cffd59..c8edf6311e 100644
--- a/src/lib/libssl/man/Makefile
+++ b/src/lib/libssl/man/Makefile
@@ -1,4 +1,4 @@
1# $OpenBSD: Makefile,v 1.68 2020/09/20 10:20:43 schwarze Exp $ 1# $OpenBSD: Makefile,v 1.69 2020/09/21 08:53:56 schwarze Exp $
2 2
3.include <bsd.own.mk> 3.include <bsd.own.mk>
4 4
@@ -120,6 +120,9 @@ MAN = BIO_f_ssl.3 \
120 d2i_SSL_SESSION.3 \ 120 d2i_SSL_SESSION.3 \
121 ssl.3 121 ssl.3
122 122
123# To be enabled after the release of OpenBSD 6.8:
124# SSL_read_early_data.3 \
125
123all clean cleandir depend includes obj tags: 126all clean cleandir depend includes obj tags:
124 127
125install: maninstall 128install: maninstall
diff --git a/src/lib/libssl/man/SSL_read_early_data.3 b/src/lib/libssl/man/SSL_read_early_data.3
new file mode 100644
index 0000000000..71ad3c52a3
--- /dev/null
+++ b/src/lib/libssl/man/SSL_read_early_data.3
@@ -0,0 +1,175 @@
1.\" $OpenBSD: SSL_read_early_data.3,v 1.1 2020/09/21 08:53:56 schwarze 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: September 21 2020 $
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 before the handshake is complete
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
91before the inital handshake is complete.
92Even when used as designed, security of the connection is compromised;
93in particular, application data is exchanged with unauthenticated peers,
94and there is no forward secrecy.
95Other downsides include an increased risk of replay attacks.
96.Pp
97.Fn SSL_CTX_set_max_early_data ,
98.Fn SSL_set_max_early_data ,
99and
100.Fn SSL_SESSION_set_max_early_data
101are intended to configure the maximum number of bytes per session
102that can be transmitted before the handshake is complete.
103With LibreSSL, all arguments are ignored.
104.Pp
105An endpoint can attempt to send application data with
106.Fn SSL_write_early_data
107before the handshake is complete.
108With LibreSSL, such attempts always fail and set
109.Pf * Fa written
110to 0.
111.Pp
112A server can attempt to read application data from the client using
113.Fn SSL_read_early_data
114before the handshake is complete.
115With LibreSSL, no such data is ever accepted and
116.Pf * Fa readbytes
117is always set to 0.
118.Sh RETURN VALUES
119.Fn SSL_CTX_set_max_early_data ,
120.Fn SSL_set_max_early_data ,
121and
122.Fn SSL_SESSION_set_max_early_data
123return 1 for success or 0 for failure.
124With LibreSSL, they always succeed.
125.Pp
126.Fn SSL_CTX_get_max_early_data ,
127.Fn SSL_get_max_early_data ,
128and
129.Fn SSL_SESSION_get_max_early_data
130return the maximum number of bytes of application data
131that will be accepted from the peer before the handshake is complete.
132With LibreSSL, they always return 0.
133.Pp
134.Fn SSL_write_early_data
135returns 1 for success or 0 for failure.
136With LibreSSL, it always fails.
137.Pp
138With LibreSSL,
139.Fn SSL_read_early_data
140always returns
141.Dv SSL_READ_EARLY_DATA_FINISH
142on the server side and
143.Dv SSL_READ_EARLY_DATA_ERROR
144on the client side.
145.Dv SSL_READ_EARLY_DATA_SUCCESS
146can occur with other implementations, but not with LibreSSL.
147.Pp
148With LibreSSL,
149.Fn SSL_get_early_data_status
150always returns
151.Dv SSL_EARLY_DATA_REJECTED .
152With other implementations, it might also return
153.Dv SSL_EARLY_DATA_NOT_SENT
154or
155.Dv SSL_EARLY_DATA_ACCEPTED .
156.Sh SEE ALSO
157.Xr ssl 3 ,
158.Xr SSL_read 3 ,
159.Xr SSL_write 3
160.Sh STANDARDS
161RFC 8446: The Transport Layer Security (TLS) Protocol Version 1.3:
162.Bl -tag -width "section 4.2.10" -compact
163.It Section 2.3
1640-RTT data
165.It Section 4.2.10
166Early Data Indication
167.It Section 8
1680-RTT and Anti-Replay
169.It Appendix E.5
170Replay Attacks on 0-RTT
171.El
172.Sh HISTORY
173These functions first appeared in OpenSSL 1.1.1
174and have been available since
175.Ox 6.9 .
diff --git a/src/lib/libssl/man/ssl.3 b/src/lib/libssl/man/ssl.3
index 26596a5f8c..81778df790 100644
--- a/src/lib/libssl/man/ssl.3
+++ b/src/lib/libssl/man/ssl.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: ssl.3,v 1.19 2020/09/20 10:20:44 schwarze Exp $ 1.\" $OpenBSD: ssl.3,v 1.20 2020/09/21 08:53:56 schwarze Exp $
2.\" full merge up to: OpenSSL e330f55d Nov 11 00:51:04 2016 +0100 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 3.\" selective merge up to: OpenSSL 322755cc Sep 1 08:40:51 2018 +0800
4.\" 4.\"
@@ -51,7 +51,7 @@
51.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 51.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
52.\" OF THE POSSIBILITY OF SUCH DAMAGE. 52.\" OF THE POSSIBILITY OF SUCH DAMAGE.
53.\" 53.\"
54.Dd $Mdocdate: September 20 2020 $ 54.Dd $Mdocdate: September 21 2020 $
55.Dt SSL 3 55.Dt SSL 3
56.Os 56.Os
57.Sh NAME 57.Sh NAME
@@ -301,7 +301,7 @@ To change the configuration:
301.Xr SSL_set_connect_state 3 , 301.Xr SSL_set_connect_state 3 ,
302.Xr SSL_set_fd 3 , 302.Xr SSL_set_fd 3 ,
303.Xr SSL_set_session 3 , 303.Xr SSL_set_session 3 ,
304.Xr SSL_set1_host.3 , 304.Xr SSL_set1_host 3 ,
305.Xr SSL_set_verify_result 3 305.Xr SSL_set_verify_result 3
306.Pp 306.Pp
307To inspect the configuration: 307To inspect the configuration:
@@ -318,6 +318,7 @@ To transmit data:
318.Xr SSL_connect 3 , 318.Xr SSL_connect 3 ,
319.Xr SSL_do_handshake 3 , 319.Xr SSL_do_handshake 3 ,
320.Xr SSL_read 3 , 320.Xr SSL_read 3 ,
321.\" XXX enable after the 6.8 release: Xr SSL_read_early_data 3 ,
321.Xr SSL_renegotiate 3 , 322.Xr SSL_renegotiate 3 ,
322.Xr SSL_shutdown 3 , 323.Xr SSL_shutdown 3 ,
323.Xr SSL_write 3 324.Xr SSL_write 3