=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/sshconnect2.c,v retrieving revision 1.366.4.1 retrieving revision 1.367 diff -u -r1.366.4.1 -r1.367 --- src/usr.bin/ssh/sshconnect2.c 2023/12/18 14:57:43 1.366.4.1 +++ src/usr.bin/ssh/sshconnect2.c 2023/08/01 08:15:04 1.367 @@ -1,4 +1,4 @@ -/* $OpenBSD: sshconnect2.c,v 1.366.4.1 2023/12/18 14:57:43 bluhm Exp $ */ +/* $OpenBSD: sshconnect2.c,v 1.367 2023/08/01 08:15:04 dtucker Exp $ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. * Copyright (c) 2008 Damien Miller. All rights reserved. @@ -351,6 +351,7 @@ }; static int input_userauth_service_accept(int, u_int32_t, struct ssh *); +static int input_userauth_ext_info(int, u_int32_t, struct ssh *); static int input_userauth_success(int, u_int32_t, struct ssh *); static int input_userauth_failure(int, u_int32_t, struct ssh *); static int input_userauth_banner(int, u_int32_t, struct ssh *); @@ -464,7 +465,7 @@ ssh->authctxt = &authctxt; ssh_dispatch_init(ssh, &input_userauth_error); - ssh_dispatch_set(ssh, SSH2_MSG_EXT_INFO, kex_input_ext_info); + ssh_dispatch_set(ssh, SSH2_MSG_EXT_INFO, &input_userauth_ext_info); ssh_dispatch_set(ssh, SSH2_MSG_SERVICE_ACCEPT, &input_userauth_service_accept); ssh_dispatch_run_fatal(ssh, DISPATCH_BLOCK, &authctxt.success); /* loop until success */ pubkey_cleanup(ssh); @@ -515,6 +516,12 @@ return r; } +static int +input_userauth_ext_info(int type, u_int32_t seqnr, struct ssh *ssh) +{ + return kex_input_ext_info(type, seqnr, ssh); +} + void userauth(struct ssh *ssh, char *authlist) { @@ -593,7 +600,6 @@ free(authctxt->methoddata); authctxt->methoddata = NULL; authctxt->success = 1; /* break out */ - ssh_dispatch_set(ssh, SSH2_MSG_EXT_INFO, dispatch_protocol_error); return 0; } @@ -1855,12 +1861,10 @@ * private key instead */ if (id->key != NULL) { - if (id->key != NULL) { - ident = format_identity(id); - debug("Offering public key: %s", ident); - free(ident); - sent = send_pubkey_test(ssh, id); - } + ident = format_identity(id); + debug("Offering public key: %s", ident); + free(ident); + sent = send_pubkey_test(ssh, id); } else { debug("Trying private key: %s", id->filename); id->key = load_identity_file(id);