Changeset View
Changeset View
Standalone View
Standalone View
crypto/openssh/auth2.c
| Show First 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | |||||
| #include "misc.h" | #include "misc.h" | ||||
| #include "servconf.h" | #include "servconf.h" | ||||
| #include "sshkey.h" | #include "sshkey.h" | ||||
| #include "hostfile.h" | #include "hostfile.h" | ||||
| #include "auth.h" | #include "auth.h" | ||||
| #include "dispatch.h" | #include "dispatch.h" | ||||
| #include "pathnames.h" | #include "pathnames.h" | ||||
| #include "ssherr.h" | #include "ssherr.h" | ||||
| #include "blacklist_client.h" | |||||
| #ifdef GSSAPI | #ifdef GSSAPI | ||||
| #include "ssh-gss.h" | #include "ssh-gss.h" | ||||
| #endif | #endif | ||||
| #include "monitor_wrap.h" | #include "monitor_wrap.h" | ||||
| #include "digest.h" | #include "digest.h" | ||||
| #include "kex.h" | #include "kex.h" | ||||
| /* import */ | /* import */ | ||||
| ▲ Show 20 Lines • Show All 374 Lines • ▼ Show 20 Lines | if ((r = sshpkt_start(ssh, SSH2_MSG_USERAUTH_SUCCESS)) != 0 || | ||||
| (r = ssh_packet_write_wait(ssh)) != 0) | (r = ssh_packet_write_wait(ssh)) != 0) | ||||
| fatal_fr(r, "send success packet"); | fatal_fr(r, "send success packet"); | ||||
| /* now we can break out */ | /* now we can break out */ | ||||
| authctxt->success = 1; | authctxt->success = 1; | ||||
| ssh_packet_set_log_preamble(ssh, "user %s", authctxt->user); | ssh_packet_set_log_preamble(ssh, "user %s", authctxt->user); | ||||
| } else { | } else { | ||||
| /* Allow initial try of "none" auth without failure penalty */ | /* Allow initial try of "none" auth without failure penalty */ | ||||
| if (!partial && !authctxt->server_caused_failure && | if (!partial && !authctxt->server_caused_failure && | ||||
| (authctxt->attempt > 1 || strcmp(method, "none") != 0)) { | (authctxt->attempt > 1 || strcmp(method, "none") != 0)) | ||||
| authctxt->failures++; | authctxt->failures++; | ||||
| BLACKLIST_NOTIFY(ssh, BLACKLIST_AUTH_FAIL, "ssh"); | |||||
| } | |||||
| if (authctxt->failures >= options.max_authtries) { | if (authctxt->failures >= options.max_authtries) { | ||||
| #ifdef SSH_AUDIT_EVENTS | #ifdef SSH_AUDIT_EVENTS | ||||
| mm_audit_event(ssh, SSH_LOGIN_EXCEED_MAXTRIES); | mm_audit_event(ssh, SSH_LOGIN_EXCEED_MAXTRIES); | ||||
| #endif | #endif | ||||
| auth_maxtries_exceeded(ssh); | auth_maxtries_exceeded(ssh); | ||||
| } | } | ||||
| methods = authmethods_get(authctxt); | methods = authmethods_get(authctxt); | ||||
| debug3_f("failure partial=%d next methods=\"%s\"", | debug3_f("failure partial=%d next methods=\"%s\"", | ||||
| ▲ Show 20 Lines • Show All 354 Lines • Show Last 20 Lines | |||||