Lines Matching defs:ssh
58 #include "ssh.h"
86 #include "ssh-gss.h"
162 struct ssh *the_active_state;
164 /* global key/cert auth options. XXX move to permanent ssh->authctxt? */
294 privsep_preauth(struct ssh *ssh)
302 pmonitor->m_pkex = &ssh->kex;
316 monitor_child_preauth(ssh, pmonitor);
352 if (ssh_packet_get_connection_in(ssh) != STDIN_FILENO &&
353 dup2(ssh_packet_get_connection_in(ssh), STDIN_FILENO) == -1)
355 if (ssh_packet_get_connection_out(ssh) != STDOUT_FILENO &&
356 dup2(ssh_packet_get_connection_out(ssh),
378 privsep_postauth(struct ssh *ssh, Authctxt *authctxt)
389 monitor_clear_keystate(ssh, pmonitor);
390 monitor_child_postauth(ssh, pmonitor);
408 monitor_apply_keystate(ssh, pmonitor);
414 ssh_packet_set_authenticated(ssh);
418 get_hostkey_by_type(int type, int nid, int need_private, struct ssh *ssh)
459 get_hostkey_public_by_type(int type, int nid, struct ssh *ssh)
461 return get_hostkey_by_type(type, nid, 0, ssh);
465 get_hostkey_private_by_type(int type, int nid, struct ssh *ssh)
467 return get_hostkey_by_type(type, nid, 1, ssh);
479 get_hostkey_public_by_index(int ind, struct ssh *ssh)
487 get_hostkey_index(struct sshkey *key, int compare, struct ssh *ssh)
514 notify_hostkeys(struct ssh *ssh)
523 if (ssh->compat & SSH_BUG_HOSTKEYS)
529 key = get_hostkey_public_by_index(i, ssh);
542 if ((r = sshpkt_start(ssh, SSH2_MSG_GLOBAL_REQUEST)) != 0 ||
543 (r = sshpkt_put_cstring(ssh, "hostkeys-00@openssh.com")) != 0 ||
544 (r = sshpkt_put_u8(ssh, 0)) != 0) /* want reply */
545 sshpkt_fatal(ssh, r, "%s: start request", __func__);
551 if ((r = sshpkt_put_stringb(ssh, buf)) != 0)
552 sshpkt_fatal(ssh, r, "%s: append key", __func__);
558 if ((r = sshpkt_send(ssh)) != 0)
559 sshpkt_fatal(ssh, r, "%s: send", __func__);
692 check_ip_options(struct ssh *ssh)
694 int sock_in = ssh_packet_get_connection_in(ssh);
715 ssh_remote_ipaddr(ssh), ssh_remote_port(ssh), text);
721 set_process_rdomain(struct ssh *ssh, const char *name)
731 if ((name = ssh_packet_rdomain_in(ssh)) == NULL)
750 struct ssh *ssh = NULL;
860 connection_info = server_get_connection_info(ssh, 0, 0);
1094 if ((ssh = ssh_packet_set_connection(NULL, sock_in, sock_out)) == NULL)
1096 the_active_state = ssh;
1097 ssh_packet_set_server(ssh);
1099 check_ip_options(ssh);
1102 channel_init_channels(ssh);
1103 channel_set_af(ssh, options.address_family);
1104 server_process_channel_timeouts(ssh);
1105 server_process_permitopen(ssh);
1108 if (options.tcp_keep_alive && ssh_packet_connection_is_on_socket(ssh) &&
1112 if ((remote_port = ssh_remote_port(ssh)) < 0) {
1122 remote_ip = ssh_remote_ipaddr(ssh);
1124 rdomain = ssh_packet_rdomain_in(ssh);
1129 remote_ip, remote_port, laddr, ssh_local_port(ssh),
1156 if ((r = kex_exchange_identification(ssh, -1,
1158 sshpkt_fatal(ssh, r, "banner exchange");
1160 ssh_packet_set_nonblocking(ssh);
1164 ssh->authctxt = authctxt;
1178 if (privsep_preauth(ssh) != 1)
1201 set_process_rdomain(ssh, options.routing_domain);
1207 privsep_postauth(ssh, authctxt);
1210 ssh_packet_set_timeout(ssh, options.client_alive_interval,
1214 notify_hostkeys(ssh);
1217 do_authenticated(ssh, authctxt);
1220 ssh_packet_get_bytes(ssh, &ibytes, &obytes);
1225 ssh_packet_close(ssh);
1233 sshd_hostkey_sign(struct ssh *ssh, struct sshkey *privkey,
1238 if (mm_sshkey_sign(ssh, privkey, signature, slenp,
1240 ssh->compat) < 0)
1243 if (mm_sshkey_sign(ssh, pubkey, signature, slenp,
1245 ssh->compat) < 0)