Home
last modified time | relevance | path

Searched refs:kex (Results 1 – 25 of 43) sorted by relevance

12

/external/openssh/
Dkexgexc.c62 struct kex *kex = ssh->kex; in kexgex_client() local
66 nbits = dh_estimate(kex->dh_need * 8); in kexgex_client()
68 kex->min = DH_GRP_MIN; in kexgex_client()
69 kex->max = DH_GRP_MAX; in kexgex_client()
70 kex->nbits = nbits; in kexgex_client()
72 kex->nbits = MINIMUM(kex->nbits, 4096); in kexgex_client()
75 (r = sshpkt_put_u32(ssh, kex->min)) != 0 || in kexgex_client()
76 (r = sshpkt_put_u32(ssh, kex->nbits)) != 0 || in kexgex_client()
77 (r = sshpkt_put_u32(ssh, kex->max)) != 0 || in kexgex_client()
81 kex->min, kex->nbits, kex->max); in kexgex_client()
[all …]
Dkexdh.c47 kex_dh_keygen(struct kex *kex) in kex_dh_keygen() argument
49 switch (kex->kex_type) { in kex_dh_keygen()
51 kex->dh = dh_new_group1(); in kex_dh_keygen()
55 kex->dh = dh_new_group14(); in kex_dh_keygen()
58 kex->dh = dh_new_group16(); in kex_dh_keygen()
61 kex->dh = dh_new_group18(); in kex_dh_keygen()
66 if (kex->dh == NULL) in kex_dh_keygen()
68 return (dh_gen_key(kex->dh, kex->we_need * 8)); in kex_dh_keygen()
72 kex_dh_compute_key(struct kex *kex, BIGNUM *dh_pub, struct sshbuf *out) in kex_dh_compute_key() argument
84 DHparams_print_fp(stderr, kex->dh); in kex_dh_compute_key()
[all …]
Dkexgexs.c74 struct kex *kex = ssh->kex; in input_kex_dh_gex_request() local
85 kex->nbits = nbits; in input_kex_dh_gex_request()
86 kex->min = min; in input_kex_dh_gex_request()
87 kex->max = max; in input_kex_dh_gex_request()
93 if (kex->max < kex->min || kex->nbits < kex->min || in input_kex_dh_gex_request()
94 kex->max < kex->nbits || kex->max < DH_GRP_MIN) { in input_kex_dh_gex_request()
100 kex->dh = PRIVSEP(choose_dh(min, nbits, max)); in input_kex_dh_gex_request()
101 if (kex->dh == NULL) { in input_kex_dh_gex_request()
107 DH_get0_pqg(kex->dh, &dh_p, NULL, &dh_g); in input_kex_dh_gex_request()
115 if ((r = dh_gen_key(kex->dh, kex->we_need * 8)) != 0) in input_kex_dh_gex_request()
[all …]
Dssh_api.c110 ssh->kex->server = is_server; in ssh_init()
113 ssh->kex->kex[KEX_DH_GRP1_SHA1] = kex_gen_server; in ssh_init()
114 ssh->kex->kex[KEX_DH_GRP14_SHA1] = kex_gen_server; in ssh_init()
115 ssh->kex->kex[KEX_DH_GRP14_SHA256] = kex_gen_server; in ssh_init()
116 ssh->kex->kex[KEX_DH_GRP16_SHA512] = kex_gen_server; in ssh_init()
117 ssh->kex->kex[KEX_DH_GRP18_SHA512] = kex_gen_server; in ssh_init()
118 ssh->kex->kex[KEX_DH_GEX_SHA1] = kexgex_server; in ssh_init()
119 ssh->kex->kex[KEX_DH_GEX_SHA256] = kexgex_server; in ssh_init()
121 ssh->kex->kex[KEX_ECDH_SHA2] = kex_gen_server; in ssh_init()
124 ssh->kex->kex[KEX_C25519_SHA256] = kex_gen_server; in ssh_init()
[all …]
Dkexgen.c101 struct kex *kex = ssh->kex; in kex_gen_client() local
104 switch (kex->kex_type) { in kex_gen_client()
111 r = kex_dh_keypair(kex); in kex_gen_client()
114 r = kex_ecdh_keypair(kex); in kex_gen_client()
118 r = kex_c25519_keypair(kex); in kex_gen_client()
121 r = kex_kem_sntrup4591761x25519_keypair(kex); in kex_gen_client()
130 (r = sshpkt_put_stringb(ssh, kex->client_pub)) != 0 || in kex_gen_client()
141 struct kex *kex = ssh->kex; in input_kex_gen_reply() local
172 switch (kex->kex_type) { in input_kex_gen_reply()
179 r = kex_dh_dec(kex, server_blob, &shared_secret); in input_kex_gen_reply()
[all …]
Dkex.c463 if (ssh->kex->ext_info_c && (ssh->kex->flags & KEX_INITIAL) != 0) in kex_send_newkeys()
473 struct kex *kex = ssh->kex; in kex_input_ext_info() local
498 kex->server_sig_algs = val; in kex_input_ext_info()
511 struct kex *kex = ssh->kex; in kex_input_newkeys() local
521 kex->done = 1; in kex_input_newkeys()
522 kex->flags &= ~KEX_INITIAL; in kex_input_newkeys()
523 sshbuf_reset(kex->peer); in kex_input_newkeys()
525 kex->flags &= ~KEX_INIT_SENT; in kex_input_newkeys()
526 free(kex->name); in kex_input_newkeys()
527 kex->name = NULL; in kex_input_newkeys()
[all …]
Dkexecdh.c46 kex_ecdh_dec_key_group(struct kex *, const struct sshbuf *, EC_KEY *key,
50 kex_ecdh_keypair(struct kex *kex) in kex_ecdh_keypair() argument
58 if ((client_key = EC_KEY_new_by_curve_name(kex->ec_nid)) == NULL) { in kex_ecdh_keypair()
80 kex->ec_client_key = client_key; in kex_ecdh_keypair()
81 kex->ec_group = group; in kex_ecdh_keypair()
83 kex->client_pub = buf; in kex_ecdh_keypair()
92 kex_ecdh_enc(struct kex *kex, const struct sshbuf *client_blob, in kex_ecdh_enc() argument
104 if ((server_key = EC_KEY_new_by_curve_name(kex->ec_nid)) == NULL) { in kex_ecdh_enc()
126 if ((r = kex_ecdh_dec_key_group(kex, client_blob, server_key, group, in kex_ecdh_enc()
138 kex_ecdh_dec_key_group(struct kex *kex, const struct sshbuf *ec_blob, in kex_ecdh_dec_key_group() argument
[all …]
Dkex.h134 struct kex { struct
163 int (*kex[KEX_MAX])(struct ssh *); argument
182 struct kex *kex_new(void); argument
186 void kex_free(struct kex *);
206 int kex_dh_keypair(struct kex *);
207 int kex_dh_enc(struct kex *, const struct sshbuf *, struct sshbuf **,
209 int kex_dh_dec(struct kex *, const struct sshbuf *, struct sshbuf **);
211 int kex_ecdh_keypair(struct kex *);
212 int kex_ecdh_enc(struct kex *, const struct sshbuf *, struct sshbuf **,
214 int kex_ecdh_dec(struct kex *, const struct sshbuf *, struct sshbuf **);
[all …]
Dkexsntrup4591761x25519.c41 kex_kem_sntrup4591761x25519_keypair(struct kex *kex) in kex_kem_sntrup4591761x25519_keypair() argument
53 crypto_kem_sntrup4591761_keypair(cp, kex->sntrup4591761_client_key); in kex_kem_sntrup4591761x25519_keypair()
59 kexc25519_keygen(kex->c25519_client_key, cp); in kex_kem_sntrup4591761x25519_keypair()
63 kex->client_pub = buf; in kex_kem_sntrup4591761x25519_keypair()
71 kex_kem_sntrup4591761x25519_enc(struct kex *kex, in kex_kem_sntrup4591761x25519_enc() argument
127 if ((r = ssh_digest_buffer(kex->hash_alg, buf, hash, sizeof(hash))) != 0) in kex_kem_sntrup4591761x25519_enc()
140 ssh_digest_bytes(kex->hash_alg))) != 0) in kex_kem_sntrup4591761x25519_enc()
158 kex_kem_sntrup4591761x25519_dec(struct kex *kex, in kex_kem_sntrup4591761x25519_dec() argument
191 kex->sntrup4591761_client_key); in kex_kem_sntrup4591761x25519_dec()
192 if ((r = kexc25519_shared_key_ext(kex->c25519_client_key, server_pub, in kex_kem_sntrup4591761x25519_dec()
[all …]
Dkexc25519.c92 kex_c25519_keypair(struct kex *kex) in kex_c25519_keypair() argument
102 kexc25519_keygen(kex->c25519_client_key, cp); in kex_c25519_keypair()
106 kex->client_pub = buf; in kex_c25519_keypair()
114 kex_c25519_enc(struct kex *kex, const struct sshbuf *client_blob, in kex_c25519_enc() argument
166 kex_c25519_dec(struct kex *kex, const struct sshbuf *server_blob, in kex_c25519_dec() argument
188 if ((r = kexc25519_shared_key_ext(kex->c25519_client_key, server_pub, in kex_c25519_dec()
Dssh-keyscan.c284 c->c_ssh->kex->kex[KEX_DH_GRP1_SHA1] = kex_gen_client; in keygrab_ssh2()
285 c->c_ssh->kex->kex[KEX_DH_GRP14_SHA1] = kex_gen_client; in keygrab_ssh2()
286 c->c_ssh->kex->kex[KEX_DH_GRP14_SHA256] = kex_gen_client; in keygrab_ssh2()
287 c->c_ssh->kex->kex[KEX_DH_GRP16_SHA512] = kex_gen_client; in keygrab_ssh2()
288 c->c_ssh->kex->kex[KEX_DH_GRP18_SHA512] = kex_gen_client; in keygrab_ssh2()
289 c->c_ssh->kex->kex[KEX_DH_GEX_SHA1] = kexgex_client; in keygrab_ssh2()
290 c->c_ssh->kex->kex[KEX_DH_GEX_SHA256] = kexgex_client; in keygrab_ssh2()
292 c->c_ssh->kex->kex[KEX_ECDH_SHA2] = kex_gen_client; in keygrab_ssh2()
295 c->c_ssh->kex->kex[KEX_C25519_SHA256] = kex_gen_client; in keygrab_ssh2()
296 c->c_ssh->kex->kex[KEX_KEM_SNTRUP4591761X25519_SHA512] = kex_gen_client; in keygrab_ssh2()
Dpacket.c237 (ssh->kex = kex_new()) == NULL || in ssh_alloc_session_state()
261 kex_free(ssh->kex); in ssh_alloc_session_state()
285 return ssh->state->rekeying || ssh->kex->done == 0; in ssh_packet_is_rekeying()
861 if (ssh->kex && ssh->kex->newkeys[mode]) { in ssh_clear_newkeys()
862 kex_free_newkeys(ssh->kex->newkeys[mode]); in ssh_clear_newkeys()
863 ssh->kex->newkeys[mode] = NULL; in ssh_clear_newkeys()
907 if ((state->newkeys[mode] = ssh->kex->newkeys[mode]) == NULL) in ssh_set_newkeys()
909 ssh->kex->newkeys[mode] = NULL; in ssh_set_newkeys()
1454 if (ssh->kex) in ssh_packet_read_poll2_mux()
1879 if (ssh && ssh->kex && ssh->kex->failed_choice) { in sshpkt_vfatal()
[all …]
Dsshd.c491 pmonitor->m_pkex = &ssh->kex; in privsep_preauth()
2323 struct kex *kex; local
2350 kex = ssh->kex;
2352 kex->kex[KEX_DH_GRP1_SHA1] = kex_gen_server;
2353 kex->kex[KEX_DH_GRP14_SHA1] = kex_gen_server;
2354 kex->kex[KEX_DH_GRP14_SHA256] = kex_gen_server;
2355 kex->kex[KEX_DH_GRP16_SHA512] = kex_gen_server;
2356 kex->kex[KEX_DH_GRP18_SHA512] = kex_gen_server;
2357 kex->kex[KEX_DH_GEX_SHA1] = kexgex_server;
2358 kex->kex[KEX_DH_GEX_SHA256] = kexgex_server;
[all …]
Dmonitor.c1700 struct kex *kex; in monitor_apply_keystate() local
1709 if ((kex = ssh->kex) != NULL) { in monitor_apply_keystate()
1712 kex->kex[KEX_DH_GRP1_SHA1] = kex_gen_server; in monitor_apply_keystate()
1713 kex->kex[KEX_DH_GRP14_SHA1] = kex_gen_server; in monitor_apply_keystate()
1714 kex->kex[KEX_DH_GRP14_SHA256] = kex_gen_server; in monitor_apply_keystate()
1715 kex->kex[KEX_DH_GRP16_SHA512] = kex_gen_server; in monitor_apply_keystate()
1716 kex->kex[KEX_DH_GRP18_SHA512] = kex_gen_server; in monitor_apply_keystate()
1717 kex->kex[KEX_DH_GEX_SHA1] = kexgex_server; in monitor_apply_keystate()
1718 kex->kex[KEX_DH_GEX_SHA256] = kexgex_server; in monitor_apply_keystate()
1720 kex->kex[KEX_ECDH_SHA2] = kex_gen_server; in monitor_apply_keystate()
[all …]
Dsshconnect2.c217 ssh->kex->kex[KEX_DH_GRP1_SHA1] = kex_gen_client; in ssh_kex2()
218 ssh->kex->kex[KEX_DH_GRP14_SHA1] = kex_gen_client; in ssh_kex2()
219 ssh->kex->kex[KEX_DH_GRP14_SHA256] = kex_gen_client; in ssh_kex2()
220 ssh->kex->kex[KEX_DH_GRP16_SHA512] = kex_gen_client; in ssh_kex2()
221 ssh->kex->kex[KEX_DH_GRP18_SHA512] = kex_gen_client; in ssh_kex2()
222 ssh->kex->kex[KEX_DH_GEX_SHA1] = kexgex_client; in ssh_kex2()
223 ssh->kex->kex[KEX_DH_GEX_SHA256] = kexgex_client; in ssh_kex2()
225 ssh->kex->kex[KEX_ECDH_SHA2] = kex_gen_client; in ssh_kex2()
228 ssh->kex->kex[KEX_C25519_SHA256] = kex_gen_client; in ssh_kex2()
229 ssh->kex->kex[KEX_KEM_SNTRUP4591761X25519_SHA512] = kex_gen_client; in ssh_kex2()
[all …]
Dpacket.h40 struct kex;
57 struct kex *kex; member
/external/openssh/regress/unittests/kex/
Dtest_kex.c61 while (!server->kex->done || !client->kex->done) { in run_kex()
74 ASSERT_INT_EQ(server->kex->done, 1); in run_kex()
75 ASSERT_INT_EQ(client->kex->done, 1); in run_kex()
79 do_kex_with_key(char *kex, int keytype, int bits) in do_kex_with_key() argument
98 if (kex != NULL) in do_kex_with_key()
99 kex_params.proposal[PROPOSAL_KEX_ALGS] = kex; in do_kex_with_key()
143 ASSERT_PTR_NE(server2->kex, NULL); in do_kex_with_key()
146 server2->kex->kex[KEX_DH_GRP1_SHA1] = kex_gen_server; in do_kex_with_key()
147 server2->kex->kex[KEX_DH_GRP14_SHA1] = kex_gen_server; in do_kex_with_key()
148 server2->kex->kex[KEX_DH_GEX_SHA1] = kexgex_server; in do_kex_with_key()
[all …]
/external/openssh/regress/misc/kexfuzz/
Dkexfuzz.c179 while (!server->kex->done || !client->kex->done) { in run_kex()
192 ASSERT_INT_EQ(server->kex->done, 1); in run_kex()
193 ASSERT_INT_EQ(client->kex->done, 1); in run_kex()
197 do_kex_with_key(const char *kex, struct sshkey *prvkey, int *c2s, int *s2c, in do_kex_with_key() argument
215 if (kex != NULL) in do_kex_with_key()
216 kex_params.proposal[PROPOSAL_KEX_ALGS] = strdup(kex); in do_kex_with_key()
269 kex_free(server2->kex); /* XXX or should ssh_packet_set_state()? */ in do_kex_with_key()
273 ASSERT_PTR_NE(server2->kex, NULL); in do_kex_with_key()
276 server2->kex->kex[KEX_DH_GRP1_SHA1] = kex_gen_server; in do_kex_with_key()
277 server2->kex->kex[KEX_DH_GRP14_SHA1] = kex_gen_server; in do_kex_with_key()
[all …]
/external/libwebsockets/plugins/ssh-base/
Dkex-25519.c312 struct lws_kex *kex = pss->kex; in kex_ecdh() local
352 lws_get_random(pss->vhd->context, kex->eph_pri_key, LWS_SIZE_EC25519); in kex_ecdh()
353 kex->eph_pri_key[0] &= 248; in kex_ecdh()
354 kex->eph_pri_key[31] &= 127; in kex_ecdh()
355 kex->eph_pri_key[31] |= 64; in kex_ecdh()
366 crypto_scalarmult_curve25519(kex->Q_S, kex->eph_pri_key, basepoint); in kex_ecdh()
369 for (r = 0; r < (int)sizeof(kex->Q_S); r++) in kex_ecdh()
370 a |= kex->Q_S[r]; in kex_ecdh()
383 crypto_scalarmult_curve25519(pss->K, kex->eph_pri_key, kex->Q_C); in kex_ecdh()
421 if (_genhash_update_len(&ctx, kex->I_C, kex->I_C_payload_len)) in kex_ecdh()
[all …]
Dsshd.c301 struct lws_kex *kex = pss->kex; in handle_name() local
309 kex->match_bitfield |= 1; in handle_name()
321 kex->match_bitfield |= 2; in handle_name()
328 kex->match_bitfield |= 4; in handle_name()
332 kex->match_bitfield |= 8; in handle_name()
336 kex->match_bitfield |= 16; in handle_name()
340 kex->match_bitfield |= 32; in handle_name()
344 kex->match_bitfield |= 64; in handle_name()
348 kex->match_bitfield |= 128; in handle_name()
364 pss->kex = sshd_zalloc(sizeof(struct lws_kex)); in lws_kex_create()
[all …]
/external/openssh/regress/
Ddhgex.sh10 kexs=`${SSH} -Q kex | grep diffie-hellman-group-exchange`
16 kex="$1"; shift
19 echo "KexAlgorithms=$kex" >> $OBJ/sshd_proxy
22 opts="-oKexAlgorithms=$kex -oCiphers=$cipher"
26 verbose "$tid bits $bits $kex $cipher"
Dkeygen-moduli.sh7 for kex in `${SSH} -Q kex`; do
8 case $kex in
Drekey.sh40 for i in `${SSH} -Q kex`; do
58 for kex in `${SSH} -Q kex`; do
59 verbose "client rekey $c $kex"
60 ssh_data_rekeying "KexAlgorithms=$kex" -oRekeyLimit=256k -oCiphers=$c
Dkextype.sh11 ALLKEX=`${SSH} -Q kex`
16 for k in `${SSH} -Q kex`; do
/external/libjpeg-turbo/
Djdarith.c442 int tbl, k, kex; in decode_mcu_AC_refine() local
462 for (kex = cinfo->Se; kex > 0; kex--) in decode_mcu_AC_refine()
463 if ((*block)[jpeg_natural_order[kex]]) break; in decode_mcu_AC_refine()
467 if (k > kex) in decode_mcu_AC_refine()

12