diff options
author | jsing <> | 2021-03-02 17:24:37 +0000 |
---|---|---|
committer | jsing <> | 2021-03-02 17:24:37 +0000 |
commit | 75547e5fdc809c778649c3ca80af8077cd7cb504 (patch) | |
tree | 39e64b11fef073c5cdd74b421818501fad8cc272 /src | |
parent | 0d8e0a4d097cd74fea64a0ff1256bf8521f8d9bc (diff) | |
download | openbsd-75547e5fdc809c778649c3ca80af8077cd7cb504.tar.gz openbsd-75547e5fdc809c778649c3ca80af8077cd7cb504.tar.bz2 openbsd-75547e5fdc809c778649c3ca80af8077cd7cb504.zip |
Replace two handrolled tls12_record_protection_engaged().
Noted by tb@
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libssl/tls12_record_layer.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/libssl/tls12_record_layer.c b/src/lib/libssl/tls12_record_layer.c index a7bd4ce35b..0020b5ee1f 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.21 2021/03/02 17:18:59 jsing Exp $ */ | 1 | /* $OpenBSD: tls12_record_layer.c,v 1.22 2021/03/02 17:24:37 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2020 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2020 Joel Sing <jsing@openbsd.org> |
4 | * | 4 | * |
@@ -816,7 +816,7 @@ static int | |||
816 | tls12_record_layer_open_record_plaintext(struct tls12_record_layer *rl, | 816 | tls12_record_layer_open_record_plaintext(struct tls12_record_layer *rl, |
817 | uint8_t content_type, CBS *fragment, uint8_t **out, size_t *out_len) | 817 | uint8_t content_type, CBS *fragment, uint8_t **out, size_t *out_len) |
818 | { | 818 | { |
819 | if (rl->read->aead_ctx != NULL || rl->read->cipher_ctx != NULL) | 819 | if (tls12_record_protection_engaged(rl->read)) |
820 | return 0; | 820 | return 0; |
821 | 821 | ||
822 | /* XXX - decrypt/process in place for now. */ | 822 | /* XXX - decrypt/process in place for now. */ |
@@ -1081,7 +1081,7 @@ static int | |||
1081 | tls12_record_layer_seal_record_plaintext(struct tls12_record_layer *rl, | 1081 | tls12_record_layer_seal_record_plaintext(struct tls12_record_layer *rl, |
1082 | uint8_t content_type, const uint8_t *content, size_t content_len, CBB *out) | 1082 | uint8_t content_type, const uint8_t *content, size_t content_len, CBB *out) |
1083 | { | 1083 | { |
1084 | if (rl->write->aead_ctx != NULL || rl->write->cipher_ctx != NULL) | 1084 | if (tls12_record_protection_engaged(rl->write)) |
1085 | return 0; | 1085 | return 0; |
1086 | 1086 | ||
1087 | return CBB_add_bytes(out, content, content_len); | 1087 | return CBB_add_bytes(out, content, content_len); |