diff options
Diffstat (limited to 'ssl/s2_lib.c')
-rw-r--r-- | ssl/s2_lib.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ssl/s2_lib.c b/ssl/s2_lib.c index 8bcd7f4903..26a85c2f17 100644 --- a/ssl/s2_lib.c +++ b/ssl/s2_lib.c @@ -62,6 +62,7 @@ #include <openssl/rsa.h> #include <openssl/objects.h> #include <openssl/md5.h> +#include "cryptlib.h" static long ssl2_default_timeout(void ); const char *ssl2_version_str="SSLv2" OPENSSL_VERSION_PTEXT; @@ -427,10 +428,14 @@ void ssl2_generate_key_material(SSL *s) #endif km=s->s2->key_material; + die(s->s2->key_material_length <= sizeof s->s2->key_material); for (i=0; i<s->s2->key_material_length; i+=MD5_DIGEST_LENGTH) { MD5_Init(&ctx); + die(s->session->master_key_length >= 0 + && s->session->master_key_length + < sizeof s->session->master_key); MD5_Update(&ctx,s->session->master_key,s->session->master_key_length); MD5_Update(&ctx,&c,1); c++; @@ -465,6 +470,7 @@ void ssl2_write_error(SSL *s) /* state=s->rwstate;*/ error=s->error; s->error=0; + die(error >= 0 && error <= 3); i=ssl2_write(s,&(buf[3-error]),error); /* if (i == error) s->rwstate=state; */ |