summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ssl/ssl_locl.h3
-rw-r--r--ssl/statem/statem_lib.c7
2 files changed, 10 insertions, 0 deletions
diff --git a/ssl/ssl_locl.h b/ssl/ssl_locl.h
index d86bd7e8e2..85c754968c 100644
--- a/ssl/ssl_locl.h
+++ b/ssl/ssl_locl.h
@@ -347,6 +347,9 @@
/* we have used 0000003f - 26 bits left to go */
+# define SSL_IS_FIRST_HANDSHAKE(S) ((s)->s3->tmp.finish_md_len == 0 \
+ || (s)->s3->tmp.peer_finish_md_len == 0)
+
/* Check if an SSL structure is using DTLS */
# define SSL_IS_DTLS(s) (s->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
/* See if we need explicit IV */
diff --git a/ssl/statem/statem_lib.c b/ssl/statem/statem_lib.c
index 36d410bdf7..c4d4f26f7e 100644
--- a/ssl/statem/statem_lib.c
+++ b/ssl/statem/statem_lib.c
@@ -1073,6 +1073,13 @@ int ssl_set_client_hello_version(SSL *s)
{
int ver_min, ver_max, ret;
+ /*
+ * In a renegotiation we always send the same client_version that we sent
+ * last time, regardless of which version we eventually negotiated.
+ */
+ if (!SSL_IS_FIRST_HANDSHAKE(s))
+ return 0;
+
ret = ssl_get_client_min_max_version(s, &ver_min, &ver_max);
if (ret != 0)