Fix ssl3_read_bytes handshake fragment bug
authorMatt Caswell <matt@openssl.org>
Tue, 30 Jun 2015 10:30:44 +0000 (11:30 +0100)
committerMatt Caswell <matt@openssl.org>
Mon, 3 Aug 2015 10:18:06 +0000 (11:18 +0100)
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>
ssl/record/rec_layer_s3.c

index 6feba4251884d895520c5164d53e853a2ccfd2c3..8a9e30302da9c6dd2e3dee74187faa8938c85690 100644 (file)
@@ -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;
     }