Lines Matching defs:kex

36 #include "kex.h"
101 struct kex *kex = ssh->kex;
104 switch (kex->kex_type) {
111 r = kex_dh_keypair(kex);
114 r = kex_ecdh_keypair(kex);
118 r = kex_c25519_keypair(kex);
121 r = kex_kem_sntrup761x25519_keypair(kex);
130 (r = sshpkt_put_stringb(ssh, kex->client_pub)) != 0 ||
141 struct kex *kex = ssh->kex;
175 switch (kex->kex_type) {
182 r = kex_dh_dec(kex, server_blob, &shared_secret);
185 r = kex_ecdh_dec(kex, server_blob, &shared_secret);
189 r = kex_c25519_dec(kex, server_blob, &shared_secret);
192 r = kex_kem_sntrup761x25519_dec(kex, server_blob,
205 kex->hash_alg,
206 kex->client_version,
207 kex->server_version,
208 kex->my,
209 kex->peer,
211 kex->client_pub,
218 kex->hostkey_alg, ssh->compat, NULL)) != 0)
226 if ((kex->flags & KEX_INITIAL) != 0) {
227 if (kex->initial_hostkey != NULL || kex->initial_sig != NULL) {
231 if ((kex->initial_sig = sshbuf_new()) == NULL) {
235 if ((r = sshbuf_put(kex->initial_sig, signature, slen)) != 0)
237 kex->initial_hostkey = server_host_key;
243 explicit_bzero(kex->c25519_client_key, sizeof(kex->c25519_client_key));
244 explicit_bzero(kex->sntrup761_client_key,
245 sizeof(kex->sntrup761_client_key));
252 sshbuf_free(kex->client_pub);
253 kex->client_pub = NULL;
268 struct kex *kex = ssh->kex;
290 switch (kex->kex_type) {
297 r = kex_dh_enc(kex, client_pubkey, &server_pubkey,
301 r = kex_ecdh_enc(kex, client_pubkey, &server_pubkey,
306 r = kex_c25519_enc(kex, client_pubkey, &server_pubkey,
310 r = kex_kem_sntrup761x25519_enc(kex, client_pubkey,
329 kex->hash_alg,
330 kex->client_version,
331 kex->server_version,
332 kex->peer,
333 kex->my,
342 if ((r = kex->sign(ssh, server_host_private, server_host_public,
343 &signature, &slen, hash, hashlen, kex->hostkey_alg)) != 0)
358 if (kex->initial_hostkey == NULL &&
360 &kex->initial_hostkey)) != 0)