summaryrefslogtreecommitdiffstats
path: root/ssl/s2_lib.c
diff options
context:
space:
mode:
authorBen Laurie <ben@openssl.org>2002-11-12 13:23:40 +0000
committerBen Laurie <ben@openssl.org>2002-11-12 13:23:40 +0000
commit9831d941ca3d46eab3e61e6983921220b9d5d09a (patch)
treeec628033e73b153616f300b3807921c9fe7de70f /ssl/s2_lib.c
parent707ceb29e04f7199f1ae619a6c0eab866fd15add (diff)
Many security improvements (CHATS) and a warning fix.
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; */