Lines Matching refs:kex

62 	struct kex *kex = ssh->kex;  in kexgex_client()  local
66 nbits = dh_estimate(kex->dh_need * 8); in kexgex_client()
68 kex->min = DH_GRP_MIN; in kexgex_client()
69 kex->max = DH_GRP_MAX; in kexgex_client()
70 kex->nbits = nbits; in kexgex_client()
72 kex->nbits = MINIMUM(kex->nbits, 4096); in kexgex_client()
75 (r = sshpkt_put_u32(ssh, kex->min)) != 0 || in kexgex_client()
76 (r = sshpkt_put_u32(ssh, kex->nbits)) != 0 || in kexgex_client()
77 (r = sshpkt_put_u32(ssh, kex->max)) != 0 || in kexgex_client()
81 kex->min, kex->nbits, kex->max); in kexgex_client()
84 kex->min, kex->nbits, kex->max); in kexgex_client()
97 struct kex *kex = ssh->kex; in input_kex_dh_gex_group() local
110 (u_int)bits < kex->min || (u_int)bits > kex->max) { in input_kex_dh_gex_group()
114 if ((kex->dh = dh_new_group(g, p)) == NULL) { in input_kex_dh_gex_group()
121 if ((r = dh_gen_key(kex->dh, kex->we_need * 8)) != 0) in input_kex_dh_gex_group()
123 DH_get0_key(kex->dh, &pub_key, NULL); in input_kex_dh_gex_group()
130 DHparams_print_fp(stderr, kex->dh); in input_kex_dh_gex_group()
147 struct kex *kex = ssh->kex; in input_kex_dh_gex_reply() local
181 if ((r = kex_dh_compute_key(kex, dh_server_pub, shared_secret)) != 0) in input_kex_dh_gex_reply()
184 kex->min = kex->max = -1; in input_kex_dh_gex_reply()
187 DH_get0_key(kex->dh, &pub_key, NULL); in input_kex_dh_gex_reply()
188 DH_get0_pqg(kex->dh, &dh_p, NULL, &dh_g); in input_kex_dh_gex_reply()
191 kex->hash_alg, in input_kex_dh_gex_reply()
192 kex->client_version, in input_kex_dh_gex_reply()
193 kex->server_version, in input_kex_dh_gex_reply()
194 kex->my, in input_kex_dh_gex_reply()
195 kex->peer, in input_kex_dh_gex_reply()
197 kex->min, kex->nbits, kex->max, in input_kex_dh_gex_reply()
206 hashlen, kex->hostkey_alg, ssh->compat, NULL)) != 0) in input_kex_dh_gex_reply()
214 if ((kex->flags & KEX_INITIAL) != 0) { in input_kex_dh_gex_reply()
215 if (kex->initial_hostkey != NULL || kex->initial_sig != NULL) { in input_kex_dh_gex_reply()
219 if ((kex->initial_sig = sshbuf_new()) == NULL) { in input_kex_dh_gex_reply()
223 if ((r = sshbuf_put(kex->initial_sig, signature, slen)) != 0) in input_kex_dh_gex_reply()
225 kex->initial_hostkey = server_host_key; in input_kex_dh_gex_reply()
231 DH_free(kex->dh); in input_kex_dh_gex_reply()
232 kex->dh = NULL; in input_kex_dh_gex_reply()