Lines Matching refs:kex

44 #include "kex.h"
60 struct kex *kex = ssh->kex;
64 nbits = dh_estimate(kex->dh_need * 8);
66 kex->min = DH_GRP_MIN;
67 kex->max = DH_GRP_MAX;
68 kex->nbits = nbits;
70 kex->nbits = MIN(kex->nbits, 4096);
73 (r = sshpkt_put_u32(ssh, kex->min)) != 0 ||
74 (r = sshpkt_put_u32(ssh, kex->nbits)) != 0 ||
75 (r = sshpkt_put_u32(ssh, kex->max)) != 0 ||
79 kex->min, kex->nbits, kex->max);
82 kex->min, kex->nbits, kex->max);
95 struct kex *kex = ssh->kex;
111 (u_int)bits < kex->min || (u_int)bits > kex->max) {
115 if ((kex->dh = dh_new_group(g, p)) == NULL) {
119 p = g = NULL; /* belong to kex->dh now */
122 if ((r = dh_gen_key(kex->dh, kex->we_need * 8)) != 0 ||
124 (r = sshpkt_put_bignum2(ssh, kex->dh->pub_key)) != 0 ||
129 DHparams_print_fp(stderr, kex->dh);
131 BN_print_fp(stderr, kex->dh->pub_key);
149 struct kex *kex = ssh->kex;
158 if (kex->verify_host_key == NULL) {
168 if (server_host_key->type != kex->hostkey_type) {
172 if (server_host_key->type != kex->hostkey_type ||
173 (kex->hostkey_type == KEY_ECDSA &&
174 server_host_key->ecdsa_nid != kex->hostkey_nid)) {
178 if (kex->verify_host_key(server_host_key, ssh) == -1) {
198 if (!dh_pub_is_valid(kex->dh, dh_server_pub)) {
204 klen = DH_size(kex->dh);
210 if ((kout = DH_compute_key(kbuf, dh_server_pub, kex->dh)) < 0 ||
219 kex->min = kex->max = -1;
224 kex->hash_alg,
225 kex->client_version_string,
226 kex->server_version_string,
227 sshbuf_ptr(kex->my), sshbuf_len(kex->my),
228 sshbuf_ptr(kex->peer), sshbuf_len(kex->peer),
230 kex->min, kex->nbits, kex->max,
231 kex->dh->p, kex->dh->g,
232 kex->dh->pub_key,
243 if (kex->session_id == NULL) {
244 kex->session_id_len = hashlen;
245 kex->session_id = malloc(kex->session_id_len);
246 if (kex->session_id == NULL) {
250 memcpy(kex->session_id, hash, kex->session_id_len);
257 DH_free(kex->dh);
258 kex->dh = NULL;