summaryrefslogtreecommitdiff
path: root/usr.bin/ssh/sshd.c
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2018-11-19 04:12:33 +0000
committerDamien Miller <djm@cvs.openbsd.org>2018-11-19 04:12:33 +0000
commitebda086837a48331ae1018e347a1bf12fdcb3035 (patch)
tree00e1178398b382410ae08bac269fa0c6d597f7bf /usr.bin/ssh/sshd.c
parent38b169160a5a9a7c60665aa58c57c1f344de1c67 (diff)
silence (to log level debug2) failure messages when loading the default
hostkeys. Hostkeys explicitly specified in the configuration or on the command-line are still reported as errors, and failure to load at least one host key remains a fatal error. Based on patch from Dag-Erling Smørgrav via https://github.com/openssh/openssh-portable/pull/103 ok markus@
Diffstat (limited to 'usr.bin/ssh/sshd.c')
-rw-r--r--usr.bin/ssh/sshd.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/usr.bin/ssh/sshd.c b/usr.bin/ssh/sshd.c
index f085c07559f..5ee7eb00d08 100644
--- a/usr.bin/ssh/sshd.c
+++ b/usr.bin/ssh/sshd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshd.c,v 1.518 2018/11/16 03:26:01 djm Exp $ */
+/* $OpenBSD: sshd.c,v 1.519 2018/11/19 04:12:32 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1480,7 +1480,7 @@ main(int ac, char **av)
break;
case 'h':
servconf_add_hostkey("[command-line]", 0,
- &options, optarg);
+ &options, optarg, 1);
break;
case 't':
test_flag = 1;
@@ -1630,15 +1630,18 @@ main(int ac, char **av)
}
for (i = 0; i < options.num_host_key_files; i++) {
+ int ll = options.host_key_file_userprovided[i] ?
+ SYSLOG_LEVEL_ERROR : SYSLOG_LEVEL_DEBUG1;
+
if (options.host_key_files[i] == NULL)
continue;
if ((r = sshkey_load_private(options.host_key_files[i], "",
&key, NULL)) != 0 && r != SSH_ERR_SYSTEM_ERROR)
- error("Error loading host key \"%s\": %s",
+ do_log2(ll, "Unable to load host key \"%s\": %s",
options.host_key_files[i], ssh_err(r));
if ((r = sshkey_load_public(options.host_key_files[i],
&pubkey, NULL)) != 0 && r != SSH_ERR_SYSTEM_ERROR)
- error("Error loading host key \"%s\": %s",
+ do_log2(ll, "Unable to load host key \"%s\": %s",
options.host_key_files[i], ssh_err(r));
if (pubkey == NULL && key != NULL)
if ((r = sshkey_from_private(key, &pubkey)) != 0)
@@ -1655,7 +1658,7 @@ main(int ac, char **av)
keytype = key->type;
accumulate_host_timing_secret(cfg, key);
} else {
- error("Could not load host key: %s",
+ do_log2(ll, "Unable to load host key: %s",
options.host_key_files[i]);
sensitive_data.host_keys[i] = NULL;
sensitive_data.host_pubkeys[i] = NULL;