summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/sshconnect.c
diff options
context:
space:
mode:
authordjm <djm@openbsd.org>2020-03-13 04:01:56 +0000
committerdjm <djm@openbsd.org>2020-03-13 04:01:56 +0000
commitabf1982245ec6a08b1d2bfe0d4a021d0260c9753 (patch)
tree7a19d02b1ce0a0a9c30676958636192417717c14 /usr.bin/ssh/sshconnect.c
parenttypo in comment (diff)
downloadwireguard-openbsd-abf1982245ec6a08b1d2bfe0d4a021d0260c9753.tar.xz
wireguard-openbsd-abf1982245ec6a08b1d2bfe0d4a021d0260c9753.zip
use sshpkt_fatal() for kex_exchange_identification() errors.
This ensures that the logged errors are consistent with other transport- layer errors and that the relevant IP addresses are logged. bz3129 ok dtucker@
Diffstat (limited to 'usr.bin/ssh/sshconnect.c')
-rw-r--r--usr.bin/ssh/sshconnect.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/ssh/sshconnect.c b/usr.bin/ssh/sshconnect.c
index 08a9f4db236..a598c3a4cb4 100644
--- a/usr.bin/ssh/sshconnect.c
+++ b/usr.bin/ssh/sshconnect.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshconnect.c,v 1.328 2020/01/25 07:17:18 djm Exp $ */
+/* $OpenBSD: sshconnect.c,v 1.329 2020/03/13 04:01:56 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1238,6 +1238,7 @@ ssh_login(struct ssh *ssh, Sensitive *sensitive, const char *orighost,
{
char *host;
char *server_user, *local_user;
+ int r;
local_user = xstrdup(pw->pw_name);
server_user = options.user ? options.user : local_user;
@@ -1247,8 +1248,8 @@ ssh_login(struct ssh *ssh, Sensitive *sensitive, const char *orighost,
lowercase(host);
/* Exchange protocol version identification strings with the server. */
- if (kex_exchange_identification(ssh, timeout_ms, NULL) != 0)
- cleanup_exit(255); /* error already logged */
+ if ((r = kex_exchange_identification(ssh, timeout_ms, NULL)) != 0)
+ sshpkt_fatal(ssh, r, "banner exchange");
/* Put the connection into non-blocking mode. */
ssh_packet_set_nonblocking(ssh);