diff options
author | djm@openbsd.org <djm@openbsd.org> | 2020-03-13 04:01:56 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2020-03-14 19:39:30 +1100 |
commit | 5becbec023f2037394987f85ed7f74b9a28699e0 (patch) | |
tree | ea7a8e45ac5e4a71d95f5b99e376b51fa3f823ef /sshconnect.c | |
parent | eef88418f9e5e51910af3c5b23b5606ebc17af55 (diff) | |
download | openssh-git-5becbec023f2037394987f85ed7f74b9a28699e0.tar.gz |
upstream: 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@
OpenBSD-Commit-ID: 2c22891f0b9e1a6cd46771cedbb26ac96ec2e6ab
Diffstat (limited to 'sshconnect.c')
-rw-r--r-- | sshconnect.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sshconnect.c b/sshconnect.c index 4711af78..af08be41 100644 --- a/sshconnect.c +++ b/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 @@ -1276,6 +1276,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; @@ -1285,8 +1286,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); |