summaryrefslogtreecommitdiff
path: root/src/lib/libssl/tls12_record_layer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libssl/tls12_record_layer.c')
-rw-r--r--src/lib/libssl/tls12_record_layer.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/lib/libssl/tls12_record_layer.c b/src/lib/libssl/tls12_record_layer.c
index 7fa31707d3..affc5375a2 100644
--- a/src/lib/libssl/tls12_record_layer.c
+++ b/src/lib/libssl/tls12_record_layer.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: tls12_record_layer.c,v 1.11 2021/01/19 18:51:08 jsing Exp $ */ 1/* $OpenBSD: tls12_record_layer.c,v 1.12 2021/01/19 18:57:09 jsing Exp $ */
2/* 2/*
3 * Copyright (c) 2020 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2020 Joel Sing <jsing@openbsd.org>
4 * 4 *
@@ -59,6 +59,12 @@ tls12_record_protection_free(struct tls12_record_protection *rp)
59} 59}
60 60
61static int 61static int
62tls12_record_protection_engaged(struct tls12_record_protection *rp)
63{
64 return rp->aead_ctx != NULL || rp->cipher_ctx != NULL;
65}
66
67static int
62tls12_record_protection_eiv_len(struct tls12_record_protection *rp, 68tls12_record_protection_eiv_len(struct tls12_record_protection *rp,
63 size_t *out_eiv_len) 69 size_t *out_eiv_len)
64{ 70{
@@ -195,6 +201,18 @@ tls12_record_layer_write_overhead(struct tls12_record_layer *rl,
195 return 1; 201 return 1;
196} 202}
197 203
204int
205tls12_record_layer_read_protected(struct tls12_record_layer *rl)
206{
207 return tls12_record_protection_engaged(rl->read);
208}
209
210int
211tls12_record_layer_write_protected(struct tls12_record_layer *rl)
212{
213 return tls12_record_protection_engaged(rl->write);
214}
215
198void 216void
199tls12_record_layer_set_version(struct tls12_record_layer *rl, uint16_t version) 217tls12_record_layer_set_version(struct tls12_record_layer *rl, uint16_t version)
200{ 218{