Lines Matching defs:kex
33 #include "kex.h"
98 struct kex *kex = ssh->kex;
101 switch (kex->kex_type) {
108 r = kex_dh_keypair(kex);
111 r = kex_ecdh_keypair(kex);
115 r = kex_c25519_keypair(kex);
118 r = kex_kem_sntrup761x25519_keypair(kex);
121 r = kex_kem_mlkem768x25519_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,
196 r = kex_kem_mlkem768x25519_dec(kex, server_blob,
209 kex->hash_alg,
210 kex->client_version,
211 kex->server_version,
212 kex->my,
213 kex->peer,
215 kex->client_pub,
222 kex->hostkey_alg, ssh->compat, NULL)) != 0)
230 if ((kex->flags & KEX_INITIAL) != 0) {
231 if (kex->initial_hostkey != NULL || kex->initial_sig != NULL) {
235 if ((kex->initial_sig = sshbuf_new()) == NULL) {
239 if ((r = sshbuf_put(kex->initial_sig, signature, slen)) != 0)
241 kex->initial_hostkey = server_host_key;
247 explicit_bzero(kex->c25519_client_key, sizeof(kex->c25519_client_key));
248 explicit_bzero(kex->sntrup761_client_key,
249 sizeof(kex->sntrup761_client_key));
250 explicit_bzero(kex->mlkem768_client_key,
251 sizeof(kex->mlkem768_client_key));
258 sshbuf_free(kex->client_pub);
259 kex->client_pub = NULL;
274 struct kex *kex = ssh->kex;
296 switch (kex->kex_type) {
303 r = kex_dh_enc(kex, client_pubkey, &server_pubkey,
307 r = kex_ecdh_enc(kex, client_pubkey, &server_pubkey,
312 r = kex_c25519_enc(kex, client_pubkey, &server_pubkey,
316 r = kex_kem_sntrup761x25519_enc(kex, client_pubkey,
320 r = kex_kem_mlkem768x25519_enc(kex, client_pubkey,
339 kex->hash_alg,
340 kex->client_version,
341 kex->server_version,
342 kex->peer,
343 kex->my,
352 if ((r = kex->sign(ssh, server_host_private, server_host_public,
353 &signature, &slen, hash, hashlen, kex->hostkey_alg)) != 0)
368 if (kex->initial_hostkey == NULL &&
370 &kex->initial_hostkey)) != 0)