comparison cli-kex.c @ 739:d44325108d0e kexguess

first_kex_packet_follows working, needs tidying
author Matt Johnston <matt@ucc.asn.au>
date Fri, 29 Mar 2013 20:44:13 +0800
parents 0fd32a552ea5
children 09c5eb71ec96
comparison
equal deleted inserted replaced
725:49f68a7b7a55 739:d44325108d0e
40 40
41 static void checkhostkey(unsigned char* keyblob, unsigned int keybloblen); 41 static void checkhostkey(unsigned char* keyblob, unsigned int keybloblen);
42 #define MAX_KNOWNHOSTS_LINE 4500 42 #define MAX_KNOWNHOSTS_LINE 4500
43 43
44 void send_msg_kexdh_init() { 44 void send_msg_kexdh_init() {
45 45 TRACE(("send_msg_kexdh_init()"))
46 cli_ses.dh_e = (mp_int*)m_malloc(sizeof(mp_int)); 46 cli_ses.dh_e = (mp_int*)m_malloc(sizeof(mp_int));
47 cli_ses.dh_x = (mp_int*)m_malloc(sizeof(mp_int)); 47 cli_ses.dh_x = (mp_int*)m_malloc(sizeof(mp_int));
48 m_mp_init_multi(cli_ses.dh_e, cli_ses.dh_x, NULL); 48 m_mp_init_multi(cli_ses.dh_e, cli_ses.dh_x, NULL);
49 49
50 gen_kexdh_vals(cli_ses.dh_e, cli_ses.dh_x); 50 gen_kexdh_vals(cli_ses.dh_e, cli_ses.dh_x);
51 51
52 CHECKCLEARTOWRITE(); 52 CHECKCLEARTOWRITE();
53 buf_putbyte(ses.writepayload, SSH_MSG_KEXDH_INIT); 53 buf_putbyte(ses.writepayload, SSH_MSG_KEXDH_INIT);
54 buf_putmpint(ses.writepayload, cli_ses.dh_e); 54 buf_putmpint(ses.writepayload, cli_ses.dh_e);
55 encrypt_packet(); 55 encrypt_packet();
56 ses.requirenext = SSH_MSG_KEXDH_REPLY; 56 // XXX fixme
57 //ses.requirenext = SSH_MSG_KEXDH_REPLY;
57 } 58 }
58 59
59 /* Handle a diffie-hellman key exchange reply. */ 60 /* Handle a diffie-hellman key exchange reply. */
60 void recv_msg_kexdh_reply() { 61 void recv_msg_kexdh_reply() {
61 62