summaryrefslogtreecommitdiff
path: root/usr.bin/ssh/key.c
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2014-07-09 03:02:16 +0000
committerDamien Miller <djm@cvs.openbsd.org>2014-07-09 03:02:16 +0000
commitc6608e35becae37d4647b78b2f08e603da36532d (patch)
tree9b55dc96182d247a124ed5f59e8bf40632be1d3c /usr.bin/ssh/key.c
parent6868c03125907e9a2858a3d38bebf8a432d657f1 (diff)
downgrade more error() to debug() to better match what old authfile.c
did; suppresses spurious errors with hostbased authentication enabled
Diffstat (limited to 'usr.bin/ssh/key.c')
-rw-r--r--usr.bin/ssh/key.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/usr.bin/ssh/key.c b/usr.bin/ssh/key.c
index 55271c7bcac..a64ff815a0d 100644
--- a/usr.bin/ssh/key.c
+++ b/usr.bin/ssh/key.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: key.c,v 1.119 2014/06/30 12:54:39 djm Exp $ */
+/* $OpenBSD: key.c,v 1.120 2014/07/09 03:02:15 djm Exp $ */
/*
* placed in the public domain
*/
@@ -343,7 +343,8 @@ key_load_cert(const char *filename)
if ((r = sshkey_load_cert(filename, &ret)) != 0) {
fatal_on_fatal_errors(r, __func__, SSH_ERR_LIBCRYPTO_ERROR);
- if (r == SSH_ERR_SYSTEM_ERROR && errno == ENOENT)
+ /* Old authfile.c ignored all file errors. */
+ if (r == SSH_ERR_SYSTEM_ERROR)
debug("%s: %s", __func__, ssh_err(r));
else
error("%s: %s", __func__, ssh_err(r));
@@ -361,7 +362,8 @@ key_load_public(const char *filename, char **commentp)
if ((r = sshkey_load_public(filename, &ret, commentp)) != 0) {
fatal_on_fatal_errors(r, __func__, SSH_ERR_LIBCRYPTO_ERROR);
- if (r == SSH_ERR_SYSTEM_ERROR && errno == ENOENT)
+ /* Old authfile.c ignored all file errors. */
+ if (r == SSH_ERR_SYSTEM_ERROR)
debug("%s: %s", __func__, ssh_err(r));
else
error("%s: %s", __func__, ssh_err(r));
@@ -379,7 +381,8 @@ key_load_private(const char *path, const char *passphrase,
if ((r = sshkey_load_private(path, passphrase, &ret, commentp)) != 0) {
fatal_on_fatal_errors(r, __func__, SSH_ERR_LIBCRYPTO_ERROR);
- if (r == SSH_ERR_SYSTEM_ERROR && errno == ENOENT)
+ /* Old authfile.c ignored all file errors. */
+ if (r == SSH_ERR_SYSTEM_ERROR)
debug("%s: %s", __func__, ssh_err(r));
else
error("%s: %s", __func__, ssh_err(r));
@@ -398,7 +401,8 @@ key_load_private_cert(int type, const char *filename, const char *passphrase,
if ((r = sshkey_load_private_cert(type, filename, passphrase,
&ret, perm_ok)) != 0) {
fatal_on_fatal_errors(r, __func__, SSH_ERR_LIBCRYPTO_ERROR);
- if (r == SSH_ERR_SYSTEM_ERROR && errno == ENOENT)
+ /* Old authfile.c ignored all file errors. */
+ if (r == SSH_ERR_SYSTEM_ERROR)
debug("%s: %s", __func__, ssh_err(r));
else
error("%s: %s", __func__, ssh_err(r));
@@ -417,7 +421,8 @@ key_load_private_type(int type, const char *filename, const char *passphrase,
if ((r = sshkey_load_private_type(type, filename, passphrase,
&ret, commentp, perm_ok)) != 0) {
fatal_on_fatal_errors(r, __func__, SSH_ERR_LIBCRYPTO_ERROR);
- if ((r == SSH_ERR_SYSTEM_ERROR && errno == ENOENT) ||
+ /* Old authfile.c ignored all file errors. */
+ if (r == SSH_ERR_SYSTEM_ERROR ||
(r == SSH_ERR_KEY_WRONG_PASSPHRASE))
debug("%s: %s", __func__, ssh_err(r));
else