summaryrefslogtreecommitdiffstats
path: root/lib/libssl/ssl_pkt.c
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2020-03-12 17:09:02 +0000
committerjsing <jsing@openbsd.org>2020-03-12 17:09:02 +0000
commit6a588c51e9c9755abee8a26baecd87dabc68f91d (patch)
tree748f7b463648e955cff77ac53aad242c508a1132 /lib/libssl/ssl_pkt.c
parentUse internal versions of SSL3_BUFFER, SSL3_RECORD and DTLS1_RECORD_DATA. (diff)
downloadwireguard-openbsd-6a588c51e9c9755abee8a26baecd87dabc68f91d.tar.xz
wireguard-openbsd-6a588c51e9c9755abee8a26baecd87dabc68f91d.zip
Stop overloading the record type for padding length.
Currently the CBC related code stuffs the padding length in the upper bits of the type field... stop doing that and add a padding_length field to the record struct instead. ok inoguchi@ tb@
Diffstat (limited to 'lib/libssl/ssl_pkt.c')
-rw-r--r--lib/libssl/ssl_pkt.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/libssl/ssl_pkt.c b/lib/libssl/ssl_pkt.c
index 4302794d942..0d1d4f78c78 100644
--- a/lib/libssl/ssl_pkt.c
+++ b/lib/libssl/ssl_pkt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssl_pkt.c,v 1.22 2020/03/12 17:01:53 jsing Exp $ */
+/* $OpenBSD: ssl_pkt.c,v 1.23 2020/03/12 17:09:02 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -451,8 +451,7 @@ ssl3_get_record(SSL *s)
mac_size = EVP_MD_CTX_size(s->read_hash);
OPENSSL_assert(mac_size <= EVP_MAX_MD_SIZE);
- /* kludge: *_cbc_remove_padding passes padding length in rr->type */
- orig_len = rr->length + ((unsigned int)rr->type >> 8);
+ orig_len = rr->length + rr->padding_length;
/* orig_len is the length of the record before any padding was
* removed. This is public information, as is the MAC in use,