comparison common-kex.c @ 1674:ba6fc7afe1c5

use sigtype where appropriate
author Matt Johnston <matt@ucc.asn.au>
date Mon, 06 Apr 2020 23:18:26 +0800
parents d32bcb5c557d
children d5cdc60db08e
comparison
equal deleted inserted replaced
1668:49cb3cf4bd6f 1674:ba6fc7afe1c5
109 109
110 ses.newkeys = (struct key_context*)m_malloc(sizeof(struct key_context)); 110 ses.newkeys = (struct key_context*)m_malloc(sizeof(struct key_context));
111 111
112 if (ses.send_kex_first_guess) { 112 if (ses.send_kex_first_guess) {
113 ses.newkeys->algo_kex = sshkex[0].data; 113 ses.newkeys->algo_kex = sshkex[0].data;
114 ses.newkeys->algo_hostkey = sshhostkey[0].val; 114 ses.newkeys->algo_signature = sshhostkey[0].val;
115 ses.newkeys->algo_hostkey = signkey_type_from_signature(ses.newkeys->algo_signature);
115 ses.send_kex_first_guess(); 116 ses.send_kex_first_guess();
116 } 117 }
117 118
118 TRACE(("DATAALLOWED=0")) 119 TRACE(("DATAALLOWED=0"))
119 TRACE(("-> KEXINIT")) 120 TRACE(("-> KEXINIT"))
150 if (ses.kexstate.sentnewkeys && ses.kexstate.recvnewkeys) 151 if (ses.kexstate.sentnewkeys && ses.kexstate.recvnewkeys)
151 { 152 {
152 TRACE(("switch_keys done")) 153 TRACE(("switch_keys done"))
153 ses.keys->algo_kex = ses.newkeys->algo_kex; 154 ses.keys->algo_kex = ses.newkeys->algo_kex;
154 ses.keys->algo_hostkey = ses.newkeys->algo_hostkey; 155 ses.keys->algo_hostkey = ses.newkeys->algo_hostkey;
156 ses.keys->algo_signature = ses.newkeys->algo_signature;
155 ses.keys->allow_compress = 0; 157 ses.keys->allow_compress = 0;
156 m_free(ses.newkeys); 158 m_free(ses.newkeys);
157 ses.newkeys = NULL; 159 ses.newkeys = NULL;
158 kexinitialise(); 160 kexinitialise();
159 } 161 }
845 allgood &= goodguess; 847 allgood &= goodguess;
846 if (algo == NULL) { 848 if (algo == NULL) {
847 erralgo = "hostkey"; 849 erralgo = "hostkey";
848 goto error; 850 goto error;
849 } 851 }
850 TRACE(("hostkey algo %s", algo->name)) 852 TRACE(("signature algo %s", algo->name))
851 ses.newkeys->algo_hostkey = algo->val; 853 ses.newkeys->algo_signature = algo->val;
854 ses.newkeys->algo_hostkey = signkey_type_from_signature(ses.newkeys->algo_signature);
852 855
853 /* encryption_algorithms_client_to_server */ 856 /* encryption_algorithms_client_to_server */
854 c2s_cipher_algo = buf_match_algo(ses.payload, sshciphers, NULL, NULL); 857 c2s_cipher_algo = buf_match_algo(ses.payload, sshciphers, NULL, NULL);
855 if (c2s_cipher_algo == NULL) { 858 if (c2s_cipher_algo == NULL) {
856 erralgo = "enc c->s"; 859 erralgo = "enc c->s";