diff options
author | Matt Johnston <matt@ucc.asn.au> | 2020-05-24 14:16:58 +0800 |
---|---|---|
committer | Matt Johnston <matt@ucc.asn.au> | 2020-05-24 14:16:58 +0800 |
commit | 701d43b8594365b55421e8bc4c53efa920c09ed5 (patch) | |
tree | aceb60a25d26b8d5f3b132df40e59c9218f8b66e /svr-kex.c | |
parent | 79bedc90a1efc9ba0b2c6565bd5264a7817e68d4 (diff) |
send and handle SSH_MSG_EXT_INFO only at the correct point
- other fixes for rsa pubkey auth
- only include ext-info handling when rsa pubkey auth is compiled
Diffstat (limited to 'svr-kex.c')
-rw-r--r-- | svr-kex.c | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -38,13 +38,15 @@ #include "gensignkey.h" static void send_msg_kexdh_reply(mp_int *dh_e, buffer *ecdh_qs); +#if DROPBEAR_EXT_INFO +static void send_msg_ext_info(void); +#endif /* Handle a diffie-hellman key exchange initialisation. This involves * calculating a session key reply value, and corresponding hash. These * are carried out by send_msg_kexdh_reply(). recv_msg_kexdh_init() calls * that function, then brings the new keys into use */ void recv_msg_kexdh_init() { - DEF_MP_INT(dh_e); buffer *ecdh_qs = NULL; @@ -87,9 +89,12 @@ void recv_msg_kexdh_init() { send_msg_newkeys(); - if (ses.allow_ext_info) { +#if DROPBEAR_EXT_INFO + /* Only send it following the first newkeys */ + if (!ses.kexstate.donesecondkex && ses.allow_ext_info) { send_msg_ext_info(); } +#endif ses.requirenext = SSH_MSG_NEWKEYS; TRACE(("leave recv_msg_kexdh_init")) @@ -247,8 +252,9 @@ static void send_msg_kexdh_reply(mp_int *dh_e, buffer *ecdh_qs) { TRACE(("leave send_msg_kexdh_reply")) } +#if DROPBEAR_EXT_INFO /* Only used for server-sig-algs on the server side */ -void send_msg_ext_info(void) { +static void send_msg_ext_info(void) { TRACE(("enter send_msg_ext_info")) buf_putbyte(ses.writepayload, SSH_MSG_EXT_INFO); @@ -261,5 +267,5 @@ void send_msg_ext_info(void) { encrypt_packet(); TRACE(("leave send_msg_ext_info")) - } +#endif |