Lines Matching refs:kex
57 struct kex *kex = ssh->kex; in kexdh_client() local
61 switch (kex->kex_type) { in kexdh_client()
63 kex->dh = dh_new_group1(); in kexdh_client()
67 kex->dh = dh_new_group14(); in kexdh_client()
70 kex->dh = dh_new_group16(); in kexdh_client()
73 kex->dh = dh_new_group18(); in kexdh_client()
79 if (kex->dh == NULL) { in kexdh_client()
84 if ((r = dh_gen_key(kex->dh, kex->we_need * 8)) != 0 || in kexdh_client()
86 (r = sshpkt_put_bignum2(ssh, kex->dh->pub_key)) != 0 || in kexdh_client()
90 DHparams_print_fp(stderr, kex->dh); in kexdh_client()
92 BN_print_fp(stderr, kex->dh->pub_key); in kexdh_client()
106 struct kex *kex = ssh->kex; in input_kex_dh() local
114 if (kex->verify_host_key == NULL) { in input_kex_dh()
124 if (server_host_key->type != kex->hostkey_type || in input_kex_dh()
125 (kex->hostkey_type == KEY_ECDSA && in input_kex_dh()
126 server_host_key->ecdsa_nid != kex->hostkey_nid)) { in input_kex_dh()
130 if (kex->verify_host_key(server_host_key, ssh) == -1) { in input_kex_dh()
150 if (!dh_pub_is_valid(kex->dh, dh_server_pub)) { in input_kex_dh()
156 klen = DH_size(kex->dh); in input_kex_dh()
162 if ((kout = DH_compute_key(kbuf, dh_server_pub, kex->dh)) < 0 || in input_kex_dh()
174 kex->hash_alg, in input_kex_dh()
175 kex->client_version_string, in input_kex_dh()
176 kex->server_version_string, in input_kex_dh()
177 sshbuf_ptr(kex->my), sshbuf_len(kex->my), in input_kex_dh()
178 sshbuf_ptr(kex->peer), sshbuf_len(kex->peer), in input_kex_dh()
180 kex->dh->pub_key, in input_kex_dh()
191 if (kex->session_id == NULL) { in input_kex_dh()
192 kex->session_id_len = hashlen; in input_kex_dh()
193 kex->session_id = malloc(kex->session_id_len); in input_kex_dh()
194 if (kex->session_id == NULL) { in input_kex_dh()
198 memcpy(kex->session_id, hash, kex->session_id_len); in input_kex_dh()
205 DH_free(kex->dh); in input_kex_dh()
206 kex->dh = NULL; in input_kex_dh()