From: djm Date: Fri, 23 Jul 2021 05:24:02 +0000 (+0000) Subject: note successful authentication method in final "Authenticated to ..." X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=b86988f136cf470834fc5bdb0c2f5105a9ed936f;p=openbsd note successful authentication method in final "Authenticated to ..." message and partial auth success messages (all at LogLevel=verbose) ok dtucker@ --- diff --git a/usr.bin/ssh/ssh.c b/usr.bin/ssh/ssh.c index 5b577b6fef5..30c7e30a2ac 100644 --- a/usr.bin/ssh/ssh.c +++ b/usr.bin/ssh/ssh.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh.c,v 1.564 2021/07/23 04:04:52 djm Exp $ */ +/* $OpenBSD: ssh.c,v 1.565 2021/07/23 05:24:02 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -1630,13 +1630,6 @@ main(int ac, char **av) ssh_login(ssh, &sensitive_data, host, (struct sockaddr *)&hostaddr, options.port, pw, timeout_ms, cinfo); - if (ssh_packet_connection_is_on_socket(ssh)) { - verbose("Authenticated to %s ([%s]:%d).", host, - ssh_remote_ipaddr(ssh), ssh_remote_port(ssh)); - } else { - verbose("Authenticated to %s (via proxy).", host); - } - /* We no longer need the private host keys. Clear them now. */ if (sensitive_data.nkeys != 0) { for (i = 0; i < sensitive_data.nkeys; i++) { diff --git a/usr.bin/ssh/sshconnect2.c b/usr.bin/ssh/sshconnect2.c index 3774c5a7669..7eda9a9fc4a 100644 --- a/usr.bin/ssh/sshconnect2.c +++ b/usr.bin/ssh/sshconnect2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sshconnect2.c,v 1.350 2021/07/02 05:11:21 dtucker Exp $ */ +/* $OpenBSD: sshconnect2.c,v 1.351 2021/07/23 05:24:02 djm Exp $ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. * Copyright (c) 2008 Damien Miller. All rights reserved. @@ -480,7 +480,14 @@ ssh_userauth2(struct ssh *ssh, const char *local_user, if (!authctxt.success) fatal("Authentication failed."); - debug("Authentication succeeded (%s).", authctxt.method->name); + if (ssh_packet_connection_is_on_socket(ssh)) { + verbose("Authenticated to %s ([%s]:%d) using \"%s\".", host, + ssh_remote_ipaddr(ssh), ssh_remote_port(ssh), + authctxt.method->name); + } else { + verbose("Authenticated to %s (via proxy) using \"%s\".", host, + authctxt.method->name); + } } /* ARGSUSED */ @@ -638,7 +645,8 @@ input_userauth_failure(int type, u_int32_t seq, struct ssh *ssh) goto out; if (partial != 0) { - verbose("Authenticated with partial success."); + verbose("Authenticated using \"%s\" with partial success.", + authctxt->method->name); /* reset state */ pubkey_reset(authctxt); }