diff options
author | 2001-08-01 19:51:16 +0000 | |
---|---|---|
committer | 2001-08-01 19:51:16 +0000 | |
commit | 200c029058c06b55c32b17d710757f7a3cca1ab1 (patch) | |
tree | 3c061a100d7c302e1a7124b24e4d7cbe0e3c4bb3 /lib/libssl/src/ssl/s3_enc.c | |
parent | http://www.openssl.org/news/secadv_prng.txt; ok beck@ (diff) | |
download | wireguard-openbsd-200c029058c06b55c32b17d710757f7a3cca1ab1.tar.xz wireguard-openbsd-200c029058c06b55c32b17d710757f7a3cca1ab1.zip |
merge openssl 0.9.6b-engine
Note that this is a maintenence release, API's appear *not* to have changed.
As such, I have only increased the minor number on these libraries
Diffstat (limited to 'lib/libssl/src/ssl/s3_enc.c')
-rw-r--r-- | lib/libssl/src/ssl/s3_enc.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/lib/libssl/src/ssl/s3_enc.c b/lib/libssl/src/ssl/s3_enc.c index 9f52c39ca97..8709da91756 100644 --- a/lib/libssl/src/ssl/s3_enc.c +++ b/lib/libssl/src/ssl/s3_enc.c @@ -356,7 +356,7 @@ int ssl3_enc(SSL *s, int send) if ((s->session == NULL) || (ds == NULL) || (enc == NULL)) { - memcpy(rec->data,rec->input,rec->length); + memmove(rec->data,rec->input,rec->length); rec->input=rec->data; } else @@ -366,7 +366,6 @@ int ssl3_enc(SSL *s, int send) /* COMPRESS */ - /* This should be using (bs-1) and bs instead of 7 and 8 */ if ((bs != 1) && send) { i=bs-((int)l%bs); @@ -376,12 +375,24 @@ int ssl3_enc(SSL *s, int send) rec->length+=i; rec->input[l-1]=(i-1); } - + + if (!send) + { + if (l == 0 || l%bs != 0) + { + SSLerr(SSL_F_SSL3_ENC,SSL_R_BLOCK_CIPHER_PAD_IS_WRONG); + ssl3_send_alert(s,SSL3_AL_FATAL,SSL_AD_DECRYPT_ERROR); + return(0); + } + } + EVP_Cipher(ds,rec->data,rec->input,l); if ((bs != 1) && !send) { i=rec->data[l-1]+1; + /* SSL 3.0 bounds the number of padding bytes by the block size; + * padding bytes (except that last) are arbitrary */ if (i > bs) { SSLerr(SSL_F_SSL3_ENC,SSL_R_BLOCK_CIPHER_PAD_IS_WRONG); |