Changeset View
Changeset View
Standalone View
Standalone View
crypto/openssh/auth.c
| Show First 20 Lines • Show All 283 Lines • ▼ Show 20 Lines | auth_log(struct ssh *ssh, int authenticated, int partial, | ||||
| if (authctxt->postponed) | if (authctxt->postponed) | ||||
| authmsg = "Postponed"; | authmsg = "Postponed"; | ||||
| else if (partial) | else if (partial) | ||||
| authmsg = "Partial"; | authmsg = "Partial"; | ||||
| else { | else { | ||||
| authmsg = authenticated ? "Accepted" : "Failed"; | authmsg = authenticated ? "Accepted" : "Failed"; | ||||
| if (authenticated) | if (authenticated) | ||||
| BLACKLIST_NOTIFY(ssh, BLACKLIST_AUTH_OK, "ssh"); | BLACKLIST_NOTIFY(ssh, BLACKLIST_AUTH_OK, | ||||
| "Authenticated"); | |||||
| } | } | ||||
| if ((extra = format_method_key(authctxt)) == NULL) { | if ((extra = format_method_key(authctxt)) == NULL) { | ||||
| if (authctxt->auth_method_info != NULL) | if (authctxt->auth_method_info != NULL) | ||||
| extra = xstrdup(authctxt->auth_method_info); | extra = xstrdup(authctxt->auth_method_info); | ||||
| } | } | ||||
| do_log2(level, "%s %s%s%s for %s%.100s from %.200s port %d ssh2%s%s", | do_log2(level, "%s %s%s%s for %s%.100s from %.200s port %d ssh2%s%s", | ||||
| Show All 32 Lines | |||||
| #endif | #endif | ||||
| } | } | ||||
| void | void | ||||
| auth_maxtries_exceeded(struct ssh *ssh) | auth_maxtries_exceeded(struct ssh *ssh) | ||||
| { | { | ||||
| Authctxt *authctxt = (Authctxt *)ssh->authctxt; | Authctxt *authctxt = (Authctxt *)ssh->authctxt; | ||||
| BLACKLIST_NOTIFY(ssh, BLACKLIST_AUTH_FAIL, "Maximum attempts exceeded"); | |||||
| error("maximum authentication attempts exceeded for " | error("maximum authentication attempts exceeded for " | ||||
| "%s%.100s from %.200s port %d ssh2", | "%s%.100s from %.200s port %d ssh2", | ||||
| authctxt->valid ? "" : "invalid user ", | authctxt->valid ? "" : "invalid user ", | ||||
| authctxt->user, | authctxt->user, | ||||
| ssh_remote_ipaddr(ssh), | ssh_remote_ipaddr(ssh), | ||||
| ssh_remote_port(ssh)); | ssh_remote_port(ssh)); | ||||
| ssh_packet_disconnect(ssh, "Too many authentication failures"); | ssh_packet_disconnect(ssh, "Too many authentication failures"); | ||||
| /* NOTREACHED */ | /* NOTREACHED */ | ||||
| ▲ Show 20 Lines • Show All 144 Lines • ▼ Show 20 Lines | |||||
| #endif | #endif | ||||
| pw = getpwnam(user); | pw = getpwnam(user); | ||||
| #if defined(_AIX) && defined(HAVE_SETAUTHDB) | #if defined(_AIX) && defined(HAVE_SETAUTHDB) | ||||
| aix_restoreauthdb(); | aix_restoreauthdb(); | ||||
| #endif | #endif | ||||
| if (pw == NULL) { | if (pw == NULL) { | ||||
| BLACKLIST_NOTIFY(ssh, BLACKLIST_BAD_USER, user); | BLACKLIST_NOTIFY(ssh, BLACKLIST_AUTH_FAIL, "Invalid user"); | ||||
| logit("Invalid user %.100s from %.100s port %d", | logit("Invalid user %.100s from %.100s port %d", | ||||
| user, ssh_remote_ipaddr(ssh), ssh_remote_port(ssh)); | user, ssh_remote_ipaddr(ssh), ssh_remote_port(ssh)); | ||||
| #ifdef CUSTOM_FAILED_LOGIN | #ifdef CUSTOM_FAILED_LOGIN | ||||
| record_failed_login(ssh, user, | record_failed_login(ssh, user, | ||||
| auth_get_canonical_hostname(ssh, options.use_dns), "ssh"); | auth_get_canonical_hostname(ssh, options.use_dns), "ssh"); | ||||
| #endif | #endif | ||||
| #ifdef SSH_AUDIT_EVENTS | #ifdef SSH_AUDIT_EVENTS | ||||
| audit_event(ssh, SSH_INVALID_USER); | audit_event(ssh, SSH_INVALID_USER); | ||||
| ▲ Show 20 Lines • Show All 277 Lines • Show Last 20 Lines | |||||