aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlloyd <[email protected]>2012-01-24 14:43:57 +0000
committerlloyd <[email protected]>2012-01-24 14:43:57 +0000
commitd0d097337d652e2205d88e0037725d4aac05eab3 (patch)
treef0e5a7586e1a743cb4a3998663c73b4223eb8e48
parent08488b226aa815864ba1ccd3b7e48f76cfd3baba (diff)
Forgot to check in server side ECDH key gen
-rw-r--r--src/tls/tls_server.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/tls/tls_server.cpp b/src/tls/tls_server.cpp
index b38a010dd..47c62a96a 100644
--- a/src/tls/tls_server.cpp
+++ b/src/tls/tls_server.cpp
@@ -10,6 +10,7 @@
#include <botan/internal/tls_messages.h>
#include <botan/internal/stl_util.h>
#include <botan/dh.h>
+#include <botan/ecdh.h>
namespace Botan {
@@ -256,13 +257,20 @@ void Server::process_handshake_msg(Handshake_Type type,
server_certs);
}
- if(state->suite.kex_algo() != "")
+ const std::string kex_algo = state->suite.kex_algo();
+
+ if(kex_algo != "")
{
- if(state->suite.kex_algo() == "DH")
+ if(kex_algo == "DH")
state->kex_priv = new DH_PrivateKey(rng, policy.dh_group());
+ else if(kex_algo == "ECDH")
+ {
+ EC_Group ec_group("secp256r1"); // FIXME, use client known groups
+ state->kex_priv = new ECDH_PrivateKey(rng, ec_group);
+ }
else
throw Internal_Error("Server: Unknown ciphersuite kex type " +
- state->suite.kex_algo());
+ kex_algo);
state->server_kex =
new Server_Key_Exchange(writer, state, rng, private_key);