summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2021-03-02 17:24:37 +0000
committerjsing <jsing@openbsd.org>2021-03-02 17:24:37 +0000
commit23d98bd4bcd1cd07b9a18a2a30888b4b27c14788 (patch)
tree6f41ed9e6e67d122d3c6d6333c978d4a01fe7ba6
parentMove key/IV length checks closer to usage sites. (diff)
downloadwireguard-openbsd-23d98bd4bcd1cd07b9a18a2a30888b4b27c14788.tar.xz
wireguard-openbsd-23d98bd4bcd1cd07b9a18a2a30888b4b27c14788.zip
Replace two handrolled tls12_record_protection_engaged().
Noted by tb@
-rw-r--r--lib/libssl/tls12_record_layer.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libssl/tls12_record_layer.c b/lib/libssl/tls12_record_layer.c
index a7bd4ce35b3..0020b5ee1fd 100644
--- a/lib/libssl/tls12_record_layer.c
+++ b/lib/libssl/tls12_record_layer.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tls12_record_layer.c,v 1.21 2021/03/02 17:18:59 jsing Exp $ */
+/* $OpenBSD: tls12_record_layer.c,v 1.22 2021/03/02 17:24:37 jsing Exp $ */
/*
* Copyright (c) 2020 Joel Sing <jsing@openbsd.org>
*
@@ -816,7 +816,7 @@ static int
tls12_record_layer_open_record_plaintext(struct tls12_record_layer *rl,
uint8_t content_type, CBS *fragment, uint8_t **out, size_t *out_len)
{
- if (rl->read->aead_ctx != NULL || rl->read->cipher_ctx != NULL)
+ if (tls12_record_protection_engaged(rl->read))
return 0;
/* XXX - decrypt/process in place for now. */
@@ -1081,7 +1081,7 @@ static int
tls12_record_layer_seal_record_plaintext(struct tls12_record_layer *rl,
uint8_t content_type, const uint8_t *content, size_t content_len, CBB *out)
{
- if (rl->write->aead_ctx != NULL || rl->write->cipher_ctx != NULL)
+ if (tls12_record_protection_engaged(rl->write))
return 0;
return CBB_add_bytes(out, content, content_len);