diff options
Diffstat (limited to 'packet.c')
-rw-r--r-- | packet.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: packet.c,v 1.289 2020/01/23 10:53:04 dtucker Exp $ */ | 1 | /* $OpenBSD: packet.c,v 1.290 2020/01/30 07:20:05 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -1850,6 +1850,7 @@ static void | |||
1850 | sshpkt_vfatal(struct ssh *ssh, int r, const char *fmt, va_list ap) | 1850 | sshpkt_vfatal(struct ssh *ssh, int r, const char *fmt, va_list ap) |
1851 | { | 1851 | { |
1852 | char *tag = NULL, remote_id[512]; | 1852 | char *tag = NULL, remote_id[512]; |
1853 | int oerrno = errno; | ||
1853 | 1854 | ||
1854 | sshpkt_fmt_connection_id(ssh, remote_id, sizeof(remote_id)); | 1855 | sshpkt_fmt_connection_id(ssh, remote_id, sizeof(remote_id)); |
1855 | 1856 | ||
@@ -1877,6 +1878,7 @@ sshpkt_vfatal(struct ssh *ssh, int r, const char *fmt, va_list ap) | |||
1877 | case SSH_ERR_NO_HOSTKEY_ALG_MATCH: | 1878 | case SSH_ERR_NO_HOSTKEY_ALG_MATCH: |
1878 | if (ssh && ssh->kex && ssh->kex->failed_choice) { | 1879 | if (ssh && ssh->kex && ssh->kex->failed_choice) { |
1879 | ssh_packet_clear_keys(ssh); | 1880 | ssh_packet_clear_keys(ssh); |
1881 | errno = oerrno; | ||
1880 | logdie("Unable to negotiate with %s: %s. " | 1882 | logdie("Unable to negotiate with %s: %s. " |
1881 | "Their offer: %s", remote_id, ssh_err(r), | 1883 | "Their offer: %s", remote_id, ssh_err(r), |
1882 | ssh->kex->failed_choice); | 1884 | ssh->kex->failed_choice); |
@@ -1889,6 +1891,7 @@ sshpkt_vfatal(struct ssh *ssh, int r, const char *fmt, va_list ap) | |||
1889 | __func__); | 1891 | __func__); |
1890 | } | 1892 | } |
1891 | ssh_packet_clear_keys(ssh); | 1893 | ssh_packet_clear_keys(ssh); |
1894 | errno = oerrno; | ||
1892 | logdie("%s%sConnection %s %s: %s", | 1895 | logdie("%s%sConnection %s %s: %s", |
1893 | tag != NULL ? tag : "", tag != NULL ? ": " : "", | 1896 | tag != NULL ? tag : "", tag != NULL ? ": " : "", |
1894 | ssh->state->server_side ? "from" : "to", | 1897 | ssh->state->server_side ? "from" : "to", |