Lines Matching defs:kex

68 #include "kex.h"
217 (ssh->kex = kex_new()) == NULL ||
241 kex_free(ssh->kex);
266 (ssh->kex != NULL && ssh->kex->done == 0);
329 kex_free(ssh->kex);
330 ssh->kex = NULL;
713 kex_free(ssh->kex);
714 ssh->kex = NULL;
922 if (ssh->kex && ssh->kex->newkeys[mode]) {
923 kex_free_newkeys(ssh->kex->newkeys[mode]);
924 ssh->kex->newkeys[mode] = NULL;
967 /* move newkeys from kex to state */
968 if ((state->newkeys[mode] = ssh->kex->newkeys[mode]) == NULL)
970 ssh->kex->newkeys[mode] = NULL;
1278 if ((ssh->kex->flags & KEX_INITIAL) != 0) {
1291 if (type == SSH2_MSG_NEWKEYS && ssh->kex->kex_strict) {
1502 if (ssh->kex)
1688 if ((ssh->kex->flags & KEX_INITIAL) != 0) {
1759 if (*typep == SSH2_MSG_NEWKEYS && ssh->kex->kex_strict) {
1814 if (ssh->kex != NULL &&
1815 (ssh->kex->flags & KEX_INITIAL) && ssh->kex->kex_strict)
1990 if (ssh->kex && ssh->kex->failed_choice) {
1995 ssh->kex->failed_choice);
2272 ssh->kex->server = 1; /* XXX unify? */
2310 /* turn kex into a blob for packet state serialization */
2312 kex_to_blob(struct sshbuf *m, struct kex *kex)
2316 if ((r = sshbuf_put_u32(m, kex->we_need)) != 0 ||
2317 (r = sshbuf_put_cstring(m, kex->hostkey_alg)) != 0 ||
2318 (r = sshbuf_put_u32(m, kex->hostkey_type)) != 0 ||
2319 (r = sshbuf_put_u32(m, kex->hostkey_nid)) != 0 ||
2320 (r = sshbuf_put_u32(m, kex->kex_type)) != 0 ||
2321 (r = sshbuf_put_u32(m, kex->kex_strict)) != 0 ||
2322 (r = sshbuf_put_stringb(m, kex->my)) != 0 ||
2323 (r = sshbuf_put_stringb(m, kex->peer)) != 0 ||
2324 (r = sshbuf_put_stringb(m, kex->client_version)) != 0 ||
2325 (r = sshbuf_put_stringb(m, kex->server_version)) != 0 ||
2326 (r = sshbuf_put_stringb(m, kex->session_id)) != 0 ||
2327 (r = sshbuf_put_u32(m, kex->flags)) != 0)
2383 if ((r = kex_to_blob(m, ssh->kex)) != 0 ||
2461 ssh->kex->newkeys[mode] = newkey;
2470 /* restore kex from blob for packet state de-serialization */
2472 kex_from_blob(struct sshbuf *m, struct kex **kexp)
2474 struct kex *kex;
2477 if ((kex = kex_new()) == NULL)
2479 if ((r = sshbuf_get_u32(m, &kex->we_need)) != 0 ||
2480 (r = sshbuf_get_cstring(m, &kex->hostkey_alg, NULL)) != 0 ||
2481 (r = sshbuf_get_u32(m, (u_int *)&kex->hostkey_type)) != 0 ||
2482 (r = sshbuf_get_u32(m, (u_int *)&kex->hostkey_nid)) != 0 ||
2483 (r = sshbuf_get_u32(m, &kex->kex_type)) != 0 ||
2484 (r = sshbuf_get_u32(m, &kex->kex_strict)) != 0 ||
2485 (r = sshbuf_get_stringb(m, kex->my)) != 0 ||
2486 (r = sshbuf_get_stringb(m, kex->peer)) != 0 ||
2487 (r = sshbuf_get_stringb(m, kex->client_version)) != 0 ||
2488 (r = sshbuf_get_stringb(m, kex->server_version)) != 0 ||
2489 (r = sshbuf_get_stringb(m, kex->session_id)) != 0 ||
2490 (r = sshbuf_get_u32(m, &kex->flags)) != 0)
2492 kex->server = 1;
2493 kex->done = 1;
2497 kex_free(kex);
2502 *kexp = kex;
2519 if ((r = kex_from_blob(m, &ssh->kex)) != 0 ||
2740 if (ssh->kex)