summaryrefslogtreecommitdiffhomepage
path: root/svr-kex.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2013-11-07 23:49:37 +0800
committerMatt Johnston <matt@ucc.asn.au>2013-11-07 23:49:37 +0800
commit58fe1c2d2a48cd51e1bafeee8e1e20f7201f31df (patch)
treee82591920439b124a0947b7d6dbb351bfbe8c053 /svr-kex.c
parent4363b8b32deb69b30b756a34a720e67d1c3708fe (diff)
Add '-R' for delayed hostkey option
--HG-- branch : keyondemand
Diffstat (limited to 'svr-kex.c')
-rw-r--r--svr-kex.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/svr-kex.c b/svr-kex.c
index 3d131a1..ca87875 100644
--- a/svr-kex.c
+++ b/svr-kex.c
@@ -77,6 +77,7 @@ void recv_msg_kexdh_init() {
TRACE(("leave recv_msg_kexdh_init"))
}
+#ifdef DROPBEAR_DELAY_HOSTKEY
static void svr_ensure_hostkey() {
const char* fn = NULL;
@@ -141,7 +142,7 @@ out:
if (ret == DROPBEAR_FAILURE)
{
- dropbear_exit("Couldn't read or generate hostkey");
+ dropbear_exit("Couldn't read or generate hostkey %s", fn);
}
// directory for keys.
@@ -152,6 +153,7 @@ out:
// atomic rename, done.
}
+#endif
/* Generate our side of the diffie-hellman key exchange value (dh_f), and
* calculate the session key using the diffie-hellman algorithm. Following
@@ -165,8 +167,13 @@ static void send_msg_kexdh_reply(mp_int *dh_e, buffer *ecdh_qs) {
/* we can start creating the kexdh_reply packet */
CHECKCLEARTOWRITE();
-
- svr_ensure_hostkey();
+
+#ifdef DROPBEAR_DELAY_HOSTKEY
+ if (svr_opts.delay_hostkey)
+ {
+ svr_ensure_hostkey();
+ }
+#endif
buf_putbyte(ses.writepayload, SSH_MSG_KEXDH_REPLY);
buf_put_pub_key(ses.writepayload, svr_opts.hostkey,