diff options
Diffstat (limited to 'src/lib/libssl/tls13_lib.c')
-rw-r--r-- | src/lib/libssl/tls13_lib.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/lib/libssl/tls13_lib.c b/src/lib/libssl/tls13_lib.c index 727f617471..de3e840a84 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.22 2020/01/23 02:49:38 jsing Exp $ */ | 1 | /* $OpenBSD: tls13_lib.c,v 1.23 2020/01/23 05:08: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 | * Copyright (c) 2019 Bob Beck <beck@openbsd.org> | 4 | * Copyright (c) 2019 Bob Beck <beck@openbsd.org> |
@@ -411,6 +411,22 @@ tls13_legacy_return_code(SSL *ssl, ssize_t ret) | |||
411 | } | 411 | } |
412 | 412 | ||
413 | int | 413 | int |
414 | tls13_legacy_pending(const SSL *ssl) | ||
415 | { | ||
416 | struct tls13_ctx *ctx = ssl->internal->tls13; | ||
417 | ssize_t ret; | ||
418 | |||
419 | if (ctx == NULL) | ||
420 | return 0; | ||
421 | |||
422 | ret = tls13_pending_application_data(ctx->rl); | ||
423 | if (ret < 0 || ret > INT_MAX) | ||
424 | return 0; | ||
425 | |||
426 | return ret; | ||
427 | } | ||
428 | |||
429 | int | ||
414 | tls13_legacy_read_bytes(SSL *ssl, int type, unsigned char *buf, int len, int peek) | 430 | tls13_legacy_read_bytes(SSL *ssl, int type, unsigned char *buf, int len, int peek) |
415 | { | 431 | { |
416 | struct tls13_ctx *ctx = ssl->internal->tls13; | 432 | struct tls13_ctx *ctx = ssl->internal->tls13; |