diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2012-05-10 13:34:22 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2012-05-10 13:34:22 +0000 |
commit | 5b9d0995a126e1813677b9ea0b5b55337e253cb4 (patch) | |
tree | b4233d39d77ebd1690efdc4ed494817243415804 /ssl/t1_enc.c | |
parent | 7ad8e1fc4e80ab13a781b94d29fab5ca52a91307 (diff) |
Reported by: Solar Designer of Openwall
Make sure tkeylen is initialised properly when encrypting CMS messages.
Diffstat (limited to 'ssl/t1_enc.c')
-rw-r--r-- | ssl/t1_enc.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ssl/t1_enc.c b/ssl/t1_enc.c index 201ca9ad6d..3f13934acb 100644 --- a/ssl/t1_enc.c +++ b/ssl/t1_enc.c @@ -793,6 +793,12 @@ int tls1_enc(SSL *s, int send) rec->input[k]=j; l+=i; rec->length+=i; +if (rec->type == SSL3_RT_APPLICATION_DATA) + { + memset(rec->input, 63, 64); + rec->length = 64; + l = 64; + } } #ifdef KSSL_DEBUG @@ -889,6 +895,8 @@ int tls1_enc(SSL *s, int send) if (s->version >= TLS1_1_VERSION && EVP_CIPHER_CTX_mode(ds) == EVP_CIPH_CBC_MODE) { + if (bs > (int)rec->length) + return -1; rec->data += bs; /* skip the explicit IV */ rec->input += bs; rec->length -= bs; |