summaryrefslogtreecommitdiffstats
path: root/ssl
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2015-06-30 11:30:44 +0100
committerMatt Caswell <matt@openssl.org>2015-08-03 11:18:06 +0100
commite9f6b9a1a5ba9feaeeef88d9f45508996ce43468 (patch)
tree7f1e01909fa925e434519663724993cefa2b3684 /ssl
parentc69f2adf71d888ba1a2090ec0be3319eb024efe3 (diff)
Fix ssl3_read_bytes handshake fragment bug
The move of CCS into the state machine introduced a bug in ssl3_read_bytes. The value of |recvd_type| was not being set if we are satisfying the request from handshake fragment storage. This can occur, for example, with renegotiation and causes the handshake to fail. Reviewed-by: Tim Hudson <tjh@openssl.org>
Diffstat (limited to 'ssl')
-rw-r--r--ssl/record/rec_layer_s3.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ssl/record/rec_layer_s3.c b/ssl/record/rec_layer_s3.c
index 6feba42518..8a9e30302d 100644
--- a/ssl/record/rec_layer_s3.c
+++ b/ssl/record/rec_layer_s3.c
@@ -1012,6 +1012,10 @@ int ssl3_read_bytes(SSL *s, int type, int *recvd_type, unsigned char *buf,
/* move any remaining fragment bytes: */
for (k = 0; k < s->rlayer.handshake_fragment_len; k++)
s->rlayer.handshake_fragment[k] = *src++;
+
+ if (recvd_type != NULL)
+ *recvd_type = SSL3_RT_HANDSHAKE;
+
return n;
}