aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/tls/msg_server_kex.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2016-10-07 15:50:48 -0400
committerJack Lloyd <[email protected]>2016-10-07 15:50:48 -0400
commit36220cebaae551f3e7c22e2abd8a8ce848e56892 (patch)
tree3b9aca25bf2437b7cde4f4df7e3bb876a139c264 /src/lib/tls/msg_server_kex.cpp
parentb2209d7ebe29bfe2ab5d25eb2be7c51d42ea2a46 (diff)
parentc2d88a0c4e0d2b6aa461cf7c415eea23ff3994c2 (diff)
Merge GH #645 TLS compressed points
Diffstat (limited to 'src/lib/tls/msg_server_kex.cpp')
-rw-r--r--src/lib/tls/msg_server_kex.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/tls/msg_server_kex.cpp b/src/lib/tls/msg_server_kex.cpp
index 10581fe45..33b980ba9 100644
--- a/src/lib/tls/msg_server_kex.cpp
+++ b/src/lib/tls/msg_server_kex.cpp
@@ -85,7 +85,10 @@ Server_Key_Exchange::Server_Key_Exchange(Handshake_IO& io,
m_params.push_back(get_byte(0, named_curve_id));
m_params.push_back(get_byte(1, named_curve_id));
- append_tls_length_value(m_params, ecdh->public_value(), 1);
+ // follow client's preference for point compression
+ append_tls_length_value(m_params,
+ ecdh->public_value(state.client_hello()->prefers_compressed_ec_points() ?
+ PointGFp::COMPRESSED : PointGFp::UNCOMPRESSED), 1);
m_kex_key.reset(ecdh.release());
}