crypto/libressl/ssl/ssl_clnt.c
2031
CBB cbb, kex;
crypto/libressl/ssl/ssl_clnt.c
2038
if (!ssl3_handshake_msg_start(s, &cbb, &kex,
crypto/libressl/ssl/ssl_clnt.c
2043
if (!ssl3_send_client_kex_rsa(s, &kex))
crypto/libressl/ssl/ssl_clnt.c
2046
if (!ssl3_send_client_kex_dhe(s, &kex))
crypto/libressl/ssl/ssl_clnt.c
2049
if (!ssl3_send_client_kex_ecdhe(s, &kex))
crypto/libressl/ssl/ssl_clnt.c
2052
if (!ssl3_send_client_kex_gost(s, &kex))
crypto/openssh/auth2-gss.c
304
"gssapi-with-mic", ssh->kex->session_id);
crypto/openssh/auth2-hostbased.c
130
if ((r = sshbuf_put_stringb(b, ssh->kex->session_id)) != 0 ||
crypto/openssh/auth2-pubkey.c
115
if (ssh->kex->initial_hostkey == NULL)
crypto/openssh/auth2-pubkey.c
117
if (!sshkey_equal(hostkey, ssh->kex->initial_hostkey))
crypto/openssh/auth2-pubkey.c
192
if ((r = sshbuf_putb(b, ssh->kex->session_id)) != 0)
crypto/openssh/auth2-pubkey.c
196
ssh->kex->session_id)) != 0)
crypto/openssh/auth2-pubkey.c
216
(r = sshkey_puts(ssh->kex->initial_hostkey, b)) != 0)
crypto/openssh/auth2.c
176
if (ssh->kex->ext_info_c)
crypto/openssh/clientloop.c
1828
if ((r = ssh_agent_bind_hostkey(sock, ssh->kex->initial_hostkey,
crypto/openssh/clientloop.c
1829
ssh->kex->session_id, ssh->kex->initial_sig, 1)) == 0)
crypto/openssh/clientloop.c
2350
ssh->kex->hostkey_alg)) == KEY_RSA)
crypto/openssh/clientloop.c
2351
rsa_kexalg = ssh->kex->hostkey_alg;
crypto/openssh/clientloop.c
2368
ssh->kex->session_id)) != 0 ||
crypto/openssh/clientloop.c
519
if (ssh->kex == NULL || (ssh->kex->flags & KEX_HAS_PING) == 0)
crypto/openssh/kex.c
1001
kex->newkeys[mode] = newkeys;
crypto/openssh/kex.c
1002
ctos = (!kex->server && mode == MODE_OUT) ||
crypto/openssh/kex.c
1003
(kex->server && mode == MODE_IN);
crypto/openssh/kex.c
1009
kex->failed_choice = peer[nenc];
crypto/openssh/kex.c
1018
kex->failed_choice = peer[nmac];
crypto/openssh/kex.c
1024
kex->failed_choice = peer[ncomp];
crypto/openssh/kex.c
1036
newkeys = kex->newkeys[mode];
crypto/openssh/kex.c
1047
kex->we_need = need;
crypto/openssh/kex.c
1048
kex->dh_need = dh_need;
crypto/openssh/kex.c
1064
struct kex *kex = ssh->kex;
crypto/openssh/kex.c
107
if ((cp = kex_names_cat(kexalgos, ssh->kex->server ?
crypto/openssh/kex.c
1072
if ((mdsz = ssh_digest_bytes(kex->hash_alg)) == 0)
crypto/openssh/kex.c
1080
if ((hashctx = ssh_digest_start(kex->hash_alg)) == NULL ||
crypto/openssh/kex.c
1084
ssh_digest_update_buffer(hashctx, kex->session_id) != 0 ||
crypto/openssh/kex.c
1099
if ((hashctx = ssh_digest_start(kex->hash_alg)) == NULL ||
crypto/openssh/kex.c
1129
struct kex *kex = ssh->kex;
crypto/openssh/kex.c
1135
if ((kex->flags & KEX_INITIAL) != 0) {
crypto/openssh/kex.c
1136
if (sshbuf_len(kex->session_id) != 0) {
crypto/openssh/kex.c
1140
if ((r = sshbuf_put(kex->session_id, hash, hashlen)) != 0)
crypto/openssh/kex.c
1142
} else if (sshbuf_len(kex->session_id) == 0) {
crypto/openssh/kex.c
1147
if ((r = derive_key(ssh, 'A'+i, kex->we_need, hash, hashlen,
crypto/openssh/kex.c
1155
ctos = (!kex->server && mode == MODE_OUT) ||
crypto/openssh/kex.c
1156
(kex->server && mode == MODE_IN);
crypto/openssh/kex.c
1157
kex->newkeys[mode]->enc.iv = keys[ctos ? 0 : 1];
crypto/openssh/kex.c
1158
kex->newkeys[mode]->enc.key = keys[ctos ? 2 : 3];
crypto/openssh/kex.c
1159
kex->newkeys[mode]->mac.key = keys[ctos ? 4 : 5];
crypto/openssh/kex.c
1167
struct kex *kex = ssh->kex;
crypto/openssh/kex.c
1171
if (kex->load_host_public_key == NULL ||
crypto/openssh/kex.c
1172
kex->load_host_private_key == NULL) {
crypto/openssh/kex.c
1176
*pubp = kex->load_host_public_key(kex->hostkey_type,
crypto/openssh/kex.c
1177
kex->hostkey_nid, ssh);
crypto/openssh/kex.c
1178
*prvp = kex->load_host_private_key(kex->hostkey_type,
crypto/openssh/kex.c
1179
kex->hostkey_nid, ssh);
crypto/openssh/kex.c
1188
struct kex *kex = ssh->kex;
crypto/openssh/kex.c
1190
if (kex->verify_host_key == NULL) {
crypto/openssh/kex.c
1194
if (server_host_key->type != kex->hostkey_type ||
crypto/openssh/kex.c
1195
(kex->hostkey_type == KEY_ECDSA &&
crypto/openssh/kex.c
1196
server_host_key->ecdsa_nid != kex->hostkey_nid))
crypto/openssh/kex.c
1198
if (kex->verify_host_key(server_host_key, ssh) == -1)
crypto/openssh/kex.c
1221
if (!ssh->kex->server)
crypto/openssh/kex.c
1244
struct sshbuf *our_version = ssh->kex->server ?
crypto/openssh/kex.c
1245
ssh->kex->server_version : ssh->kex->client_version;
crypto/openssh/kex.c
1246
struct sshbuf *peer_version = ssh->kex->server ?
crypto/openssh/kex.c
1247
ssh->kex->client_version : ssh->kex->server_version;
crypto/openssh/kex.c
1360
if (ssh->kex->server) {
crypto/openssh/kex.c
1416
if (ssh->kex->server && (ssh->compat & SSH_BUG_PROBE) != 0) {
crypto/openssh/kex.c
1423
if (ssh->kex->server && (ssh->compat & SSH_BUG_SCANNER) != 0) {
crypto/openssh/kex.c
241
if ((ssh->kex->flags & KEX_INITIAL) && ssh->kex->kex_strict) {
crypto/openssh/kex.c
276
free(ssh->kex->server_sig_algs);
crypto/openssh/kex.c
277
ssh->kex->server_sig_algs = NULL;
crypto/openssh/kex.c
285
if (ssh->kex->server_sig_algs != NULL &&
crypto/openssh/kex.c
286
kex_has_any_alg(sigalg, ssh->kex->server_sig_algs))
crypto/openssh/kex.c
288
xextendf(&ssh->kex->server_sig_algs, ",", "%s", sigalg);
crypto/openssh/kex.c
292
if (ssh->kex->server_sig_algs == NULL)
crypto/openssh/kex.c
293
ssh->kex->server_sig_algs = xstrdup("");
crypto/openssh/kex.c
301
if (ssh->kex->server_sig_algs == NULL &&
crypto/openssh/kex.c
302
(ssh->kex->server_sig_algs = sshkey_alg_list(0, 1, 1, ',')) == NULL)
crypto/openssh/kex.c
306
(r = sshbuf_put_cstring(m, ssh->kex->server_sig_algs)) != 0 ||
crypto/openssh/kex.c
341
if ((ssh->kex->flags & KEX_INITIAL) == 0)
crypto/openssh/kex.c
343
if (!ssh->kex->ext_info_c && !ssh->kex->ext_info_s)
crypto/openssh/kex.c
349
if (ssh->kex->ext_info_c &&
crypto/openssh/kex.c
352
if (ssh->kex->ext_info_s &&
crypto/openssh/kex.c
377
if ((ssh->kex->flags & KEX_HAS_EXT_INFO_IN_AUTH) == 0)
crypto/openssh/kex.c
384
(r = sshpkt_put_cstring(ssh, ssh->kex->server_sig_algs)) != 0 ||
crypto/openssh/kex.c
411
kex_ext_info_check_ver(struct kex *kex, const char *name,
crypto/openssh/kex.c
420
kex->flags |= flag;
crypto/openssh/kex.c
440
free(ssh->kex->server_sig_algs);
crypto/openssh/kex.c
441
ssh->kex->server_sig_algs = xstrdup((const char *)value);
crypto/openssh/kex.c
442
} else if (ssh->kex->ext_info_received == 1 &&
crypto/openssh/kex.c
444
if ((r = kex_ext_info_check_ver(ssh->kex, name, value, vlen,
crypto/openssh/kex.c
448
} else if (ssh->kex->ext_info_received == 1 &&
crypto/openssh/kex.c
450
if ((r = kex_ext_info_check_ver(ssh->kex, name, value, vlen,
crypto/openssh/kex.c
467
if ((r = kex_ext_info_check_ver(ssh->kex, name, value, vlen,
crypto/openssh/kex.c
479
struct kex *kex = ssh->kex;
crypto/openssh/kex.c
480
const int max_ext_info = kex->server ? 1 : 2;
crypto/openssh/kex.c
488
if (++kex->ext_info_received > max_ext_info) {
crypto/openssh/kex.c
508
if (kex->server) {
crypto/openssh/kex.c
526
struct kex *kex = ssh->kex;
crypto/openssh/kex.c
527
int r, initial = (kex->flags & KEX_INITIAL) != 0;
crypto/openssh/kex.c
531
if (kex->ext_info_c && initial)
crypto/openssh/kex.c
541
if ((r = kex_buf2prop(kex->my, NULL, &prop)) != 0)
crypto/openssh/kex.c
544
kex->server ?
crypto/openssh/kex.c
552
if ((r = kex_prop2buf(ssh->kex->my, prop)) != 0) {
crypto/openssh/kex.c
562
kex->done = 1;
crypto/openssh/kex.c
563
kex->flags &= ~KEX_INITIAL;
crypto/openssh/kex.c
564
sshbuf_reset(kex->peer);
crypto/openssh/kex.c
565
kex->flags &= ~KEX_INIT_SENT;
crypto/openssh/kex.c
566
free(kex->name);
crypto/openssh/kex.c
567
kex->name = NULL;
crypto/openssh/kex.c
575
struct kex *kex = ssh->kex;
crypto/openssh/kex.c
578
if (kex == NULL) {
crypto/openssh/kex.c
582
if (kex->flags & KEX_INIT_SENT)
crypto/openssh/kex.c
584
kex->done = 0;
crypto/openssh/kex.c
587
if (sshbuf_len(kex->my) < KEX_COOKIE_LEN) {
crypto/openssh/kex.c
589
sshbuf_len(kex->my), KEX_COOKIE_LEN);
crypto/openssh/kex.c
592
if ((cookie = sshbuf_mutable_ptr(kex->my)) == NULL) {
crypto/openssh/kex.c
599
(r = sshpkt_putb(ssh, kex->my)) != 0 ||
crypto/openssh/kex.c
605
kex->flags |= KEX_INIT_SENT;
crypto/openssh/kex.c
612
struct kex *kex = ssh->kex;
crypto/openssh/kex.c
619
if (kex == NULL) {
crypto/openssh/kex.c
625
if ((r = sshbuf_put(kex->peer, ptr, dlen)) != 0)
crypto/openssh/kex.c
656
if (!(kex->flags & KEX_INIT_SENT))
crypto/openssh/kex.c
662
if (kex->kex_type < KEX_MAX && kex->kex[kex->kex_type] != NULL)
crypto/openssh/kex.c
663
return (kex->kex[kex->kex_type])(ssh);
crypto/openssh/kex.c
665
error_f("unknown kex type %u", kex->kex_type);
crypto/openssh/kex.c
669
struct kex *
crypto/openssh/kex.c
672
struct kex *kex;
crypto/openssh/kex.c
674
if ((kex = calloc(1, sizeof(*kex))) == NULL ||
crypto/openssh/kex.c
675
(kex->peer = sshbuf_new()) == NULL ||
crypto/openssh/kex.c
676
(kex->my = sshbuf_new()) == NULL ||
crypto/openssh/kex.c
677
(kex->client_version = sshbuf_new()) == NULL ||
crypto/openssh/kex.c
678
(kex->server_version = sshbuf_new()) == NULL ||
crypto/openssh/kex.c
679
(kex->session_id = sshbuf_new()) == NULL) {
crypto/openssh/kex.c
680
kex_free(kex);
crypto/openssh/kex.c
683
return kex;
crypto/openssh/kex.c
717
kex_free(struct kex *kex)
crypto/openssh/kex.c
721
if (kex == NULL)
crypto/openssh/kex.c
725
DH_free(kex->dh);
crypto/openssh/kex.c
727
EC_KEY_free(kex->ec_client_key);
crypto/openssh/kex.c
731
kex_free_newkeys(kex->newkeys[mode]);
crypto/openssh/kex.c
732
kex->newkeys[mode] = NULL;
crypto/openssh/kex.c
734
sshbuf_free(kex->peer);
crypto/openssh/kex.c
735
sshbuf_free(kex->my);
crypto/openssh/kex.c
736
sshbuf_free(kex->client_version);
crypto/openssh/kex.c
737
sshbuf_free(kex->server_version);
crypto/openssh/kex.c
738
sshbuf_free(kex->client_pub);
crypto/openssh/kex.c
739
sshbuf_free(kex->session_id);
crypto/openssh/kex.c
740
sshbuf_free(kex->initial_sig);
crypto/openssh/kex.c
741
sshkey_free(kex->initial_hostkey);
crypto/openssh/kex.c
742
free(kex->failed_choice);
crypto/openssh/kex.c
743
free(kex->hostkey_alg);
crypto/openssh/kex.c
744
free(kex->name);
crypto/openssh/kex.c
745
free(kex);
crypto/openssh/kex.c
753
if ((r = kex_prop2buf(ssh->kex->my, proposal)) != 0)
crypto/openssh/kex.c
755
ssh->kex->flags = KEX_INITIAL;
crypto/openssh/kex.c
769
kex_free(ssh->kex);
crypto/openssh/kex.c
770
ssh->kex = NULL;
crypto/openssh/kex.c
783
if (ssh->kex == NULL) {
crypto/openssh/kex.c
787
if (ssh->kex->done == 0) {
crypto/openssh/kex.c
791
ssh->kex->done = 0;
crypto/openssh/kex.c
861
choose_kex(struct kex *k, char *client, char *server)
crypto/openssh/kex.c
879
choose_hostkeyalg(struct kex *k, char *client, char *server)
crypto/openssh/kex.c
930
struct kex *kex = ssh->kex;
crypto/openssh/kex.c
938
debug2("local %s KEXINIT proposal", kex->server ? "server" : "client");
crypto/openssh/kex.c
939
if ((r = kex_buf2prop(kex->my, NULL, &my)) != 0)
crypto/openssh/kex.c
941
debug2("peer %s KEXINIT proposal", kex->server ? "client" : "server");
crypto/openssh/kex.c
942
if ((r = kex_buf2prop(kex->peer, &first_kex_follows, &peer)) != 0)
crypto/openssh/kex.c
945
if (kex->server) {
crypto/openssh/kex.c
954
if ((kex->flags & KEX_INITIAL) != 0) {
crypto/openssh/kex.c
955
if (kex->server) {
crypto/openssh/kex.c
956
kex->ext_info_c = kexalgs_contains(peer, "ext-info-c");
crypto/openssh/kex.c
957
kex->kex_strict = kexalgs_contains(peer,
crypto/openssh/kex.c
960
kex->ext_info_s = kexalgs_contains(peer, "ext-info-s");
crypto/openssh/kex.c
961
kex->kex_strict = kexalgs_contains(peer,
crypto/openssh/kex.c
964
if (kex->kex_strict) {
crypto/openssh/kex.c
97
const char **defprop = ssh->kex->server ? defpropserver : defpropclient;
crypto/openssh/kex.c
974
if (kex->server && (kex->flags & KEX_INITIAL)) {
crypto/openssh/kex.c
977
kex->flags |= KEX_RSA_SHA2_256_SUPPORTED;
crypto/openssh/kex.c
980
kex->flags |= KEX_RSA_SHA2_512_SUPPORTED;
crypto/openssh/kex.c
984
if ((r = choose_kex(kex, cprop[PROPOSAL_KEX_ALGS],
crypto/openssh/kex.c
986
kex->failed_choice = peer[PROPOSAL_KEX_ALGS];
crypto/openssh/kex.c
990
if ((r = choose_hostkeyalg(kex, cprop[PROPOSAL_SERVER_HOST_KEY_ALGS],
crypto/openssh/kex.c
992
kex->failed_choice = peer[PROPOSAL_SERVER_HOST_KEY_ALGS];
crypto/openssh/kex.h
174
int (*kex[KEX_MAX])(struct ssh *);
crypto/openssh/kex.h
201
struct kex *kex_new(void);
crypto/openssh/kex.h
205
void kex_free(struct kex *);
crypto/openssh/kex.h
228
int kex_dh_keypair(struct kex *);
crypto/openssh/kex.h
229
int kex_dh_enc(struct kex *, const struct sshbuf *, struct sshbuf **,
crypto/openssh/kex.h
231
int kex_dh_dec(struct kex *, const struct sshbuf *, struct sshbuf **);
crypto/openssh/kex.h
233
int kex_ecdh_keypair(struct kex *);
crypto/openssh/kex.h
234
int kex_ecdh_enc(struct kex *, const struct sshbuf *, struct sshbuf **,
crypto/openssh/kex.h
236
int kex_ecdh_dec(struct kex *, const struct sshbuf *, struct sshbuf **);
crypto/openssh/kex.h
238
int kex_c25519_keypair(struct kex *);
crypto/openssh/kex.h
239
int kex_c25519_enc(struct kex *, const struct sshbuf *, struct sshbuf **,
crypto/openssh/kex.h
241
int kex_c25519_dec(struct kex *, const struct sshbuf *, struct sshbuf **);
crypto/openssh/kex.h
243
int kex_kem_sntrup761x25519_keypair(struct kex *);
crypto/openssh/kex.h
244
int kex_kem_sntrup761x25519_enc(struct kex *, const struct sshbuf *,
crypto/openssh/kex.h
246
int kex_kem_sntrup761x25519_dec(struct kex *, const struct sshbuf *,
crypto/openssh/kex.h
249
int kex_dh_keygen(struct kex *);
crypto/openssh/kex.h
250
int kex_dh_compute_key(struct kex *, BIGNUM *, struct sshbuf *);
crypto/openssh/kexc25519.c
102
kexc25519_keygen(kex->c25519_client_key, cp);
crypto/openssh/kexc25519.c
106
kex->client_pub = buf;
crypto/openssh/kexc25519.c
114
kex_c25519_enc(struct kex *kex, const struct sshbuf *client_blob,
crypto/openssh/kexc25519.c
166
kex_c25519_dec(struct kex *kex, const struct sshbuf *server_blob,
crypto/openssh/kexc25519.c
188
if ((r = kexc25519_shared_key_ext(kex->c25519_client_key, server_pub,
crypto/openssh/kexc25519.c
92
kex_c25519_keypair(struct kex *kex)
crypto/openssh/kexdh.c
115
kex_dh_keypair(struct kex *kex)
crypto/openssh/kexdh.c
121
if ((r = kex_dh_keygen(kex)) != 0)
crypto/openssh/kexdh.c
123
DH_get0_key(kex->dh, &pub_key, NULL);
crypto/openssh/kexdh.c
130
DHparams_print_fp(stderr, kex->dh);
crypto/openssh/kexdh.c
135
kex->client_pub = buf;
crypto/openssh/kexdh.c
143
kex_dh_enc(struct kex *kex, const struct sshbuf *client_blob,
crypto/openssh/kexdh.c
153
if ((r = kex_dh_keygen(kex)) != 0)
crypto/openssh/kexdh.c
155
DH_get0_key(kex->dh, &pub_key, NULL);
crypto/openssh/kexdh.c
163
if ((r = kex_dh_dec(kex, client_blob, shared_secretp)) != 0)
crypto/openssh/kexdh.c
168
DH_free(kex->dh);
crypto/openssh/kexdh.c
169
kex->dh = NULL;
crypto/openssh/kexdh.c
175
kex_dh_dec(struct kex *kex, const struct sshbuf *dh_blob,
crypto/openssh/kexdh.c
192
if ((r = kex_dh_compute_key(kex, dh_pub, buf)) != 0)
crypto/openssh/kexdh.c
198
DH_free(kex->dh);
crypto/openssh/kexdh.c
199
kex->dh = NULL;
crypto/openssh/kexdh.c
48
kex_dh_keygen(struct kex *kex)
crypto/openssh/kexdh.c
50
switch (kex->kex_type) {
crypto/openssh/kexdh.c
52
kex->dh = dh_new_group1();
crypto/openssh/kexdh.c
56
kex->dh = dh_new_group14();
crypto/openssh/kexdh.c
59
kex->dh = dh_new_group16();
crypto/openssh/kexdh.c
62
kex->dh = dh_new_group18();
crypto/openssh/kexdh.c
67
if (kex->dh == NULL)
crypto/openssh/kexdh.c
69
return (dh_gen_key(kex->dh, kex->we_need * 8));
crypto/openssh/kexdh.c
73
kex_dh_compute_key(struct kex *kex, BIGNUM *dh_pub, struct sshbuf *out)
crypto/openssh/kexdh.c
85
DHparams_print_fp(stderr, kex->dh);
crypto/openssh/kexdh.c
89
if (!dh_pub_is_valid(kex->dh, dh_pub)) {
crypto/openssh/kexdh.c
93
klen = DH_size(kex->dh);
crypto/openssh/kexdh.c
99
if ((kout = DH_compute_key(kbuf, dh_pub, kex->dh)) < 0 ||
crypto/openssh/kexecdh.c
104
if ((server_key = EC_KEY_new_by_curve_name(kex->ec_nid)) == NULL) {
crypto/openssh/kexecdh.c
126
if ((r = kex_ecdh_dec_key_group(kex, client_blob, server_key, group,
crypto/openssh/kexecdh.c
138
kex_ecdh_dec_key_group(struct kex *kex, const struct sshbuf *ec_blob,
crypto/openssh/kexecdh.c
200
kex_ecdh_dec(struct kex *kex, const struct sshbuf *server_blob,
crypto/openssh/kexecdh.c
205
r = kex_ecdh_dec_key_group(kex, server_blob, kex->ec_client_key,
crypto/openssh/kexecdh.c
206
kex->ec_group, shared_secretp);
crypto/openssh/kexecdh.c
207
EC_KEY_free(kex->ec_client_key);
crypto/openssh/kexecdh.c
208
kex->ec_client_key = NULL;
crypto/openssh/kexecdh.c
216
struct kex;
crypto/openssh/kexecdh.c
221
kex_ecdh_keypair(struct kex *kex)
crypto/openssh/kexecdh.c
227
kex_ecdh_enc(struct kex *kex, const struct sshbuf *client_blob,
crypto/openssh/kexecdh.c
234
kex_ecdh_dec(struct kex *kex, const struct sshbuf *server_blob,
crypto/openssh/kexecdh.c
46
kex_ecdh_dec_key_group(struct kex *, const struct sshbuf *, EC_KEY *key,
crypto/openssh/kexecdh.c
50
kex_ecdh_keypair(struct kex *kex)
crypto/openssh/kexecdh.c
58
if ((client_key = EC_KEY_new_by_curve_name(kex->ec_nid)) == NULL) {
crypto/openssh/kexecdh.c
80
kex->ec_client_key = client_key;
crypto/openssh/kexecdh.c
81
kex->ec_group = group;
crypto/openssh/kexecdh.c
83
kex->client_pub = buf;
crypto/openssh/kexecdh.c
92
kex_ecdh_enc(struct kex *kex, const struct sshbuf *client_blob,
crypto/openssh/kexgen.c
101
struct kex *kex = ssh->kex;
crypto/openssh/kexgen.c
104
switch (kex->kex_type) {
crypto/openssh/kexgen.c
111
r = kex_dh_keypair(kex);
crypto/openssh/kexgen.c
114
r = kex_ecdh_keypair(kex);
crypto/openssh/kexgen.c
118
r = kex_c25519_keypair(kex);
crypto/openssh/kexgen.c
121
r = kex_kem_sntrup761x25519_keypair(kex);
crypto/openssh/kexgen.c
130
(r = sshpkt_put_stringb(ssh, kex->client_pub)) != 0 ||
crypto/openssh/kexgen.c
141
struct kex *kex = ssh->kex;
crypto/openssh/kexgen.c
175
switch (kex->kex_type) {
crypto/openssh/kexgen.c
182
r = kex_dh_dec(kex, server_blob, &shared_secret);
crypto/openssh/kexgen.c
185
r = kex_ecdh_dec(kex, server_blob, &shared_secret);
crypto/openssh/kexgen.c
189
r = kex_c25519_dec(kex, server_blob, &shared_secret);
crypto/openssh/kexgen.c
192
r = kex_kem_sntrup761x25519_dec(kex, server_blob,
crypto/openssh/kexgen.c
205
kex->hash_alg,
crypto/openssh/kexgen.c
206
kex->client_version,
crypto/openssh/kexgen.c
207
kex->server_version,
crypto/openssh/kexgen.c
208
kex->my,
crypto/openssh/kexgen.c
209
kex->peer,
crypto/openssh/kexgen.c
211
kex->client_pub,
crypto/openssh/kexgen.c
218
kex->hostkey_alg, ssh->compat, NULL)) != 0)
crypto/openssh/kexgen.c
226
if ((kex->flags & KEX_INITIAL) != 0) {
crypto/openssh/kexgen.c
227
if (kex->initial_hostkey != NULL || kex->initial_sig != NULL) {
crypto/openssh/kexgen.c
231
if ((kex->initial_sig = sshbuf_new()) == NULL) {
crypto/openssh/kexgen.c
235
if ((r = sshbuf_put(kex->initial_sig, signature, slen)) != 0)
crypto/openssh/kexgen.c
237
kex->initial_hostkey = server_host_key;
crypto/openssh/kexgen.c
243
explicit_bzero(kex->c25519_client_key, sizeof(kex->c25519_client_key));
crypto/openssh/kexgen.c
244
explicit_bzero(kex->sntrup761_client_key,
crypto/openssh/kexgen.c
245
sizeof(kex->sntrup761_client_key));
crypto/openssh/kexgen.c
252
sshbuf_free(kex->client_pub);
crypto/openssh/kexgen.c
253
kex->client_pub = NULL;
crypto/openssh/kexgen.c
268
struct kex *kex = ssh->kex;
crypto/openssh/kexgen.c
290
switch (kex->kex_type) {
crypto/openssh/kexgen.c
297
r = kex_dh_enc(kex, client_pubkey, &server_pubkey,
crypto/openssh/kexgen.c
301
r = kex_ecdh_enc(kex, client_pubkey, &server_pubkey,
crypto/openssh/kexgen.c
306
r = kex_c25519_enc(kex, client_pubkey, &server_pubkey,
crypto/openssh/kexgen.c
310
r = kex_kem_sntrup761x25519_enc(kex, client_pubkey,
crypto/openssh/kexgen.c
329
kex->hash_alg,
crypto/openssh/kexgen.c
330
kex->client_version,
crypto/openssh/kexgen.c
331
kex->server_version,
crypto/openssh/kexgen.c
332
kex->peer,
crypto/openssh/kexgen.c
333
kex->my,
crypto/openssh/kexgen.c
342
if ((r = kex->sign(ssh, server_host_private, server_host_public,
crypto/openssh/kexgen.c
343
&signature, &slen, hash, hashlen, kex->hostkey_alg)) != 0)
crypto/openssh/kexgen.c
358
if (kex->initial_hostkey == NULL &&
crypto/openssh/kexgen.c
360
&kex->initial_hostkey)) != 0)
crypto/openssh/kexgexc.c
110
(u_int)bits < kex->min || (u_int)bits > kex->max) {
crypto/openssh/kexgexc.c
114
if ((kex->dh = dh_new_group(g, p)) == NULL) {
crypto/openssh/kexgexc.c
121
if ((r = dh_gen_key(kex->dh, kex->we_need * 8)) != 0)
crypto/openssh/kexgexc.c
123
DH_get0_key(kex->dh, &pub_key, NULL);
crypto/openssh/kexgexc.c
130
DHparams_print_fp(stderr, kex->dh);
crypto/openssh/kexgexc.c
147
struct kex *kex = ssh->kex;
crypto/openssh/kexgexc.c
181
if ((r = kex_dh_compute_key(kex, dh_server_pub, shared_secret)) != 0)
crypto/openssh/kexgexc.c
184
kex->min = kex->max = -1;
crypto/openssh/kexgexc.c
187
DH_get0_key(kex->dh, &pub_key, NULL);
crypto/openssh/kexgexc.c
188
DH_get0_pqg(kex->dh, &dh_p, NULL, &dh_g);
crypto/openssh/kexgexc.c
191
kex->hash_alg,
crypto/openssh/kexgexc.c
192
kex->client_version,
crypto/openssh/kexgexc.c
193
kex->server_version,
crypto/openssh/kexgexc.c
194
kex->my,
crypto/openssh/kexgexc.c
195
kex->peer,
crypto/openssh/kexgexc.c
197
kex->min, kex->nbits, kex->max,
crypto/openssh/kexgexc.c
206
hashlen, kex->hostkey_alg, ssh->compat, NULL)) != 0)
crypto/openssh/kexgexc.c
214
if ((kex->flags & KEX_INITIAL) != 0) {
crypto/openssh/kexgexc.c
215
if (kex->initial_hostkey != NULL || kex->initial_sig != NULL) {
crypto/openssh/kexgexc.c
219
if ((kex->initial_sig = sshbuf_new()) == NULL) {
crypto/openssh/kexgexc.c
223
if ((r = sshbuf_put(kex->initial_sig, signature, slen)) != 0)
crypto/openssh/kexgexc.c
225
kex->initial_hostkey = server_host_key;
crypto/openssh/kexgexc.c
231
DH_free(kex->dh);
crypto/openssh/kexgexc.c
232
kex->dh = NULL;
crypto/openssh/kexgexc.c
62
struct kex *kex = ssh->kex;
crypto/openssh/kexgexc.c
66
nbits = dh_estimate(kex->dh_need * 8);
crypto/openssh/kexgexc.c
68
kex->min = DH_GRP_MIN;
crypto/openssh/kexgexc.c
69
kex->max = DH_GRP_MAX;
crypto/openssh/kexgexc.c
70
kex->nbits = nbits;
crypto/openssh/kexgexc.c
72
kex->nbits = MINIMUM(kex->nbits, 4096);
crypto/openssh/kexgexc.c
75
(r = sshpkt_put_u32(ssh, kex->min)) != 0 ||
crypto/openssh/kexgexc.c
76
(r = sshpkt_put_u32(ssh, kex->nbits)) != 0 ||
crypto/openssh/kexgexc.c
77
(r = sshpkt_put_u32(ssh, kex->max)) != 0 ||
crypto/openssh/kexgexc.c
81
kex->min, kex->nbits, kex->max);
crypto/openssh/kexgexc.c
84
kex->min, kex->nbits, kex->max);
crypto/openssh/kexgexc.c
97
struct kex *kex = ssh->kex;
crypto/openssh/kexgexs.c
101
kex->dh = mm_choose_dh(min, nbits, max);
crypto/openssh/kexgexs.c
102
if (kex->dh == NULL) {
crypto/openssh/kexgexs.c
108
DH_get0_pqg(kex->dh, &dh_p, NULL, &dh_g);
crypto/openssh/kexgexs.c
116
if ((r = dh_gen_key(kex->dh, kex->we_need * 8)) != 0)
crypto/openssh/kexgexs.c
129
struct kex *kex = ssh->kex;
crypto/openssh/kexgexs.c
155
if ((r = kex_dh_compute_key(kex, dh_client_pub, shared_secret)) != 0)
crypto/openssh/kexgexs.c
165
DH_get0_key(kex->dh, &pub_key, NULL);
crypto/openssh/kexgexs.c
166
DH_get0_pqg(kex->dh, &dh_p, NULL, &dh_g);
crypto/openssh/kexgexs.c
169
kex->hash_alg,
crypto/openssh/kexgexs.c
170
kex->client_version,
crypto/openssh/kexgexs.c
171
kex->server_version,
crypto/openssh/kexgexs.c
172
kex->peer,
crypto/openssh/kexgexs.c
173
kex->my,
crypto/openssh/kexgexs.c
175
kex->min, kex->nbits, kex->max,
crypto/openssh/kexgexs.c
184
if ((r = kex->sign(ssh, server_host_private, server_host_public,
crypto/openssh/kexgexs.c
185
&signature, &slen, hash, hashlen, kex->hostkey_alg)) < 0)
crypto/openssh/kexgexs.c
201
if (kex->initial_hostkey == NULL &&
crypto/openssh/kexgexs.c
203
&kex->initial_hostkey)) != 0)
crypto/openssh/kexgexs.c
208
DH_free(kex->dh);
crypto/openssh/kexgexs.c
209
kex->dh = NULL;
crypto/openssh/kexgexs.c
73
struct kex *kex = ssh->kex;
crypto/openssh/kexgexs.c
86
kex->nbits = nbits;
crypto/openssh/kexgexs.c
87
kex->min = min;
crypto/openssh/kexgexs.c
88
kex->max = max;
crypto/openssh/kexgexs.c
94
if (kex->max < kex->min || kex->nbits < kex->min ||
crypto/openssh/kexgexs.c
95
kex->max < kex->nbits || kex->max < DH_GRP_MIN) {
crypto/openssh/kexsntrup761x25519.c
129
if ((r = ssh_digest_buffer(kex->hash_alg, buf, hash, sizeof(hash))) != 0)
crypto/openssh/kexsntrup761x25519.c
142
ssh_digest_bytes(kex->hash_alg))) != 0)
crypto/openssh/kexsntrup761x25519.c
160
kex_kem_sntrup761x25519_dec(struct kex *kex,
crypto/openssh/kexsntrup761x25519.c
193
kex->sntrup761_client_key);
crypto/openssh/kexsntrup761x25519.c
194
if ((r = kexc25519_shared_key_ext(kex->c25519_client_key, server_pub,
crypto/openssh/kexsntrup761x25519.c
197
if ((r = ssh_digest_buffer(kex->hash_alg, buf, hash, sizeof(hash))) != 0)
crypto/openssh/kexsntrup761x25519.c
206
ssh_digest_bytes(kex->hash_alg))) != 0)
crypto/openssh/kexsntrup761x25519.c
227
struct kex;
crypto/openssh/kexsntrup761x25519.c
232
kex_kem_sntrup761x25519_keypair(struct kex *kex)
crypto/openssh/kexsntrup761x25519.c
238
kex_kem_sntrup761x25519_enc(struct kex *kex,
crypto/openssh/kexsntrup761x25519.c
246
kex_kem_sntrup761x25519_dec(struct kex *kex,
crypto/openssh/kexsntrup761x25519.c
43
kex_kem_sntrup761x25519_keypair(struct kex *kex)
crypto/openssh/kexsntrup761x25519.c
55
crypto_kem_sntrup761_keypair(cp, kex->sntrup761_client_key);
crypto/openssh/kexsntrup761x25519.c
61
kexc25519_keygen(kex->c25519_client_key, cp);
crypto/openssh/kexsntrup761x25519.c
65
kex->client_pub = buf;
crypto/openssh/kexsntrup761x25519.c
73
kex_kem_sntrup761x25519_enc(struct kex *kex,
crypto/openssh/monitor.c
1734
struct kex *kex;
crypto/openssh/monitor.c
1742
if ((kex = ssh->kex) == NULL)
crypto/openssh/monitor.c
1744
if (session_id2_len != sshbuf_len(ssh->kex->session_id)) {
crypto/openssh/monitor.c
1746
sshbuf_len(ssh->kex->session_id), session_id2_len);
crypto/openssh/monitor.c
1748
if (memcmp(sshbuf_ptr(ssh->kex->session_id), session_id2,
crypto/openssh/monitor.c
1753
kex->kex[KEX_DH_GRP1_SHA1] = kex_gen_server;
crypto/openssh/monitor.c
1754
kex->kex[KEX_DH_GRP14_SHA1] = kex_gen_server;
crypto/openssh/monitor.c
1755
kex->kex[KEX_DH_GRP14_SHA256] = kex_gen_server;
crypto/openssh/monitor.c
1756
kex->kex[KEX_DH_GRP16_SHA512] = kex_gen_server;
crypto/openssh/monitor.c
1757
kex->kex[KEX_DH_GRP18_SHA512] = kex_gen_server;
crypto/openssh/monitor.c
1758
kex->kex[KEX_DH_GEX_SHA1] = kexgex_server;
crypto/openssh/monitor.c
1759
kex->kex[KEX_DH_GEX_SHA256] = kexgex_server;
crypto/openssh/monitor.c
1761
kex->kex[KEX_ECDH_SHA2] = kex_gen_server;
crypto/openssh/monitor.c
1764
kex->kex[KEX_C25519_SHA256] = kex_gen_server;
crypto/openssh/monitor.c
1765
kex->kex[KEX_KEM_SNTRUP761X25519_SHA512] = kex_gen_server;
crypto/openssh/monitor.c
1766
kex->load_host_public_key=&get_hostkey_public_by_type;
crypto/openssh/monitor.c
1767
kex->load_host_private_key=&get_hostkey_private_by_type;
crypto/openssh/monitor.c
1768
kex->host_key_index=&get_hostkey_index;
crypto/openssh/monitor.c
1769
kex->sign = sshd_hostkey_sign;
crypto/openssh/monitor.h
76
struct kex **m_pkex;
crypto/openssh/monitor_wrap.c
267
struct kex *kex = *pmonitor->m_pkex;
crypto/openssh/monitor_wrap.c
269
u_int ndx = kex->host_key_index(key, 0, ssh);
crypto/openssh/packet.c
1303
if ((ssh->kex->flags & KEX_INITIAL) != 0) {
crypto/openssh/packet.c
1316
if (type == SSH2_MSG_NEWKEYS && ssh->kex->kex_strict) {
crypto/openssh/packet.c
1528
if (ssh->kex)
crypto/openssh/packet.c
1714
if ((ssh->kex->flags & KEX_INITIAL) != 0) {
crypto/openssh/packet.c
1785
if (*typep == SSH2_MSG_NEWKEYS && ssh->kex->kex_strict) {
crypto/openssh/packet.c
1840
if (ssh->kex != NULL &&
crypto/openssh/packet.c
1841
(ssh->kex->flags & KEX_INITIAL) && ssh->kex->kex_strict)
crypto/openssh/packet.c
2016
if (ssh->kex && ssh->kex->failed_choice) {
crypto/openssh/packet.c
2021
ssh->kex->failed_choice);
crypto/openssh/packet.c
2300
ssh->kex->server = 1; /* XXX unify? */
crypto/openssh/packet.c
2340
kex_to_blob(struct sshbuf *m, struct kex *kex)
crypto/openssh/packet.c
2344
if ((r = sshbuf_put_u32(m, kex->we_need)) != 0 ||
crypto/openssh/packet.c
2345
(r = sshbuf_put_cstring(m, kex->hostkey_alg)) != 0 ||
crypto/openssh/packet.c
2346
(r = sshbuf_put_u32(m, kex->hostkey_type)) != 0 ||
crypto/openssh/packet.c
2347
(r = sshbuf_put_u32(m, kex->hostkey_nid)) != 0 ||
crypto/openssh/packet.c
2348
(r = sshbuf_put_u32(m, kex->kex_type)) != 0 ||
crypto/openssh/packet.c
2349
(r = sshbuf_put_u32(m, kex->kex_strict)) != 0 ||
crypto/openssh/packet.c
2350
(r = sshbuf_put_stringb(m, kex->my)) != 0 ||
crypto/openssh/packet.c
2351
(r = sshbuf_put_stringb(m, kex->peer)) != 0 ||
crypto/openssh/packet.c
2352
(r = sshbuf_put_stringb(m, kex->client_version)) != 0 ||
crypto/openssh/packet.c
2353
(r = sshbuf_put_stringb(m, kex->server_version)) != 0 ||
crypto/openssh/packet.c
2354
(r = sshbuf_put_stringb(m, kex->session_id)) != 0 ||
crypto/openssh/packet.c
2355
(r = sshbuf_put_u32(m, kex->flags)) != 0)
crypto/openssh/packet.c
237
(ssh->kex = kex_new()) == NULL ||
crypto/openssh/packet.c
2411
if ((r = kex_to_blob(m, ssh->kex)) != 0 ||
crypto/openssh/packet.c
2489
ssh->kex->newkeys[mode] = newkey;
crypto/openssh/packet.c
2500
kex_from_blob(struct sshbuf *m, struct kex **kexp)
crypto/openssh/packet.c
2502
struct kex *kex;
crypto/openssh/packet.c
2505
if ((kex = kex_new()) == NULL)
crypto/openssh/packet.c
2507
if ((r = sshbuf_get_u32(m, &kex->we_need)) != 0 ||
crypto/openssh/packet.c
2508
(r = sshbuf_get_cstring(m, &kex->hostkey_alg, NULL)) != 0 ||
crypto/openssh/packet.c
2509
(r = sshbuf_get_u32(m, (u_int *)&kex->hostkey_type)) != 0 ||
crypto/openssh/packet.c
2510
(r = sshbuf_get_u32(m, (u_int *)&kex->hostkey_nid)) != 0 ||
crypto/openssh/packet.c
2511
(r = sshbuf_get_u32(m, &kex->kex_type)) != 0 ||
crypto/openssh/packet.c
2512
(r = sshbuf_get_u32(m, &kex->kex_strict)) != 0 ||
crypto/openssh/packet.c
2513
(r = sshbuf_get_stringb(m, kex->my)) != 0 ||
crypto/openssh/packet.c
2514
(r = sshbuf_get_stringb(m, kex->peer)) != 0 ||
crypto/openssh/packet.c
2515
(r = sshbuf_get_stringb(m, kex->client_version)) != 0 ||
crypto/openssh/packet.c
2516
(r = sshbuf_get_stringb(m, kex->server_version)) != 0 ||
crypto/openssh/packet.c
2517
(r = sshbuf_get_stringb(m, kex->session_id)) != 0 ||
crypto/openssh/packet.c
2518
(r = sshbuf_get_u32(m, &kex->flags)) != 0)
crypto/openssh/packet.c
2520
kex->server = 1;
crypto/openssh/packet.c
2521
kex->done = 1;
crypto/openssh/packet.c
2525
kex_free(kex);
crypto/openssh/packet.c
2530
*kexp = kex;
crypto/openssh/packet.c
2547
if ((r = kex_from_blob(m, &ssh->kex)) != 0 ||
crypto/openssh/packet.c
261
kex_free(ssh->kex);
crypto/openssh/packet.c
2767
if (ssh->kex)
crypto/openssh/packet.c
286
(ssh->kex != NULL && ssh->kex->done == 0);
crypto/openssh/packet.c
349
kex_free(ssh->kex);
crypto/openssh/packet.c
350
ssh->kex = NULL;
crypto/openssh/packet.c
737
kex_free(ssh->kex);
crypto/openssh/packet.c
738
ssh->kex = NULL;
crypto/openssh/packet.c
946
if (ssh->kex && ssh->kex->newkeys[mode]) {
crypto/openssh/packet.c
947
kex_free_newkeys(ssh->kex->newkeys[mode]);
crypto/openssh/packet.c
948
ssh->kex->newkeys[mode] = NULL;
crypto/openssh/packet.c
992
if ((state->newkeys[mode] = ssh->kex->newkeys[mode]) == NULL)
crypto/openssh/packet.c
994
ssh->kex->newkeys[mode] = NULL;
crypto/openssh/packet.h
40
struct kex;
crypto/openssh/packet.h
57
struct kex *kex;
crypto/openssh/serverloop.c
659
ssh->kex->hostkey_alg)) == KEY_RSA)
crypto/openssh/serverloop.c
660
kex_rsa_sigalg = ssh->kex->hostkey_alg;
crypto/openssh/serverloop.c
673
if ((ndx = ssh->kex->host_key_index(key, 1, ssh)) == -1) {
crypto/openssh/serverloop.c
697
else if (ssh->kex->flags & KEX_RSA_SHA2_512_SUPPORTED)
crypto/openssh/serverloop.c
699
else if (ssh->kex->flags & KEX_RSA_SHA2_256_SUPPORTED)
crypto/openssh/serverloop.c
707
ssh->kex->session_id)) != 0 ||
crypto/openssh/serverloop.c
709
(r = ssh->kex->sign(ssh, key_prv, key_pub, &sig, &slen,
crypto/openssh/ssh-keyscan.c
293
c->c_ssh->kex->kex[KEX_DH_GRP1_SHA1] = kex_gen_client;
crypto/openssh/ssh-keyscan.c
294
c->c_ssh->kex->kex[KEX_DH_GRP14_SHA1] = kex_gen_client;
crypto/openssh/ssh-keyscan.c
295
c->c_ssh->kex->kex[KEX_DH_GRP14_SHA256] = kex_gen_client;
crypto/openssh/ssh-keyscan.c
296
c->c_ssh->kex->kex[KEX_DH_GRP16_SHA512] = kex_gen_client;
crypto/openssh/ssh-keyscan.c
297
c->c_ssh->kex->kex[KEX_DH_GRP18_SHA512] = kex_gen_client;
crypto/openssh/ssh-keyscan.c
298
c->c_ssh->kex->kex[KEX_DH_GEX_SHA1] = kexgex_client;
crypto/openssh/ssh-keyscan.c
299
c->c_ssh->kex->kex[KEX_DH_GEX_SHA256] = kexgex_client;
crypto/openssh/ssh-keyscan.c
301
c->c_ssh->kex->kex[KEX_ECDH_SHA2] = kex_gen_client;
crypto/openssh/ssh-keyscan.c
304
c->c_ssh->kex->kex[KEX_C25519_SHA256] = kex_gen_client;
crypto/openssh/ssh-keyscan.c
305
c->c_ssh->kex->kex[KEX_KEM_SNTRUP761X25519_SHA512] = kex_gen_client;
crypto/openssh/ssh_api.c
121
ssh->kex->server = is_server;
crypto/openssh/ssh_api.c
124
ssh->kex->kex[KEX_DH_GRP1_SHA1] = kex_gen_server;
crypto/openssh/ssh_api.c
125
ssh->kex->kex[KEX_DH_GRP14_SHA1] = kex_gen_server;
crypto/openssh/ssh_api.c
126
ssh->kex->kex[KEX_DH_GRP14_SHA256] = kex_gen_server;
crypto/openssh/ssh_api.c
127
ssh->kex->kex[KEX_DH_GRP16_SHA512] = kex_gen_server;
crypto/openssh/ssh_api.c
128
ssh->kex->kex[KEX_DH_GRP18_SHA512] = kex_gen_server;
crypto/openssh/ssh_api.c
129
ssh->kex->kex[KEX_DH_GEX_SHA1] = kexgex_server;
crypto/openssh/ssh_api.c
130
ssh->kex->kex[KEX_DH_GEX_SHA256] = kexgex_server;
crypto/openssh/ssh_api.c
132
ssh->kex->kex[KEX_ECDH_SHA2] = kex_gen_server;
crypto/openssh/ssh_api.c
135
ssh->kex->kex[KEX_C25519_SHA256] = kex_gen_server;
crypto/openssh/ssh_api.c
136
ssh->kex->kex[KEX_KEM_SNTRUP761X25519_SHA512] = kex_gen_server;
crypto/openssh/ssh_api.c
137
ssh->kex->load_host_public_key=&_ssh_host_public_key;
crypto/openssh/ssh_api.c
138
ssh->kex->load_host_private_key=&_ssh_host_private_key;
crypto/openssh/ssh_api.c
139
ssh->kex->sign=&_ssh_host_key_sign;
crypto/openssh/ssh_api.c
142
ssh->kex->kex[KEX_DH_GRP1_SHA1] = kex_gen_client;
crypto/openssh/ssh_api.c
143
ssh->kex->kex[KEX_DH_GRP14_SHA1] = kex_gen_client;
crypto/openssh/ssh_api.c
144
ssh->kex->kex[KEX_DH_GRP14_SHA256] = kex_gen_client;
crypto/openssh/ssh_api.c
145
ssh->kex->kex[KEX_DH_GRP16_SHA512] = kex_gen_client;
crypto/openssh/ssh_api.c
146
ssh->kex->kex[KEX_DH_GRP18_SHA512] = kex_gen_client;
crypto/openssh/ssh_api.c
147
ssh->kex->kex[KEX_DH_GEX_SHA1] = kexgex_client;
crypto/openssh/ssh_api.c
148
ssh->kex->kex[KEX_DH_GEX_SHA256] = kexgex_client;
crypto/openssh/ssh_api.c
150
ssh->kex->kex[KEX_ECDH_SHA2] = kex_gen_client;
crypto/openssh/ssh_api.c
153
ssh->kex->kex[KEX_C25519_SHA256] = kex_gen_client;
crypto/openssh/ssh_api.c
154
ssh->kex->kex[KEX_KEM_SNTRUP761X25519_SHA512] = kex_gen_client;
crypto/openssh/ssh_api.c
155
ssh->kex->verify_host_key =&_ssh_verify_host_key;
crypto/openssh/ssh_api.c
175
if (ssh->kex && ssh->kex->server)
crypto/openssh/ssh_api.c
207
if (ssh->kex->server) {
crypto/openssh/ssh_api.c
238
if (cb == NULL || ssh->kex == NULL)
crypto/openssh/ssh_api.c
241
ssh->kex->verify_host_key = cb;
crypto/openssh/ssh_api.c
264
if (sshbuf_len(ssh->kex->client_version) == 0 ||
crypto/openssh/ssh_api.c
265
sshbuf_len(ssh->kex->server_version) == 0)
crypto/openssh/ssh_api.c
376
if (ssh->kex->server || ++n > SSH_MAX_PRE_BANNER_LINES) {
crypto/openssh/ssh_api.c
445
struct kex *kex = ssh->kex;
crypto/openssh/ssh_api.c
454
if (kex->server) {
crypto/openssh/ssh_api.c
455
if (sshbuf_len(ssh->kex->server_version) == 0)
crypto/openssh/ssh_api.c
456
r = _ssh_send_banner(ssh, ssh->kex->server_version);
crypto/openssh/ssh_api.c
458
sshbuf_len(ssh->kex->server_version) != 0 &&
crypto/openssh/ssh_api.c
459
sshbuf_len(ssh->kex->client_version) == 0)
crypto/openssh/ssh_api.c
460
r = _ssh_read_banner(ssh, ssh->kex->client_version);
crypto/openssh/ssh_api.c
462
if (sshbuf_len(ssh->kex->server_version) == 0)
crypto/openssh/ssh_api.c
463
r = _ssh_read_banner(ssh, ssh->kex->server_version);
crypto/openssh/ssh_api.c
465
sshbuf_len(ssh->kex->server_version) != 0 &&
crypto/openssh/ssh_api.c
466
sshbuf_len(ssh->kex->client_version) == 0)
crypto/openssh/ssh_api.c
467
r = _ssh_send_banner(ssh, ssh->kex->client_version);
crypto/openssh/ssh_api.c
472
if (sshbuf_len(ssh->kex->server_version) != 0 &&
crypto/openssh/ssh_api.c
473
sshbuf_len(ssh->kex->client_version) != 0) {
crypto/openssh/ssh_api.c
536
if ((r = kex_buf2prop(ssh->kex->my, NULL, &proposal)) != 0)
crypto/openssh/ssh_api.c
564
debug2_f("orig/%d %s", ssh->kex->server, orig);
crypto/openssh/ssh_api.c
565
debug2_f("replace/%d %s", ssh->kex->server, replace);
crypto/openssh/ssh_api.c
569
r = kex_prop2buf(ssh->kex->my, proposal);
crypto/openssh/sshconnect2.c
1162
if (ssh == NULL || ssh->kex->server_sig_algs == NULL ||
crypto/openssh/sshconnect2.c
1174
server_sig_algs = ssh->kex->server_sig_algs;
crypto/openssh/sshconnect2.c
1320
if ((ssh->kex->flags & KEX_HAS_PUBKEY_HOSTBOUND) != 0 &&
crypto/openssh/sshconnect2.c
1399
if ((r = sshbuf_putb(b, ssh->kex->session_id)) != 0)
crypto/openssh/sshconnect2.c
1403
ssh->kex->session_id)) != 0)
crypto/openssh/sshconnect2.c
1417
if (ssh->kex->initial_hostkey == NULL) {
crypto/openssh/sshconnect2.c
1421
if ((r = sshkey_puts(ssh->kex->initial_hostkey, b)) != 0)
crypto/openssh/sshconnect2.c
1638
if ((r = ssh_agent_bind_hostkey(agent_fd, ssh->kex->initial_hostkey,
crypto/openssh/sshconnect2.c
1639
ssh->kex->session_id, ssh->kex->initial_sig, 0)) == 0)
crypto/openssh/sshconnect2.c
1800
} else if (ssh->kex->server_sig_algs != NULL &&
crypto/openssh/sshconnect2.c
2210
if ((r = sshbuf_put_stringb(b, ssh->kex->session_id)) != 0 ||
crypto/openssh/sshconnect2.c
264
ssh->kex->kex[KEX_DH_GRP1_SHA1] = kex_gen_client;
crypto/openssh/sshconnect2.c
265
ssh->kex->kex[KEX_DH_GRP14_SHA1] = kex_gen_client;
crypto/openssh/sshconnect2.c
266
ssh->kex->kex[KEX_DH_GRP14_SHA256] = kex_gen_client;
crypto/openssh/sshconnect2.c
267
ssh->kex->kex[KEX_DH_GRP16_SHA512] = kex_gen_client;
crypto/openssh/sshconnect2.c
268
ssh->kex->kex[KEX_DH_GRP18_SHA512] = kex_gen_client;
crypto/openssh/sshconnect2.c
269
ssh->kex->kex[KEX_DH_GEX_SHA1] = kexgex_client;
crypto/openssh/sshconnect2.c
270
ssh->kex->kex[KEX_DH_GEX_SHA256] = kexgex_client;
crypto/openssh/sshconnect2.c
272
ssh->kex->kex[KEX_ECDH_SHA2] = kex_gen_client;
crypto/openssh/sshconnect2.c
275
ssh->kex->kex[KEX_C25519_SHA256] = kex_gen_client;
crypto/openssh/sshconnect2.c
276
ssh->kex->kex[KEX_KEM_SNTRUP761X25519_SHA512] = kex_gen_client;
crypto/openssh/sshconnect2.c
277
ssh->kex->verify_host_key=&verify_host_key_callback;
crypto/openssh/sshconnect2.c
279
ssh_dispatch_run_fatal(ssh, DISPATCH_BLOCK, &ssh->kex->done);
crypto/openssh/sshconnect2.c
512
ssh_dispatch_set(ssh, SSH2_MSG_EXT_INFO, ssh->kex->ext_info_s ?
crypto/openssh/sshconnect2.c
858
ssh->kex->session_id);
crypto/openssh/sshd-session.c
1418
struct kex *kex;
crypto/openssh/sshd-session.c
1438
kex = ssh->kex;
crypto/openssh/sshd-session.c
1441
kex->kex[KEX_DH_GRP1_SHA1] = kex_gen_server;
crypto/openssh/sshd-session.c
1442
kex->kex[KEX_DH_GRP14_SHA1] = kex_gen_server;
crypto/openssh/sshd-session.c
1443
kex->kex[KEX_DH_GRP14_SHA256] = kex_gen_server;
crypto/openssh/sshd-session.c
1444
kex->kex[KEX_DH_GRP16_SHA512] = kex_gen_server;
crypto/openssh/sshd-session.c
1445
kex->kex[KEX_DH_GRP18_SHA512] = kex_gen_server;
crypto/openssh/sshd-session.c
1446
kex->kex[KEX_DH_GEX_SHA1] = kexgex_server;
crypto/openssh/sshd-session.c
1447
kex->kex[KEX_DH_GEX_SHA256] = kexgex_server;
crypto/openssh/sshd-session.c
1449
kex->kex[KEX_ECDH_SHA2] = kex_gen_server;
crypto/openssh/sshd-session.c
1452
kex->kex[KEX_C25519_SHA256] = kex_gen_server;
crypto/openssh/sshd-session.c
1453
kex->kex[KEX_KEM_SNTRUP761X25519_SHA512] = kex_gen_server;
crypto/openssh/sshd-session.c
1454
kex->load_host_public_key=&get_hostkey_public_by_type;
crypto/openssh/sshd-session.c
1455
kex->load_host_private_key=&get_hostkey_private_by_type;
crypto/openssh/sshd-session.c
1456
kex->host_key_index=&get_hostkey_index;
crypto/openssh/sshd-session.c
1457
kex->sign = sshd_hostkey_sign;
crypto/openssh/sshd-session.c
1459
ssh_dispatch_run_fatal(ssh, DISPATCH_BLOCK, &kex->done);
crypto/openssh/sshd-session.c
331
pmonitor->m_pkex = &ssh->kex;