diff options
author | jsing <> | 2020-07-25 17:44:30 +0000 |
---|---|---|
committer | jsing <> | 2020-07-25 17:44:30 +0000 |
commit | ce40926ffe997532135813e689b0f3f3f62b1f8e (patch) | |
tree | c2569f4ce1aed130927b5b181f82dec23d385f95 /src | |
parent | 86c1d3d52c1c6e9d790bd21b6cd52cafade42943 (diff) | |
download | openbsd-ce40926ffe997532135813e689b0f3f3f62b1f8e.tar.gz openbsd-ce40926ffe997532135813e689b0f3f3f62b1f8e.tar.bz2 openbsd-ce40926ffe997532135813e689b0f3f3f62b1f8e.zip |
Handle SSL_MODE_AUTO_RETRY being changed during a TLSv1.3 session.
Both Perl's HTTP::Tiny and IO::Socket::SSL know about SSL_MODE_AUTO_RETRY
and try to work around the fact that OpenSSL enabled it by default.
However, this can lead to the mode being disabled prior to the TLSv1.3
handshake and then enabled after the handshake has completed.
In order to handle this correctly we have to check the mode and inform the
record layer prior to every read.
Issue reported and test case provided by Nathanael Rensen
<nathanael@polymorpheus.com>.
ok inoguchi@ tb@
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libssl/tls13_legacy.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/libssl/tls13_legacy.c b/src/lib/libssl/tls13_legacy.c index 23f9c5f664..3feb143183 100644 --- a/src/lib/libssl/tls13_legacy.c +++ b/src/lib/libssl/tls13_legacy.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: tls13_legacy.c,v 1.10 2020/07/14 18:55:59 jsing Exp $ */ | 1 | /* $OpenBSD: tls13_legacy.c,v 1.11 2020/07/25 17:44:30 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2018, 2019 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2018, 2019 Joel Sing <jsing@openbsd.org> |
4 | * | 4 | * |
@@ -208,6 +208,9 @@ tls13_legacy_read_bytes(SSL *ssl, int type, unsigned char *buf, int len, int pee | |||
208 | return tls13_legacy_return_code(ssl, TLS13_IO_WANT_POLLIN); | 208 | return tls13_legacy_return_code(ssl, TLS13_IO_WANT_POLLIN); |
209 | } | 209 | } |
210 | 210 | ||
211 | tls13_record_layer_set_retry_after_phh(ctx->rl, | ||
212 | (ctx->ssl->internal->mode & SSL_MODE_AUTO_RETRY) != 0); | ||
213 | |||
211 | if (type != SSL3_RT_APPLICATION_DATA) { | 214 | if (type != SSL3_RT_APPLICATION_DATA) { |
212 | SSLerror(ssl, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); | 215 | SSLerror(ssl, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); |
213 | return -1; | 216 | return -1; |