aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/tls/msg_client_kex.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2016-02-07 05:10:18 -0500
committerJack Lloyd <[email protected]>2016-02-07 05:10:18 -0500
commit62a03ea81ab7a2fe8ff79275427f3353a75e3a4f (patch)
tree22134859fa408e5d1ea6d8d1d4a5198c665e48aa /src/lib/tls/msg_client_kex.cpp
parent0ed7333721b8205c2b4b281b6cd5c762754fbe7d (diff)
Make SRP6 support optional in TLS
Remove SRP_SHA from the default policy, since normal applications do not need it. Removes nullptr initializers of unique_ptrs in the Server_Key_Exchange constructor, that's the default unique_ptr already.
Diffstat (limited to 'src/lib/tls/msg_client_kex.cpp')
-rw-r--r--src/lib/tls/msg_client_kex.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/lib/tls/msg_client_kex.cpp b/src/lib/tls/msg_client_kex.cpp
index 68809f22f..4bec9f3be 100644
--- a/src/lib/tls/msg_client_kex.cpp
+++ b/src/lib/tls/msg_client_kex.cpp
@@ -10,14 +10,19 @@
#include <botan/internal/tls_extensions.h>
#include <botan/internal/tls_handshake_io.h>
#include <botan/credentials_manager.h>
+#include <botan/rng.h>
+#include <botan/loadstor.h>
+#include <botan/internal/ct_utils.h>
+
#include <botan/pubkey.h>
+
#include <botan/dh.h>
#include <botan/ecdh.h>
#include <botan/rsa.h>
+
+#if defined(BOTAN_HAS_SRP6)
#include <botan/srp6.h>
-#include <botan/rng.h>
-#include <botan/loadstor.h>
-#include <botan/internal/ct_utils.h>
+#endif
namespace Botan {
@@ -166,6 +171,7 @@ Client_Key_Exchange::Client_Key_Exchange(Handshake_IO& io,
append_tls_length_value(m_key_material, priv_key.public_value(), 1);
}
+#if defined(BOTAN_HAS_SRP6)
else if(kex_algo == "SRP_SHA")
{
const BigInt N = BigInt::decode(reader.get_range<byte>(2, 1, 65535));
@@ -193,6 +199,7 @@ Client_Key_Exchange::Client_Key_Exchange(Handshake_IO& io,
append_tls_length_value(m_key_material, BigInt::encode(srp_vals.first), 2);
m_pre_master = srp_vals.second.bits_of();
}
+#endif
else
{
throw Internal_Error("Client_Key_Exchange: Unknown kex " +
@@ -323,12 +330,14 @@ Client_Key_Exchange::Client_Key_Exchange(const std::vector<byte>& contents,
append_tls_length_value(m_pre_master, zeros, 2);
append_tls_length_value(m_pre_master, psk.bits_of(), 2);
}
+#if defined(BOTAN_HAS_SRP6)
else if(kex_algo == "SRP_SHA")
{
SRP6_Server_Session& srp = state.server_kex()->server_srp_params();
m_pre_master = srp.step2(BigInt::decode(reader.get_range<byte>(2, 0, 65535))).bits_of();
}
+#endif
else if(kex_algo == "DH" || kex_algo == "DHE_PSK" ||
kex_algo == "ECDH" || kex_algo == "ECDHE_PSK")
{