Lines Matching refs:kex

43 #include "kex.h"
73 struct kex *kex = ssh->kex;
83 kex->nbits = nbits;
84 kex->min = min;
85 kex->max = max;
91 if (kex->max < kex->min || kex->nbits < kex->min ||
92 kex->max < kex->nbits) {
98 kex->dh = PRIVSEP(choose_dh(min, nbits, max));
99 if (kex->dh == NULL) {
106 (r = sshpkt_put_bignum2(ssh, kex->dh->p)) != 0 ||
107 (r = sshpkt_put_bignum2(ssh, kex->dh->g)) != 0 ||
112 if ((r = dh_gen_key(kex->dh, kex->we_need * 8)) != 0)
126 struct kex *kex = ssh->kex;
135 if (kex->load_host_public_key == NULL ||
136 kex->load_host_private_key == NULL) {
140 server_host_public = kex->load_host_public_key(kex->hostkey_type,
141 kex->hostkey_nid, ssh);
142 server_host_private = kex->load_host_private_key(kex->hostkey_type,
143 kex->hostkey_nid, ssh);
166 DHparams_print_fp(stderr, kex->dh);
168 BN_print_fp(stderr, kex->dh->pub_key);
171 if (!dh_pub_is_valid(kex->dh, dh_client_pub)) {
177 klen = DH_size(kex->dh);
183 if ((kout = DH_compute_key(kbuf, dh_client_pub, kex->dh)) < 0 ||
197 kex->hash_alg,
198 kex->client_version_string,
199 kex->server_version_string,
200 sshbuf_ptr(kex->peer), sshbuf_len(kex->peer),
201 sshbuf_ptr(kex->my), sshbuf_len(kex->my),
203 kex->min, kex->nbits, kex->max,
204 kex->dh->p, kex->dh->g,
206 kex->dh->pub_key,
212 if (kex->session_id == NULL) {
213 kex->session_id_len = hashlen;
214 kex->session_id = malloc(kex->session_id_len);
215 if (kex->session_id == NULL) {
219 memcpy(kex->session_id, hash, kex->session_id_len);
223 if ((r = kex->sign(server_host_private, server_host_public, &signature,
224 &slen, hash, hashlen, kex->hostkey_alg, ssh->compat)) < 0)
232 (r = sshpkt_put_bignum2(ssh, kex->dh->pub_key)) != 0 || /* f */
240 DH_free(kex->dh);
241 kex->dh = NULL;