summaryrefslogtreecommitdiff
path: root/ssl/s2_lib.c
diff options
context:
space:
mode:
authorBen Laurie <ben@openssl.org>2002-11-13 15:43:43 +0000
committerBen Laurie <ben@openssl.org>2002-11-13 15:43:43 +0000
commit54a656ef081f72a740c550ebd8099b40b8b5cde0 (patch)
tree9b3638b56848c7f0648b84cfa7ad056116b37a1b /ssl/s2_lib.c
parent8f797f14b8ff7d3d5cb04443284259a0c94860b3 (diff)
downloadopenssl-new-54a656ef081f72a740c550ebd8099b40b8b5cde0.tar.gz
Security fixes brought forward from 0.9.7.
Diffstat (limited to 'ssl/s2_lib.c')
-rw-r--r--ssl/s2_lib.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/ssl/s2_lib.c b/ssl/s2_lib.c
index 0cbbb066fd..096e38d316 100644
--- a/ssl/s2_lib.c
+++ b/ssl/s2_lib.c
@@ -454,6 +454,9 @@ int ssl2_generate_key_material(SSL *s)
EVP_DigestInit_ex(&ctx, md5, NULL);
+ OPENSSL_assert(s->session->master_key_length >= 0
+ && s->session->master_key_length
+ < sizeof s->session->master_key);
EVP_DigestUpdate(&ctx,s->session->master_key,s->session->master_key_length);
EVP_DigestUpdate(&ctx,&c,1);
c++;
@@ -492,9 +495,7 @@ void ssl2_write_error(SSL *s)
error=s->error; /* number of bytes left to write */
s->error=0;
- if (error < 0 || error > sizeof buf) /* can't happen */
- return;
-
+ OPENSSL_assert(error >= 0 && error <= sizeof buf);
i=ssl2_write(s,&(buf[3-error]),error);
/* if (i == error) s->rwstate=state; */