diff options
author | djm@openbsd.org <djm@openbsd.org> | 2020-01-29 08:17:49 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2020-01-30 18:22:34 +1100 |
commit | 14ef4efe2bf4180e085ea6738fdbebc199458b0c (patch) | |
tree | df39d0e9e3911b4b251f485b557dd6e7bd49bab8 /clientloop.c | |
parent | 101ebc3a8cfa78d2e615afffbef9861bbbabf1ff (diff) |
upstream: markus suggests a simplification to previous
OpenBSD-Commit-ID: 10bbfb6607ebbb9a018dcd163f0964941adf58de
Diffstat (limited to 'clientloop.c')
-rw-r--r-- | clientloop.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/clientloop.c b/clientloop.c index 175b84802..170155442 100644 --- a/clientloop.c +++ b/clientloop.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: clientloop.c,v 1.336 2020/01/29 07:51:30 djm Exp $ */ | 1 | /* $OpenBSD: clientloop.c,v 1.337 2020/01/29 08:17:49 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 |
@@ -1888,11 +1888,8 @@ hostkeys_find(struct hostkey_foreach_line *l, void *_ctx) | |||
1888 | } | 1888 | } |
1889 | 1889 | ||
1890 | static void | 1890 | static void |
1891 | hostkey_change_preamble(void) | 1891 | hostkey_change_preamble(LogLevel loglevel) |
1892 | { | 1892 | { |
1893 | LogLevel loglevel = options.update_hostkeys == SSH_UPDATE_HOSTKEYS_ASK ? | ||
1894 | SYSLOG_LEVEL_INFO : SYSLOG_LEVEL_VERBOSE; | ||
1895 | |||
1896 | do_log2(loglevel, "The server has updated its host keys."); | 1893 | do_log2(loglevel, "The server has updated its host keys."); |
1897 | do_log2(loglevel, "These changes were verified by the server's " | 1894 | do_log2(loglevel, "These changes were verified by the server's " |
1898 | "existing trusted key."); | 1895 | "existing trusted key."); |
@@ -1915,7 +1912,7 @@ update_known_hosts(struct hostkeys_update_ctx *ctx) | |||
1915 | options.fingerprint_hash, SSH_FP_DEFAULT)) == NULL) | 1912 | options.fingerprint_hash, SSH_FP_DEFAULT)) == NULL) |
1916 | fatal("%s: sshkey_fingerprint failed", __func__); | 1913 | fatal("%s: sshkey_fingerprint failed", __func__); |
1917 | if (first && asking) | 1914 | if (first && asking) |
1918 | hostkey_change_preamble(); | 1915 | hostkey_change_preamble(loglevel); |
1919 | do_log2(loglevel, "Learned new hostkey: %s %s", | 1916 | do_log2(loglevel, "Learned new hostkey: %s %s", |
1920 | sshkey_type(ctx->keys[i]), fp); | 1917 | sshkey_type(ctx->keys[i]), fp); |
1921 | first = 0; | 1918 | first = 0; |
@@ -1926,7 +1923,7 @@ update_known_hosts(struct hostkeys_update_ctx *ctx) | |||
1926 | options.fingerprint_hash, SSH_FP_DEFAULT)) == NULL) | 1923 | options.fingerprint_hash, SSH_FP_DEFAULT)) == NULL) |
1927 | fatal("%s: sshkey_fingerprint failed", __func__); | 1924 | fatal("%s: sshkey_fingerprint failed", __func__); |
1928 | if (first && asking) | 1925 | if (first && asking) |
1929 | hostkey_change_preamble(); | 1926 | hostkey_change_preamble(loglevel); |
1930 | do_log2(loglevel, "Deprecating obsolete hostkey: %s %s", | 1927 | do_log2(loglevel, "Deprecating obsolete hostkey: %s %s", |
1931 | sshkey_type(ctx->old_keys[i]), fp); | 1928 | sshkey_type(ctx->old_keys[i]), fp); |
1932 | first = 0; | 1929 | first = 0; |