summaryrefslogtreecommitdiffhomepage
path: root/cli-kex.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2016-05-02 23:48:16 +0200
committerMatt Johnston <matt@ucc.asn.au>2016-05-02 23:48:16 +0200
commitd6daad29fcfc20295473bf7e6a96f3016282e9e6 (patch)
tree5ac3e533fca2a1141509e16de6f73e2905e45e23 /cli-kex.c
parent4664ce2c35e69ff79949eff178be1720bf288ddc (diff)
options for disabling "normal" DH
Diffstat (limited to 'cli-kex.c')
-rw-r--r--cli-kex.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/cli-kex.c b/cli-kex.c
index 936b95c..8f8fb2a 100644
--- a/cli-kex.c
+++ b/cli-kex.c
@@ -48,6 +48,7 @@ void send_msg_kexdh_init() {
CHECKCLEARTOWRITE();
buf_putbyte(ses.writepayload, SSH_MSG_KEXDH_INIT);
switch (ses.newkeys->algo_kex->mode) {
+#if DROPBEAR_NORMAL_DH
case DROPBEAR_KEX_NORMAL_DH:
if (ses.newkeys->algo_kex != cli_ses.param_kex_algo
|| !cli_ses.dh_param) {
@@ -58,8 +59,9 @@ void send_msg_kexdh_init() {
}
buf_putmpint(ses.writepayload, &cli_ses.dh_param->pub);
break;
- case DROPBEAR_KEX_ECDH:
+#endif
#ifdef DROPBEAR_ECDH
+ case DROPBEAR_KEX_ECDH:
if (ses.newkeys->algo_kex != cli_ses.param_kex_algo
|| !cli_ses.ecdh_param) {
if (cli_ses.ecdh_param) {
@@ -68,8 +70,8 @@ void send_msg_kexdh_init() {
cli_ses.ecdh_param = gen_kexecdh_param();
}
buf_put_ecc_raw_pubkey_string(ses.writepayload, &cli_ses.ecdh_param->key);
-#endif
break;
+#endif
#ifdef DROPBEAR_CURVE25519
case DROPBEAR_KEX_CURVE25519:
if (ses.newkeys->algo_kex != cli_ses.param_kex_algo
@@ -80,8 +82,8 @@ void send_msg_kexdh_init() {
cli_ses.curve25519_param = gen_kexcurve25519_param();
}
buf_putstring(ses.writepayload, (const char*)cli_ses.curve25519_param->pub, CURVE25519_LEN);
-#endif
break;
+#endif
}
cli_ses.param_kex_algo = ses.newkeys->algo_kex;
@@ -118,6 +120,7 @@ void recv_msg_kexdh_reply() {
}
switch (ses.newkeys->algo_kex->mode) {
+#if DROPBEAR_NORMAL_DH
case DROPBEAR_KEX_NORMAL_DH:
{
DEF_MP_INT(dh_f);
@@ -131,15 +134,16 @@ void recv_msg_kexdh_reply() {
mp_clear(&dh_f);
}
break;
- case DROPBEAR_KEX_ECDH:
+#endif
#ifdef DROPBEAR_ECDH
+ case DROPBEAR_KEX_ECDH:
{
buffer *ecdh_qs = buf_getstringbuf(ses.payload);
kexecdh_comb_key(cli_ses.ecdh_param, ecdh_qs, hostkey);
buf_free(ecdh_qs);
}
-#endif
break;
+#endif
#ifdef DROPBEAR_CURVE25519
case DROPBEAR_KEX_CURVE25519:
{
@@ -147,8 +151,8 @@ void recv_msg_kexdh_reply() {
kexcurve25519_comb_key(cli_ses.curve25519_param, ecdh_qs, hostkey);
buf_free(ecdh_qs);
}
-#endif
break;
+#endif
}
if (cli_ses.dh_param) {