diff --git a/ssl/record/rec_layer_s3.c b/ssl/record/rec_layer_s3.c index ea702582529314334d572f3b88a8e47b631d951a..0953d2b01d585192fe0ec97bb1d59f9c4fe9483b 100644 --- a/ssl/record/rec_layer_s3.c +++ b/ssl/record/rec_layer_s3.c @@ -839,7 +839,9 @@ int do_ssl3_write(SSL *s, int type, const unsigned char *buf, * and record version number > TLS 1.0 */ if (SSL_get_state(s) == TLS_ST_CW_CLNT_HELLO - && !s->renegotiate && TLS1_get_version(s) > TLS1_VERSION) + && !s->renegotiate + && TLS1_get_version(s) > TLS1_VERSION + && s->hello_retry_request == SSL_HRR_NONE) version = TLS1_VERSION; maxcomplen = pipelens[j]; diff --git a/test/tls13ccstest.c b/test/tls13ccstest.c index c51c2cec5ffae0dca8e9231cd5e7b48bc14d7e67..db9bfe5a57f64b38ed4f5b17d33eb56b2c94f1da 100644 --- a/test/tls13ccstest.c +++ b/test/tls13ccstest.c @@ -118,7 +118,7 @@ static int watchccs_write(BIO *bio, const char *in, int inl) return 0; if (msgtype == SSL3_MT_CLIENT_HELLO) { chseen++; - expectedrecvers = TLS1_VERSION; + /* * Skip legacy_version (2 bytes) and Random (32 bytes) to read * session_id. @@ -128,6 +128,8 @@ static int watchccs_write(BIO *bio, const char *in, int inl) return 0; if (chseen == 1) { + expectedrecvers = TLS1_VERSION; + /* Save the session id for later */ chsessidlen = PACKET_remaining(&sessionid); if (!PACKET_copy_bytes(&sessionid, chsessid, chsessidlen))