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