diff options
author | Andy Polyakov <appro@openssl.org> | 2013-02-07 22:47:05 +0100 |
---|---|---|
committer | Andy Polyakov <appro@openssl.org> | 2013-02-08 11:51:09 +0100 |
commit | 4ea7019165db53b92b4284461c5c88bfe7c6e57d (patch) | |
tree | 874d40e14f276461cfa191c36e42a0b2eea692e9 /ssl | |
parent | 59b1129e0a50fdf7e4e58d7c355783a7bfc1f44c (diff) |
ssl/[d1|s3]_pkt.c: harmomize orig_len handling.
(cherry picked from commit 8545f73b8919770a5d012fe7a82d6785b69baa27)
Diffstat (limited to 'ssl')
-rw-r--r-- | ssl/d1_pkt.c | 4 | ||||
-rw-r--r-- | ssl/s3_pkt.c | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/ssl/d1_pkt.c b/ssl/d1_pkt.c index 9db44c95f9..55765d1cfb 100644 --- a/ssl/d1_pkt.c +++ b/ssl/d1_pkt.c @@ -362,7 +362,6 @@ dtls1_process_record(SSL *s) /* decrypt in place in 'rr->input' */ rr->data=rr->input; - orig_len=rr->length; enc_err = s->method->ssl3_enc->enc(s,0); /* enc_err is: @@ -394,6 +393,9 @@ printf("\n"); mac_size=EVP_MD_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 is the length of the record before any padding was * removed. This is public information, as is the MAC in use, * therefore we can safely process the record in a different diff --git a/ssl/s3_pkt.c b/ssl/s3_pkt.c index 707738be94..ff54ab75fb 100644 --- a/ssl/s3_pkt.c +++ b/ssl/s3_pkt.c @@ -351,7 +351,6 @@ again: /* decrypt in place in 'rr->input' */ rr->data=rr->input; - orig_len=rr->length; enc_err = s->method->ssl3_enc->enc(s,0); /* enc_err is: @@ -382,6 +381,9 @@ printf("\n"); mac_size=EVP_MD_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 is the length of the record before any padding was * removed. This is public information, as is the MAC in use, * therefore we can safely process the record in a different |