From 70aba26c757b933fe142bb4656d5a4d555601134 Mon Sep 17 00:00:00 2001 From: David Benjamin Date: Tue, 1 Nov 2016 12:08:15 -0400 Subject: [PATCH] Skip ec_point_format if min_version >= TLS 1.3. Trim a few more bytes from the future QUIC ClientHello. Change-Id: If23c5cd078889a9a26cf2231b51b17c2615a38ea Reviewed-on: https://boringssl-review.googlesource.com/12000 Reviewed-by: Steven Valdez Reviewed-by: David Benjamin Commit-Queue: David Benjamin CQ-Verified: CQ bot account: commit-bot@chromium.org --- ssl/t1_lib.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ssl/t1_lib.c b/ssl/t1_lib.c index 83bae276..a265a2e3 100644 --- a/ssl/t1_lib.c +++ b/ssl/t1_lib.c @@ -1853,6 +1853,16 @@ static int ext_ec_point_add_extension(SSL *ssl, CBB *out) { } static int ext_ec_point_add_clienthello(SSL *ssl, CBB *out) { + uint16_t min_version, max_version; + if (!ssl_get_version_range(ssl, &min_version, &max_version)) { + return 0; + } + + /* The point format extension is unneccessary in TLS 1.3. */ + if (min_version >= TLS1_3_VERSION) { + return 1; + } + return ext_ec_point_add_extension(ssl, out); }