Lines Matching refs:kex

301 	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()
366 return !pss->kex; in lws_kex_create()
372 if (!pss->kex) in lws_kex_destroy()
377 if (pss->kex->I_C) { in lws_kex_destroy()
378 free(pss->kex->I_C); in lws_kex_destroy()
379 pss->kex->I_C = NULL; in lws_kex_destroy()
381 if (pss->kex->I_S) { in lws_kex_destroy()
382 free(pss->kex->I_S); in lws_kex_destroy()
383 pss->kex->I_S = NULL; in lws_kex_destroy()
386 lws_explicit_bzero(pss->kex, sizeof(*pss->kex)); in lws_kex_destroy()
387 free(pss->kex); in lws_kex_destroy()
388 pss->kex = NULL; in lws_kex_destroy()
642 if (!pss->kex) { in lws_ssh_parse_plaintext()
647 pss->kex->I_C_payload_len = 0; in lws_ssh_parse_plaintext()
648 pss->kex->I_C_alloc_len = pss->msg_len; in lws_ssh_parse_plaintext()
649 pss->kex->I_C = sshd_zalloc(pss->kex->I_C_alloc_len); in lws_ssh_parse_plaintext()
650 if (!pss->kex->I_C) { in lws_ssh_parse_plaintext()
654 pss->kex->I_C[pss->kex->I_C_payload_len++] = in lws_ssh_parse_plaintext()
676 pss->active_keys_cts = pss->kex->keys_next_cts; in lws_ssh_parse_plaintext()
680 pss->kex->newkeys |= 2; in lws_ssh_parse_plaintext()
681 if (pss->kex->newkeys == 3) in lws_ssh_parse_plaintext()
818 pss->kex->kex_cookie[pss->ctr++] = *p++; in lws_ssh_parse_plaintext()
819 if (pss->ctr != sizeof(pss->kex->kex_cookie)) in lws_ssh_parse_plaintext()
910 pss->kex->Q_C[pss->ctr++] = *p++; in lws_ssh_parse_plaintext()
940 if (pss->kex->match_bitfield != 0xff) { in lws_ssh_parse_plaintext()
944 if (kex_ecdh(pss, pss->kex->kex_r, in lws_ssh_parse_plaintext()
945 &pss->kex->kex_r_len)) { in lws_ssh_parse_plaintext()
1862 if (pss->copy_to_I_C && pss->kex->I_C_payload_len < in parse()
1863 pss->kex->I_C_alloc_len && in parse()
1865 pss->kex->I_C[pss->kex->I_C_payload_len++] = *p; in parse()
2137 if (!pss->kex) { in lws_callback_raw_sshd()
2144 if (pss->kex->I_S) in lws_callback_raw_sshd()
2145 free(pss->kex->I_S); in lws_callback_raw_sshd()
2146 pss->kex->I_S = sshd_zalloc(m); in lws_callback_raw_sshd()
2147 if (!pss->kex->I_S) { in lws_callback_raw_sshd()
2153 memcpy(pss->kex->I_S, buf + LWS_PRE + 5, m); in lws_callback_raw_sshd()
2154 pss->kex->I_S_payload_len = m; /* without padding */ in lws_callback_raw_sshd()
2158 memcpy(ps, pss->kex->kex_r, pss->kex->kex_r_len); in lws_callback_raw_sshd()
2160 ps + pss->kex->kex_r_len, pss, 1); in lws_callback_raw_sshd()
2439 pss->active_keys_stc = pss->kex->keys_next_stc; in lws_callback_raw_sshd()
2442 pss->kex->newkeys |= 1; in lws_callback_raw_sshd()
2443 if (pss->kex->newkeys == 3) in lws_callback_raw_sshd()