Lines Matching refs:kex
237 (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()
1884 ssh->kex->failed_choice); in sshpkt_vfatal()
2187 ssh->kex->server = 1; /* XXX unify? */ in ssh_packet_set_server()
2227 kex_to_blob(struct sshbuf *m, struct kex *kex) in kex_to_blob() argument
2231 if ((r = sshbuf_put_string(m, kex->session_id, in kex_to_blob()
2232 kex->session_id_len)) != 0 || in kex_to_blob()
2233 (r = sshbuf_put_u32(m, kex->we_need)) != 0 || in kex_to_blob()
2234 (r = sshbuf_put_cstring(m, kex->hostkey_alg)) != 0 || in kex_to_blob()
2235 (r = sshbuf_put_u32(m, kex->hostkey_type)) != 0 || in kex_to_blob()
2236 (r = sshbuf_put_u32(m, kex->hostkey_nid)) != 0 || in kex_to_blob()
2237 (r = sshbuf_put_u32(m, kex->kex_type)) != 0 || in kex_to_blob()
2238 (r = sshbuf_put_stringb(m, kex->my)) != 0 || in kex_to_blob()
2239 (r = sshbuf_put_stringb(m, kex->peer)) != 0 || in kex_to_blob()
2240 (r = sshbuf_put_stringb(m, kex->client_version)) != 0 || in kex_to_blob()
2241 (r = sshbuf_put_stringb(m, kex->server_version)) != 0 || in kex_to_blob()
2242 (r = sshbuf_put_u32(m, kex->flags)) != 0) in kex_to_blob()
2298 if ((r = kex_to_blob(m, ssh->kex)) != 0 || in ssh_packet_get_state()
2376 ssh->kex->newkeys[mode] = newkey; in newkeys_from_blob()
2387 kex_from_blob(struct sshbuf *m, struct kex **kexp) in kex_from_blob()
2389 struct kex *kex; in kex_from_blob() local
2392 if ((kex = kex_new()) == NULL) in kex_from_blob()
2394 if ((r = sshbuf_get_string(m, &kex->session_id, &kex->session_id_len)) != 0 || in kex_from_blob()
2395 (r = sshbuf_get_u32(m, &kex->we_need)) != 0 || in kex_from_blob()
2396 (r = sshbuf_get_cstring(m, &kex->hostkey_alg, NULL)) != 0 || in kex_from_blob()
2397 (r = sshbuf_get_u32(m, (u_int *)&kex->hostkey_type)) != 0 || in kex_from_blob()
2398 (r = sshbuf_get_u32(m, (u_int *)&kex->hostkey_nid)) != 0 || in kex_from_blob()
2399 (r = sshbuf_get_u32(m, &kex->kex_type)) != 0 || in kex_from_blob()
2400 (r = sshbuf_get_stringb(m, kex->my)) != 0 || in kex_from_blob()
2401 (r = sshbuf_get_stringb(m, kex->peer)) != 0 || in kex_from_blob()
2402 (r = sshbuf_get_stringb(m, kex->client_version)) != 0 || in kex_from_blob()
2403 (r = sshbuf_get_stringb(m, kex->server_version)) != 0 || in kex_from_blob()
2404 (r = sshbuf_get_u32(m, &kex->flags)) != 0) in kex_from_blob()
2406 kex->server = 1; in kex_from_blob()
2407 kex->done = 1; in kex_from_blob()
2411 kex_free(kex); in kex_from_blob()
2416 *kexp = kex; in kex_from_blob()
2433 if ((r = kex_from_blob(m, &ssh->kex)) != 0 || in ssh_packet_set_state()
2653 if (ssh->kex) in ssh_packet_send_mux()