Lines Matching refs:ssh

93 static int input_service_request(int, u_int32_t, struct ssh *);
94 static int input_userauth_request(int, u_int32_t, struct ssh *);
140 userauth_send_banner(struct ssh *ssh, const char *msg) in userauth_send_banner() argument
144 if ((r = sshpkt_start(ssh, SSH2_MSG_USERAUTH_BANNER)) != 0 || in userauth_send_banner()
145 (r = sshpkt_put_cstring(ssh, msg)) != 0 || in userauth_send_banner()
146 (r = sshpkt_put_cstring(ssh, "")) != 0 || /* language, unused */ in userauth_send_banner()
147 (r = sshpkt_send(ssh)) != 0) in userauth_send_banner()
153 userauth_banner(struct ssh *ssh) in userauth_banner() argument
162 userauth_send_banner(ssh, banner); in userauth_banner()
172 do_authentication2(struct ssh *ssh) in do_authentication2() argument
174 Authctxt *authctxt = ssh->authctxt; in do_authentication2()
176 ssh_dispatch_init(ssh, &dispatch_protocol_error); in do_authentication2()
177 ssh_dispatch_set(ssh, SSH2_MSG_SERVICE_REQUEST, &input_service_request); in do_authentication2()
178 ssh_dispatch_run_fatal(ssh, DISPATCH_BLOCK, &authctxt->success); in do_authentication2()
179 ssh->authctxt = NULL; in do_authentication2()
184 input_service_request(int type, u_int32_t seq, struct ssh *ssh) in input_service_request() argument
186 Authctxt *authctxt = ssh->authctxt; in input_service_request()
190 if ((r = sshpkt_get_cstring(ssh, &service, NULL)) != 0 || in input_service_request()
191 (r = sshpkt_get_end(ssh)) != 0) in input_service_request()
201 ssh_dispatch_set(ssh, SSH2_MSG_USERAUTH_REQUEST, in input_service_request()
208 if ((r = sshpkt_start(ssh, SSH2_MSG_SERVICE_ACCEPT)) != 0 || in input_service_request()
209 (r = sshpkt_put_cstring(ssh, service)) != 0 || in input_service_request()
210 (r = sshpkt_send(ssh)) != 0 || in input_service_request()
211 (r = ssh_packet_write_wait(ssh)) != 0) in input_service_request()
215 ssh_packet_disconnect(ssh, "bad service request %s", service); in input_service_request()
262 input_userauth_request(int type, u_int32_t seq, struct ssh *ssh) in input_userauth_request() argument
264 Authctxt *authctxt = ssh->authctxt; in input_userauth_request()
273 if ((r = sshpkt_get_cstring(ssh, &user, NULL)) != 0 || in input_userauth_request()
274 (r = sshpkt_get_cstring(ssh, &service, NULL)) != 0 || in input_userauth_request()
275 (r = sshpkt_get_cstring(ssh, &method, NULL)) != 0) in input_userauth_request()
285 authctxt->pw = PRIVSEP(getpwnamallow(ssh, user)); in input_userauth_request()
294 PRIVSEP(audit_event(ssh, SSH_INVALID_USER)); in input_userauth_request()
299 PRIVSEP(start_pam(ssh)); in input_userauth_request()
301 ssh_packet_set_log_preamble(ssh, "%suser %s", in input_userauth_request()
309 userauth_banner(ssh); in input_userauth_request()
311 ssh_packet_disconnect(ssh, in input_userauth_request()
315 ssh_packet_disconnect(ssh, "Change of username or service " in input_userauth_request()
320 auth2_challenge_stop(ssh); in input_userauth_request()
324 ssh_dispatch_set(ssh, SSH2_MSG_USERAUTH_GSSAPI_TOKEN, NULL); in input_userauth_request()
325 ssh_dispatch_set(ssh, SSH2_MSG_USERAUTH_GSSAPI_EXCHANGE_COMPLETE, NULL); in input_userauth_request()
336 authenticated = m->userauth(ssh); in input_userauth_request()
341 userauth_finish(ssh, authenticated, method, NULL); in input_userauth_request()
351 userauth_finish(struct ssh *ssh, int authenticated, const char *method, in userauth_finish() argument
354 Authctxt *authctxt = ssh->authctxt; in userauth_finish()
366 !auth_root_allowed(ssh, method)) { in userauth_finish()
369 PRIVSEP(audit_event(ssh, SSH_LOGIN_ROOT_DENIED)); in userauth_finish()
381 auth_log(ssh, authenticated, partial, method, submethod); in userauth_finish()
399 userauth_send_banner(ssh, sshbuf_ptr(loginmsg)); in userauth_finish()
400 if ((r = ssh_packet_write_wait(ssh)) != 0) { in userauth_finish()
401 sshpkt_fatal(ssh, r, in userauth_finish()
414 ssh_dispatch_set(ssh, SSH2_MSG_USERAUTH_REQUEST, in userauth_finish()
416 if ((r = sshpkt_start(ssh, SSH2_MSG_USERAUTH_SUCCESS)) != 0 || in userauth_finish()
417 (r = sshpkt_send(ssh)) != 0 || in userauth_finish()
418 (r = ssh_packet_write_wait(ssh)) != 0) in userauth_finish()
422 ssh_packet_set_log_preamble(ssh, "user %s", authctxt->user); in userauth_finish()
428 BLACKLIST_NOTIFY(ssh, BLACKLIST_AUTH_FAIL, "ssh"); in userauth_finish()
432 PRIVSEP(audit_event(ssh, SSH_LOGIN_EXCEED_MAXTRIES)); in userauth_finish()
434 auth_maxtries_exceeded(ssh); in userauth_finish()
439 if ((r = sshpkt_start(ssh, SSH2_MSG_USERAUTH_FAILURE)) != 0 || in userauth_finish()
440 (r = sshpkt_put_cstring(ssh, methods)) != 0 || in userauth_finish()
441 (r = sshpkt_put_u8(ssh, partial)) != 0 || in userauth_finish()
442 (r = sshpkt_send(ssh)) != 0 || in userauth_finish()
443 (r = ssh_packet_write_wait(ssh)) != 0) in userauth_finish()