aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/lib/tls/msg_client_kex.cpp11
-rw-r--r--src/lib/tls/msg_server_kex.cpp11
-rw-r--r--src/lib/tls/tls_extensions.cpp10
3 files changed, 7 insertions, 25 deletions
diff --git a/src/lib/tls/msg_client_kex.cpp b/src/lib/tls/msg_client_kex.cpp
index a01830c28..0eceadb3b 100644
--- a/src/lib/tls/msg_client_kex.cpp
+++ b/src/lib/tls/msg_client_kex.cpp
@@ -173,14 +173,9 @@ Client_Key_Exchange::Client_Key_Exchange(Handshake_IO& io,
}
// follow server's preference for point compression
- if(state.server_hello()->prefers_compressed_ec_points())
- {
- append_tls_length_value(m_key_material, priv_key.public_value(PointGFp::COMPRESSED), 1);
- }
- else
- {
- append_tls_length_value(m_key_material, priv_key.public_value(PointGFp::UNCOMPRESSED), 1);
- }
+ append_tls_length_value(m_key_material,
+ priv_key.public_value(state.server_hello()->prefers_compressed_ec_points() ?
+ PointGFp::COMPRESSED : PointGFp::UNCOMPRESSED ), 1);
}
#if defined(BOTAN_HAS_SRP6)
else if(kex_algo == "SRP_SHA")
diff --git a/src/lib/tls/msg_server_kex.cpp b/src/lib/tls/msg_server_kex.cpp
index c44dcb69a..33b980ba9 100644
--- a/src/lib/tls/msg_server_kex.cpp
+++ b/src/lib/tls/msg_server_kex.cpp
@@ -86,14 +86,9 @@ Server_Key_Exchange::Server_Key_Exchange(Handshake_IO& io,
m_params.push_back(get_byte(1, named_curve_id));
// follow client's preference for point compression
- if(state.client_hello()->prefers_compressed_ec_points())
- {
- append_tls_length_value(m_params, ecdh->public_value(PointGFp::COMPRESSED), 1);
- }
- else
- {
- append_tls_length_value(m_params, ecdh->public_value(PointGFp::UNCOMPRESSED), 1);
- }
+ 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());
}
diff --git a/src/lib/tls/tls_extensions.cpp b/src/lib/tls/tls_extensions.cpp
index d82df20c5..df265d915 100644
--- a/src/lib/tls/tls_extensions.cpp
+++ b/src/lib/tls/tls_extensions.cpp
@@ -358,18 +358,10 @@ Supported_Elliptic_Curves::Supported_Elliptic_Curves(TLS_Data_Reader& reader,
std::vector<byte> Supported_Point_Formats::serialize() const
{
- std::vector<byte> buf(1);
-
// if we send this extension, we prefer compressed points,
// otherwise we don't send it (which is equal to supporting only uncompressed)
- buf.push_back(ANSIX962_COMPRESSED_PRIME);
-
// if this extension is sent, it MUST include uncompressed (RFC 4492, section 5.1)
- buf.push_back(UNCOMPRESSED);
-
- buf[0] = static_cast<byte>(buf.size()-1);
-
- return buf;
+ return std::vector<byte>{2, ANSIX962_COMPRESSED_PRIME, UNCOMPRESSED};
}
Supported_Point_Formats::Supported_Point_Formats(TLS_Data_Reader& reader,