summaryrefslogtreecommitdiffstats
path: root/ssl/s3_enc.c
diff options
context:
space:
mode:
authorBrian Carlstrom <bdc@google.com>2013-02-05 09:20:38 -0800
committerBrian Carlstrom <bdc@google.com>2013-02-05 09:57:14 -0800
commit04ef91b390dfcc6125913e2f2af502d23d7a5112 (patch)
tree2350c86475958f85c6fd56b7c80e0817a1c75b56 /ssl/s3_enc.c
parent3ccf38e0fb3064a4b19879d5e068fb7a124234c0 (diff)
downloadreplicant_openssl-04ef91b390dfcc6125913e2f2af502d23d7a5112.zip
replicant_openssl-04ef91b390dfcc6125913e2f2af502d23d7a5112.tar.gz
replicant_openssl-04ef91b390dfcc6125913e2f2af502d23d7a5112.tar.bz2
openssl-1.0.1d upgrade
Change-Id: Ie980c8834cf2c843858182d98d1f60c65a2a9b70
Diffstat (limited to 'ssl/s3_enc.c')
-rw-r--r--ssl/s3_enc.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/ssl/s3_enc.c b/ssl/s3_enc.c
index a0eac77..e3cd4f0 100644
--- a/ssl/s3_enc.c
+++ b/ssl/s3_enc.c
@@ -709,7 +709,7 @@ int n_ssl3_mac(SSL *ssl, unsigned char *md, int send)
EVP_MD_CTX md_ctx;
const EVP_MD_CTX *hash;
unsigned char *p,rec_char;
- size_t md_size;
+ size_t md_size, orig_len;
int npad;
int t;
@@ -734,6 +734,10 @@ int n_ssl3_mac(SSL *ssl, unsigned char *md, int send)
md_size=t;
npad=(48/md_size)*md_size;
+ /* kludge: ssl3_cbc_remove_padding passes padding length in rec->type */
+ orig_len = rec->length+md_size+((unsigned int)rec->type>>8);
+ rec->type &= 0xff;
+
if (!send &&
EVP_CIPHER_CTX_mode(ssl->enc_read_ctx) == EVP_CIPH_CBC_MODE &&
ssl3_cbc_record_digest_supported(hash))
@@ -765,7 +769,7 @@ int n_ssl3_mac(SSL *ssl, unsigned char *md, int send)
hash,
md, &md_size,
header, rec->input,
- rec->length + md_size, rec->orig_len,
+ rec->length + md_size, orig_len,
mac_sec, md_size,
1 /* is SSLv3 */);
}