diff options
Diffstat (limited to 'src/lib/libssl/tls13_lib.c')
-rw-r--r-- | src/lib/libssl/tls13_lib.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/lib/libssl/tls13_lib.c b/src/lib/libssl/tls13_lib.c index e371d71750..c5e2faf3fc 100644 --- a/src/lib/libssl/tls13_lib.c +++ b/src/lib/libssl/tls13_lib.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: tls13_lib.c,v 1.7 2019/02/28 17:44:56 jsing Exp $ */ | 1 | /* $OpenBSD: tls13_lib.c,v 1.8 2019/02/28 17:56:43 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 | * |
@@ -241,6 +241,12 @@ tls13_legacy_read_bytes(SSL *ssl, int type, unsigned char *buf, int len, int pee | |||
241 | struct tls13_ctx *ctx = ssl->internal->tls13; | 241 | struct tls13_ctx *ctx = ssl->internal->tls13; |
242 | ssize_t ret; | 242 | ssize_t ret; |
243 | 243 | ||
244 | if (ctx == NULL || !ctx->handshake_completed) { | ||
245 | if ((ret = ssl->internal->handshake_func(ssl)) <= 0) | ||
246 | return ret; | ||
247 | return tls13_legacy_return_code(ssl, TLS13_IO_WANT_POLLIN); | ||
248 | } | ||
249 | |||
244 | if (peek) { | 250 | if (peek) { |
245 | /* XXX - support peek... */ | 251 | /* XXX - support peek... */ |
246 | SSLerror(ssl, ERR_R_INTERNAL_ERROR); | 252 | SSLerror(ssl, ERR_R_INTERNAL_ERROR); |
@@ -266,6 +272,12 @@ tls13_legacy_write_bytes(SSL *ssl, int type, const void *buf, int len) | |||
266 | struct tls13_ctx *ctx = ssl->internal->tls13; | 272 | struct tls13_ctx *ctx = ssl->internal->tls13; |
267 | ssize_t ret; | 273 | ssize_t ret; |
268 | 274 | ||
275 | if (ctx == NULL || !ctx->handshake_completed) { | ||
276 | if ((ret = ssl->internal->handshake_func(ssl)) <= 0) | ||
277 | return ret; | ||
278 | return tls13_legacy_return_code(ssl, TLS13_IO_WANT_POLLOUT); | ||
279 | } | ||
280 | |||
269 | if (type != SSL3_RT_APPLICATION_DATA) { | 281 | if (type != SSL3_RT_APPLICATION_DATA) { |
270 | SSLerror(ssl, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); | 282 | SSLerror(ssl, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); |
271 | return -1; | 283 | return -1; |