Home
last modified time | relevance | path

Searched refs:ssh (Results 1 – 25 of 195) sorted by relevance

12345678

/netbsd/src/crypto/external/bsd/openssh/dist/
Dpacket.h49 struct ssh { struct
88 typedef int (ssh_packet_hook_fn)(struct ssh *, struct sshbuf *, argument
91 struct ssh *ssh_alloc_session_state(void);
92 struct ssh *ssh_packet_set_connection(struct ssh *, int, int);
93 void ssh_packet_set_timeout(struct ssh *, int, int);
94 int ssh_packet_stop_discard(struct ssh *);
95 int ssh_packet_connection_af(struct ssh *);
96 void ssh_packet_set_nonblocking(struct ssh *);
97 int ssh_packet_get_connection_in(struct ssh *);
98 int ssh_packet_get_connection_out(struct ssh *);
[all …]
Dpacket.c215 struct ssh *
218 struct ssh *ssh = NULL; in ssh_alloc_session_state() local
221 if ((ssh = calloc(1, sizeof(*ssh))) == NULL || in ssh_alloc_session_state()
223 (ssh->kex = kex_new()) == NULL || in ssh_alloc_session_state()
230 TAILQ_INIT(&ssh->private_keys); in ssh_alloc_session_state()
231 TAILQ_INIT(&ssh->public_keys); in ssh_alloc_session_state()
243 ssh->state = state; in ssh_alloc_session_state()
244 return ssh; in ssh_alloc_session_state()
246 if (ssh) { in ssh_alloc_session_state()
247 kex_free(ssh->kex); in ssh_alloc_session_state()
[all …]
Dssh_api.c43 int _ssh_exchange_banner(struct ssh *);
44 int _ssh_send_banner(struct ssh *, struct sshbuf *);
45 int _ssh_read_banner(struct ssh *, struct sshbuf *);
46 int _ssh_order_hostkeyalgs(struct ssh *);
47 int _ssh_verify_host_key(struct sshkey *, struct ssh *);
48 struct sshkey *_ssh_host_public_key(int, int, struct ssh *);
49 struct sshkey *_ssh_host_private_key(int, int, struct ssh *);
50 int _ssh_host_key_sign(struct ssh *, struct sshkey *, struct sshkey *,
88 ssh_init(struct ssh **sshp, int is_server, struct kex_params *kex_params) in ssh_init()
92 struct ssh *ssh; in ssh_init() local
[all …]
Dserverloop.c98 static void server_init_dispatch(struct ssh *);
123 client_alive_check(struct ssh *ssh) in client_alive_check() argument
130 ssh_packet_inc_alive_timeouts(ssh) > in client_alive_check()
132 sshpkt_fmt_connection_id(ssh, remote_id, sizeof(remote_id)); in client_alive_check()
141 if ((channel_id = channel_find_open(ssh)) == -1) { in client_alive_check()
142 if ((r = sshpkt_start(ssh, SSH2_MSG_GLOBAL_REQUEST)) != 0 || in client_alive_check()
143 (r = sshpkt_put_cstring(ssh, "keepalive@openssh.com")) in client_alive_check()
145 (r = sshpkt_put_u8(ssh, 1)) != 0) /* boolean: want reply */ in client_alive_check()
148 channel_request_start(ssh, channel_id, in client_alive_check()
151 if ((r = sshpkt_send(ssh)) != 0) in client_alive_check()
[all …]
Dchannels.h86 struct ssh;
90 typedef void channel_open_fn(struct ssh *, int, int, void *);
91 typedef void channel_callback_fn(struct ssh *, int, int, void *);
92 typedef int channel_infilter_fn(struct ssh *, struct Channel *, const char *,
94 typedef void channel_filter_cleanup_fn(struct ssh *, int, void *);
95 typedef u_char *channel_outfilter_fn(struct ssh *, struct Channel *,
99 typedef void channel_confirm_cb(struct ssh *, int, struct Channel *, void *);
100 typedef void channel_confirm_abandon_cb(struct ssh *, struct Channel *, void *);
117 typedef int mux_callback_fn(struct ssh *, struct Channel *);
284 void channel_init_channels(struct ssh *ssh);
[all …]
Dchannels.c104 typedef void chan_fn(struct ssh *, Channel *c);
219 static void port_open_helper(struct ssh *ssh, Channel *c, const char *rtype);
225 static Channel *rdynamic_connect_prepare(struct ssh *, const char *,
227 static int rdynamic_connect_finish(struct ssh *, Channel *);
235 channel_init_channels(struct ssh *ssh) in channel_init_channels() argument
246 ssh->chanctxt = sc; in channel_init_channels()
250 channel_by_id(struct ssh *ssh, int id) in channel_by_id() argument
254 if (id < 0 || (u_int)id >= ssh->chanctxt->channels_alloc) { in channel_by_id()
258 c = ssh->chanctxt->channels[id]; in channel_by_id()
267 channel_by_remote_id(struct ssh *ssh, u_int remote_id) in channel_by_remote_id() argument
[all …]
Dauth2-gss.c57 static int input_gssapi_token(int type, u_int32_t plen, struct ssh *ssh);
58 static int input_gssapi_mic(int type, u_int32_t plen, struct ssh *ssh);
59 static int input_gssapi_exchange_complete(int type, u_int32_t plen, struct ssh *ssh);
60 static int input_gssapi_errtok(int, u_int32_t, struct ssh *);
67 userauth_gssapi(struct ssh *ssh, const char *method) in userauth_gssapi() argument
69 Authctxt *authctxt = ssh->authctxt; in userauth_gssapi()
78 if ((r = sshpkt_get_u32(ssh, &mechs)) != 0) in userauth_gssapi()
96 if ((r = sshpkt_get_string(ssh, &doid, &len)) != 0) in userauth_gssapi()
132 if ((r = sshpkt_start(ssh, SSH2_MSG_USERAUTH_GSSAPI_RESPONSE)) != 0 || in userauth_gssapi()
133 (r = sshpkt_put_string(ssh, doid, len)) != 0 || in userauth_gssapi()
[all …]
Dsshconnect2.c82 const char *auth_get_canonical_hostname(struct ssh *, int);
88 static int userauth_kerberos(struct ssh *);
108 verify_host_key_callback(struct sshkey *hostkey, struct ssh *ssh) in verify_host_key_callback() argument
232 ssh_kex2(struct ssh *ssh, char *host, struct sockaddr *hostaddr, u_short port, in ssh_kex2() argument
244 ssh_packet_set_rekey_limits(ssh, options.rekey_limit, in ssh_kex2()
267 kex_proposal_populate_entries(ssh, myproposal, in ssh_kex2()
275 if ((r = kex_setup(ssh, myproposal)) != 0) in ssh_kex2()
278 ssh->kex->kex[KEX_DH_GRP1_SHA1] = kex_gen_client; in ssh_kex2()
279 ssh->kex->kex[KEX_DH_GRP14_SHA1] = kex_gen_client; in ssh_kex2()
280 ssh->kex->kex[KEX_DH_GRP14_SHA256] = kex_gen_client; in ssh_kex2()
[all …]
Dkex.c70 static int kex_choose_conf(struct ssh *, uint32_t seq);
71 static int kex_input_newkeys(int, u_int32_t, struct ssh *);
93 kex_proposal_populate_entries(struct ssh *ssh, char *prop[PROPOSAL_MAX], in kex_proposal_populate_entries() argument
99 const char **defprop = ssh->kex->server ? defpropserver : defpropclient; in kex_proposal_populate_entries()
109 if ((cp = kex_names_cat(kexalgos, ssh->kex->server ? in kex_proposal_populate_entries()
117 prop[i] = compat_kex_proposal(ssh, cp); in kex_proposal_populate_entries()
238 kex_protocol_error(int type, u_int32_t seq, struct ssh *ssh) in kex_protocol_error() argument
243 if ((ssh->kex->flags & KEX_INITIAL) && ssh->kex->kex_strict) { in kex_protocol_error()
244 ssh_packet_disconnect(ssh, "strict KEX violation: " in kex_protocol_error()
248 if ((r = sshpkt_start(ssh, SSH2_MSG_UNIMPLEMENTED)) != 0 || in kex_protocol_error()
[all …]
Dnchan.c79 static void chan_send_eof2(struct ssh *, Channel *);
80 static void chan_send_eow2(struct ssh *, Channel *);
83 static void chan_shutdown_write(struct ssh *, Channel *);
84 static void chan_shutdown_read(struct ssh *, Channel *);
85 static void chan_shutdown_extended_read(struct ssh *, Channel *);
115 chan_read_failed(struct ssh *ssh, Channel *c) in chan_read_failed() argument
120 chan_shutdown_read(ssh, c); in chan_read_failed()
131 chan_ibuf_empty(struct ssh *ssh, Channel *c) in chan_ibuf_empty() argument
142 chan_send_eof2(ssh, c); in chan_ibuf_empty()
153 chan_obuf_empty(struct ssh *ssh, Channel *c) in chan_obuf_empty() argument
[all …]
Ddispatch.c41 dispatch_protocol_error(int type, u_int32_t seq, struct ssh *ssh) in dispatch_protocol_error() argument
46 if ((r = sshpkt_start(ssh, SSH2_MSG_UNIMPLEMENTED)) != 0 || in dispatch_protocol_error()
47 (r = sshpkt_put_u32(ssh, seq)) != 0 || in dispatch_protocol_error()
48 (r = sshpkt_send(ssh)) != 0 || in dispatch_protocol_error()
49 (r = ssh_packet_write_wait(ssh)) < 0) in dispatch_protocol_error()
50 sshpkt_fatal(ssh, r, "%s", __func__); in dispatch_protocol_error()
55 dispatch_protocol_ignore(int type, u_int32_t seq, struct ssh *ssh) in dispatch_protocol_ignore() argument
62 ssh_dispatch_init(struct ssh *ssh, dispatch_fn *dflt) in ssh_dispatch_init() argument
66 ssh->dispatch[i] = dflt; in ssh_dispatch_init()
70 ssh_dispatch_range(struct ssh *ssh, u_int from, u_int to, dispatch_fn *fn) in ssh_dispatch_range() argument
[all …]
Dclientloop.c164 static void client_init_dispatch(struct ssh *ssh);
244 set_control_persist_exit_time(struct ssh *ssh) in set_control_persist_exit_time() argument
250 } else if (channel_still_open(ssh)) { in set_control_persist_exit_time()
288 client_x11_get_proto(struct ssh *ssh, const char *display, in client_x11_get_proto() argument
383 channel_set_x11_refuse_time(ssh, in client_x11_get_proto()
459 client_check_window_change(struct ssh *ssh) in client_check_window_change() argument
465 channel_send_window_changes(ssh); in client_check_window_change()
469 client_global_request_reply(int type, u_int32_t seq, struct ssh *ssh) in client_global_request_reply() argument
476 gc->cb(ssh, type, seq, gc->ctx); in client_global_request_reply()
482 ssh_packet_set_alive_timeouts(ssh, 0); in client_global_request_reply()
[all …]
Dssh_api.h44 int ssh_init(struct ssh **, int is_server, struct kex_params *kex_params);
49 void ssh_free(struct ssh *);
54 void ssh_set_app_data(struct ssh *, void *);
55 void *ssh_get_app_data(struct ssh *);
65 int ssh_add_hostkey(struct ssh *ssh, struct sshkey *key);
73 int ssh_set_verify_host_key_callback(struct ssh *ssh,
74 int (*cb)(struct sshkey *, struct ssh *));
90 int ssh_packet_next(struct ssh *ssh, u_char *typep);
97 const u_char *ssh_packet_payload(struct ssh *ssh, size_t *lenp);
104 int ssh_packet_put(struct ssh *ssh, int type, const u_char *data,
[all …]
Dsession.c108 void session_set_fds(struct ssh *, Session *, int, int, int, int, int);
111 int session_setup_x11fwd(struct ssh *, Session *);
112 int do_exec_pty(struct ssh *, Session *, const char *);
113 int do_exec_no_pty(struct ssh *, Session *, const char *);
114 int do_exec(struct ssh *, Session *, const char *);
115 void do_login(struct ssh *, Session *, const char *);
116 __dead void do_child(struct ssh *, Session *, const char *);
120 static void do_authenticated2(struct ssh *, Authctxt *);
122 static int session_pty_req(struct ssh *, Session *);
177 auth_input_request_forwarding(struct ssh *ssh, struct passwd * pw) in auth_input_request_forwarding() argument
[all …]
Dkexgexs.c56 static int input_kex_dh_gex_request(int, u_int32_t, struct ssh *);
57 static int input_kex_dh_gex_init(int, u_int32_t, struct ssh *);
60 kexgex_server(struct ssh *ssh) in kexgex_server() argument
62 ssh_dispatch_set(ssh, SSH2_MSG_KEX_DH_GEX_REQUEST, in kexgex_server()
69 input_kex_dh_gex_request(int type, u_int32_t seq, struct ssh *ssh) in input_kex_dh_gex_request() argument
71 struct kex *kex = ssh->kex; in input_kex_dh_gex_request()
77 ssh_dispatch_set(ssh, SSH2_MSG_KEX_DH_GEX_REQUEST, &kex_protocol_error); in input_kex_dh_gex_request()
79 if ((r = sshpkt_get_u32(ssh, &min)) != 0 || in input_kex_dh_gex_request()
80 (r = sshpkt_get_u32(ssh, &nbits)) != 0 || in input_kex_dh_gex_request()
81 (r = sshpkt_get_u32(ssh, &max)) != 0 || in input_kex_dh_gex_request()
[all …]
Dkexgexc.c54 static int input_kex_dh_gex_group(int, u_int32_t, struct ssh *);
55 static int input_kex_dh_gex_reply(int, u_int32_t, struct ssh *);
58 kexgex_client(struct ssh *ssh) in kexgex_client() argument
60 struct kex *kex = ssh->kex; in kexgex_client()
69 if (ssh->compat & SSH_BUG_DHGEX_LARGE) in kexgex_client()
72 if ((r = sshpkt_start(ssh, SSH2_MSG_KEX_DH_GEX_REQUEST)) != 0 || in kexgex_client()
73 (r = sshpkt_put_u32(ssh, kex->min)) != 0 || in kexgex_client()
74 (r = sshpkt_put_u32(ssh, kex->nbits)) != 0 || in kexgex_client()
75 (r = sshpkt_put_u32(ssh, kex->max)) != 0 || in kexgex_client()
76 (r = sshpkt_send(ssh)) != 0) in kexgex_client()
[all …]
Dauth2.c105 static int input_service_request(int, u_int32_t, struct ssh *);
106 static int input_userauth_request(int, u_int32_t, struct ssh *);
153 userauth_send_banner(struct ssh *ssh, const char *msg) in userauth_send_banner() argument
157 if ((r = sshpkt_start(ssh, SSH2_MSG_USERAUTH_BANNER)) != 0 || in userauth_send_banner()
158 (r = sshpkt_put_cstring(ssh, msg)) != 0 || in userauth_send_banner()
159 (r = sshpkt_put_cstring(ssh, "")) != 0 || /* language, unused */ in userauth_send_banner()
160 (r = sshpkt_send(ssh)) != 0) in userauth_send_banner()
166 userauth_banner(struct ssh *ssh) in userauth_banner() argument
175 userauth_send_banner(ssh, banner); in userauth_banner()
185 do_authentication2(struct ssh *ssh) in do_authentication2() argument
[all …]
Dauth2-chall.c54 static int auth2_challenge_start(struct ssh *);
55 static int send_userauth_info_request(struct ssh *);
56 static int input_userauth_info_response(int, u_int32_t, struct ssh *);
202 auth2_challenge(struct ssh *ssh, char *devs) in auth2_challenge() argument
204 Authctxt *authctxt = ssh->authctxt; in auth2_challenge()
213 return auth2_challenge_start(ssh); in auth2_challenge()
218 auth2_challenge_stop(struct ssh *ssh) in auth2_challenge_stop() argument
220 Authctxt *authctxt = ssh->authctxt; in auth2_challenge_stop()
222 ssh_dispatch_set(ssh, SSH2_MSG_USERAUTH_INFO_RESPONSE, NULL); in auth2_challenge_stop()
231 auth2_challenge_start(struct ssh *ssh) in auth2_challenge_start() argument
[all …]
Dauth.h48 struct ssh;
121 int (*userauth)(struct ssh *, const char *);
144 int auth_password(struct ssh *, const char *);
146 int hostbased_key_allowed(struct ssh *, struct passwd *,
148 int user_key_allowed(struct ssh *ssh, struct passwd *, struct sshkey *,
164 int auth_krb5(struct ssh *, krb5_data *auth, char **client, krb5_data *);
170 void do_authentication2(struct ssh *);
172 void auth_log(struct ssh *, int, int, const char *, const char *);
173 void auth_maxtries_exceeded(struct ssh *) __attribute__((noreturn));
174 void userauth_finish(struct ssh *, int, const char *, const char *);
[all …]
Dkexgen.c45 static int input_kex_gen_init(int, u_int32_t, struct ssh *);
46 static int input_kex_gen_reply(int type, u_int32_t seq, struct ssh *ssh);
100 kex_gen_client(struct ssh *ssh) in kex_gen_client() argument
102 struct kex *kex = ssh->kex; in kex_gen_client()
133 if ((r = sshpkt_start(ssh, SSH2_MSG_KEX_ECDH_INIT)) != 0 || in kex_gen_client()
134 (r = sshpkt_put_stringb(ssh, kex->client_pub)) != 0 || in kex_gen_client()
135 (r = sshpkt_send(ssh)) != 0) in kex_gen_client()
138 ssh_dispatch_set(ssh, SSH2_MSG_KEX_ECDH_REPLY, &input_kex_gen_reply); in kex_gen_client()
143 input_kex_gen_reply(int type, u_int32_t seq, struct ssh *ssh) in input_kex_gen_reply() argument
145 struct kex *kex = ssh->kex; in input_kex_gen_reply()
[all …]
Dsshd-session.c203 struct ssh *the_active_state;
337 privsep_preauth(struct ssh *ssh) in privsep_preauth() argument
345 pmonitor->m_pkex = &ssh->kex; in privsep_preauth()
359 monitor_child_preauth(ssh, pmonitor); in privsep_preauth()
395 if (ssh_packet_get_connection_in(ssh) != STDIN_FILENO && in privsep_preauth()
396 dup2(ssh_packet_get_connection_in(ssh), STDIN_FILENO) == -1) in privsep_preauth()
398 if (ssh_packet_get_connection_out(ssh) != STDOUT_FILENO && in privsep_preauth()
399 dup2(ssh_packet_get_connection_out(ssh), in privsep_preauth()
421 privsep_postauth(struct ssh *ssh, Authctxt *authctxt) in privsep_postauth() argument
432 monitor_clear_keystate(ssh, pmonitor); in privsep_postauth()
[all …]
Dmonitor.c110 int mm_answer_moduli(struct ssh *, int, struct sshbuf *);
111 int mm_answer_sign(struct ssh *, int, struct sshbuf *);
112 int mm_answer_pwnamallow(struct ssh *, int, struct sshbuf *);
113 int mm_answer_auth2_read_banner(struct ssh *, int, struct sshbuf *);
114 int mm_answer_authserv(struct ssh *, int, struct sshbuf *);
115 int mm_answer_authpassword(struct ssh *, int, struct sshbuf *);
116 int mm_answer_bsdauthquery(struct ssh *, int, struct sshbuf *);
117 int mm_answer_bsdauthrespond(struct ssh *, int, struct sshbuf *);
118 int mm_answer_keyallowed(struct ssh *, int, struct sshbuf *);
119 int mm_answer_keyverify(struct ssh *, int, struct sshbuf *);
[all …]
Dsshd-auth.c155 struct ssh *the_active_state;
170 static void do_ssh2_kex(struct ssh *);
292 get_hostkey_public_by_type(int type, int nid, struct ssh *ssh) in get_hostkey_public_by_type() argument
331 get_hostkey_private_by_type(int type, int nid, struct ssh *ssh) in get_hostkey_private_by_type() argument
344 get_hostkey_public_by_index(int ind, struct ssh *ssh) in get_hostkey_public_by_index() argument
352 get_hostkey_index(struct sshkey *key, int compare, struct ssh *ssh) in get_hostkey_index() argument
425 recv_privsep_state(struct ssh *ssh, struct sshbuf *conf, in recv_privsep_state() argument
432 mm_get_state(ssh, &includes, conf, NULL, timing_secretp, in recv_privsep_state()
447 struct ssh *ssh = NULL; in main() local
555 connection_info = server_get_connection_info(ssh, 0, 0); in main()
[all …]
Dkex.h133 struct ssh;
163 int (*verify_host_key)(struct sshkey *, struct ssh *);
164 struct sshkey *(*load_host_public_key)(int, int, struct ssh *);
165 struct sshkey *(*load_host_private_key)(int, int, struct ssh *);
166 int (*host_key_index)(struct sshkey *, int, struct ssh *);
167 int (*sign)(struct ssh *, struct sshkey *, struct sshkey *,
169 int (*kex[KEX_MAX])(struct ssh *);
191 void kex_proposal_populate_entries(struct ssh *, char *prop[PROPOSAL_MAX],
195 int kex_exchange_identification(struct ssh *, int, const char *);
198 int kex_ready(struct ssh *, char *[PROPOSAL_MAX]);
[all …]
Dmonitor_wrap.h34 struct ssh;
46 int mm_sshkey_sign(struct ssh *, struct sshkey *, u_char **, size_t *,
50 struct passwd *mm_getpwnamallow(struct ssh *, const char *);
52 int mm_auth_password(struct ssh *, const char *);
55 int mm_user_key_allowed(struct ssh *ssh, struct passwd *, struct sshkey *, int,
57 int mm_hostbased_key_allowed(struct ssh *, struct passwd *, const char *,
62 void mm_decode_activate_server_options(struct ssh *ssh, struct sshbuf *m);
73 void mm_start_pam(struct ssh *);
86 void mm_send_keystate(struct ssh *, struct monitor*);
90 void mm_get_state(struct ssh *, struct include_list *, struct sshbuf *,
[all …]

12345678