summaryrefslogtreecommitdiff
path: root/main/openssl/ssl/s3_pkt.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/openssl/ssl/s3_pkt.c')
-rw-r--r--main/openssl/ssl/s3_pkt.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/main/openssl/ssl/s3_pkt.c b/main/openssl/ssl/s3_pkt.c
index d88f4dbb..75997ac2 100644
--- a/main/openssl/ssl/s3_pkt.c
+++ b/main/openssl/ssl/s3_pkt.c
@@ -1309,6 +1309,13 @@ start:
goto f_err;
}
+ if (!(s->s3->flags & SSL3_FLAGS_CCS_OK))
+ {
+ al=SSL_AD_UNEXPECTED_MESSAGE;
+ SSLerr(SSL_F_SSL3_READ_BYTES,SSL_R_UNEXPECTED_CCS);
+ goto f_err;
+ }
+
rr->length=0;
if (s->msg_callback)
@@ -1443,7 +1450,12 @@ int ssl3_do_change_cipher_spec(SSL *s)
if (s->s3->tmp.key_block == NULL)
{
- if (s->session == NULL)
+ if (s->session->master_key_length == 0)
+ {
+ SSLerr(SSL_F_SSL3_DO_CHANGE_CIPHER_SPEC,SSL_R_UNEXPECTED_CCS);
+ return (0);
+ }
+ if (s->session == NULL)
{
/* might happen if dtls1_read_bytes() calls this */
SSLerr(SSL_F_SSL3_DO_CHANGE_CIPHER_SPEC,SSL_R_CCS_RECEIVED_EARLY);