diff options
Diffstat (limited to 'src/lib/libssl/tls13_record_layer.c')
-rw-r--r-- | src/lib/libssl/tls13_record_layer.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/lib/libssl/tls13_record_layer.c b/src/lib/libssl/tls13_record_layer.c index f6dbbf1550..aa8968484b 100644 --- a/src/lib/libssl/tls13_record_layer.c +++ b/src/lib/libssl/tls13_record_layer.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: tls13_record_layer.c,v 1.23 2020/01/23 02:49:38 jsing Exp $ */ | 1 | /* $OpenBSD: tls13_record_layer.c,v 1.24 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 | * | 4 | * |
@@ -815,6 +815,15 @@ tls13_record_layer_read_record(struct tls13_record_layer *rl) | |||
815 | } | 815 | } |
816 | 816 | ||
817 | ssize_t | 817 | ssize_t |
818 | tls13_record_layer_pending(struct tls13_record_layer *rl, uint8_t content_type) | ||
819 | { | ||
820 | if (rl->rbuf_content_type != content_type) | ||
821 | return 0; | ||
822 | |||
823 | return CBS_len(&rl->rbuf_cbs); | ||
824 | } | ||
825 | |||
826 | static ssize_t | ||
818 | tls13_record_layer_read_internal(struct tls13_record_layer *rl, | 827 | tls13_record_layer_read_internal(struct tls13_record_layer *rl, |
819 | uint8_t content_type, uint8_t *buf, size_t n, int peek) | 828 | uint8_t content_type, uint8_t *buf, size_t n, int peek) |
820 | { | 829 | { |
@@ -1026,6 +1035,15 @@ tls13_write_handshake_data(struct tls13_record_layer *rl, const uint8_t *buf, | |||
1026 | } | 1035 | } |
1027 | 1036 | ||
1028 | ssize_t | 1037 | ssize_t |
1038 | tls13_pending_application_data(struct tls13_record_layer *rl) | ||
1039 | { | ||
1040 | if (!rl->handshake_completed) | ||
1041 | return 0; | ||
1042 | |||
1043 | return tls13_record_layer_pending(rl, SSL3_RT_APPLICATION_DATA); | ||
1044 | } | ||
1045 | |||
1046 | ssize_t | ||
1029 | tls13_peek_application_data(struct tls13_record_layer *rl, uint8_t *buf, size_t n) | 1047 | tls13_peek_application_data(struct tls13_record_layer *rl, uint8_t *buf, size_t n) |
1030 | { | 1048 | { |
1031 | if (!rl->handshake_completed) | 1049 | if (!rl->handshake_completed) |