diff options
author | Andy Polyakov <appro@openssl.org> | 2013-02-07 22:47:05 +0100 |
---|---|---|
committer | Andy Polyakov <appro@openssl.org> | 2013-02-07 22:47:05 +0100 |
commit | 8545f73b8919770a5d012fe7a82d6785b69baa27 (patch) | |
tree | 69613d08c02722bb4e7708e4456f7dbe83033636 | |
parent | 32cc2479b473c49ce869e57fded7e9a77b695c0d (diff) |
ssl/[d1|s3]_pkt.c: harmomize orig_len handling.
-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 b0302a74d4..0bf87be6d2 100644 --- a/ssl/d1_pkt.c +++ b/ssl/d1_pkt.c @@ -410,7 +410,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: @@ -442,6 +441,9 @@ printf("\n"); 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 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 bf8da9843e..804291e27c 100644 --- a/ssl/s3_pkt.c +++ b/ssl/s3_pkt.c @@ -398,7 +398,6 @@ fprintf(stderr, "Record type=%d, Length=%d\n", rr->type, rr->length); /* 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: @@ -429,6 +428,9 @@ printf("\n"); 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 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 |