Home | History | Annotate | Download | only in openssh

Lines Matching refs:ssh

68 static int kex_choose_conf(struct ssh *);
311 kex_reset_dispatch(struct ssh *ssh)
313 ssh_dispatch_range(ssh, SSH2_MSG_TRANSPORT_MIN,
315 ssh_dispatch_set(ssh, SSH2_MSG_KEXINIT, &kex_input_kexinit);
319 kex_send_newkeys(struct ssh *ssh)
323 kex_reset_dispatch(ssh);
324 if ((r = sshpkt_start(ssh, SSH2_MSG_NEWKEYS)) != 0 ||
325 (r = sshpkt_send(ssh)) != 0)
329 ssh_dispatch_set(ssh, SSH2_MSG_NEWKEYS, &kex_input_newkeys);
336 struct ssh *ssh = ctxt;
337 struct kex *kex = ssh->kex;
341 ssh_dispatch_set(ssh, SSH2_MSG_NEWKEYS, &kex_protocol_error);
342 if ((r = sshpkt_get_end(ssh)) != 0)
354 kex_send_kexinit(struct ssh *ssh)
357 struct kex *kex = ssh->kex;
373 if ((r = sshpkt_start(ssh, SSH2_MSG_KEXINIT)) != 0 ||
374 (r = sshpkt_putb(ssh, kex->my)) != 0 ||
375 (r = sshpkt_send(ssh)) != 0)
386 struct ssh *ssh = ctxt;
387 struct kex *kex = ssh->kex;
397 ptr = sshpkt_ptr(ssh, &dlen);
403 if ((r = sshpkt_get_u8(ssh, NULL)) != 0)
406 if ((r = sshpkt_get_string(ssh, NULL, NULL)) != 0)
418 if ((r = sshpkt_get_u8(ssh, NULL)) != 0 || /* first_kex_follows */
419 (r = sshpkt_get_u32(ssh, NULL)) != 0 || /* reserved */
420 (r = sshpkt_get_end(ssh)) != 0)
424 if ((r = kex_send_kexinit(ssh)) != 0)
426 if ((r = kex_choose_conf(ssh)) != 0)
430 return (kex->kex[kex->kex_type])(ssh);
436 kex_new(struct ssh *ssh, char *proposal[PROPOSAL_MAX], struct kex **kexp)
452 kex_reset_dispatch(ssh);
519 kex_setup(struct ssh *ssh, char *proposal[PROPOSAL_MAX])
523 if ((r = kex_new(ssh, proposal, &ssh->kex)) != 0)
525 if ((r = kex_send_kexinit(ssh)) != 0) { /* we start */
526 kex_free(ssh->kex);
527 ssh->kex = NULL;
553 choose_mac(struct ssh *ssh, struct sshmac *mac, char *client, char *server)
562 if (ssh->compat & SSH_BUG_HMAC)
647 kex_choose_conf(struct ssh *ssh)
649 struct kex *kex = ssh->kex;
701 (r = choose_mac(ssh, &newkeys->mac, cprop[nmac],
749 !(ssh->compat & SSH_BUG_FIRSTKEX))
750 ssh->dispatch_skip_packets = 1;
759 derive_key(struct ssh *ssh, int id, u_int need, u_char *hash, u_int hashlen,
762 struct kex *kex = ssh->kex;
824 kex_derive_keys(struct ssh *ssh, u_char *hash, u_int hashlen,
827 struct kex *kex = ssh->kex;
833 if ((r = derive_key(ssh, 'A'+i, kex->we_need, hash, hashlen,
852 kex_derive_keys_bn(struct ssh *ssh, u_char *hash, u_int hashlen,
861 r = kex_derive_keys(ssh, hash, hashlen, shared_secret);