summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2014-07-09 13:07:28 +1000
committerDamien Miller <djm@mindrot.org>2014-07-09 13:07:28 +1000
commitd0bb950485ba121e43a77caf434115ed6417b46f (patch)
tree8bfaa4921f5ffbcaf1a64335ddf60653f735bf0d
parent0070776a038655c57f57e70cd05e4c38a5de9d84 (diff)
- djm@cvs.openbsd.org 2014/07/09 03:02:15
[key.c] downgrade more error() to debug() to better match what old authfile.c did; suppresses spurious errors with hostbased authentication enabled
-rw-r--r--ChangeLog4
-rw-r--r--key.c17
2 files changed, 15 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 6fcb44bb3..d62022871 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,6 +8,10 @@
8 [sftp.c] 8 [sftp.c]
9 more useful error message when GLOB_NOSPACE occurs; 9 more useful error message when GLOB_NOSPACE occurs;
10 bz#2254, patch from Orion Poplawski 10 bz#2254, patch from Orion Poplawski
11 - djm@cvs.openbsd.org 2014/07/09 03:02:15
12 [key.c]
13 downgrade more error() to debug() to better match what old authfile.c
14 did; suppresses spurious errors with hostbased authentication enabled
11 15
1220140706 1620140706
13 - OpenBSD CVS Sync 17 - OpenBSD CVS Sync
diff --git a/key.c b/key.c
index 75327d491..70f4045ce 100644
--- a/key.c
+++ b/key.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: key.c,v 1.119 2014/06/30 12:54:39 djm Exp $ */ 1/* $OpenBSD: key.c,v 1.120 2014/07/09 03:02:15 djm Exp $ */
2/* 2/*
3 * placed in the public domain 3 * placed in the public domain
4 */ 4 */
@@ -345,7 +345,8 @@ key_load_cert(const char *filename)
345 345
346 if ((r = sshkey_load_cert(filename, &ret)) != 0) { 346 if ((r = sshkey_load_cert(filename, &ret)) != 0) {
347 fatal_on_fatal_errors(r, __func__, SSH_ERR_LIBCRYPTO_ERROR); 347 fatal_on_fatal_errors(r, __func__, SSH_ERR_LIBCRYPTO_ERROR);
348 if (r == SSH_ERR_SYSTEM_ERROR && errno == ENOENT) 348 /* Old authfile.c ignored all file errors. */
349 if (r == SSH_ERR_SYSTEM_ERROR)
349 debug("%s: %s", __func__, ssh_err(r)); 350 debug("%s: %s", __func__, ssh_err(r));
350 else 351 else
351 error("%s: %s", __func__, ssh_err(r)); 352 error("%s: %s", __func__, ssh_err(r));
@@ -363,7 +364,8 @@ key_load_public(const char *filename, char **commentp)
363 364
364 if ((r = sshkey_load_public(filename, &ret, commentp)) != 0) { 365 if ((r = sshkey_load_public(filename, &ret, commentp)) != 0) {
365 fatal_on_fatal_errors(r, __func__, SSH_ERR_LIBCRYPTO_ERROR); 366 fatal_on_fatal_errors(r, __func__, SSH_ERR_LIBCRYPTO_ERROR);
366 if (r == SSH_ERR_SYSTEM_ERROR && errno == ENOENT) 367 /* Old authfile.c ignored all file errors. */
368 if (r == SSH_ERR_SYSTEM_ERROR)
367 debug("%s: %s", __func__, ssh_err(r)); 369 debug("%s: %s", __func__, ssh_err(r));
368 else 370 else
369 error("%s: %s", __func__, ssh_err(r)); 371 error("%s: %s", __func__, ssh_err(r));
@@ -381,7 +383,8 @@ key_load_private(const char *path, const char *passphrase,
381 383
382 if ((r = sshkey_load_private(path, passphrase, &ret, commentp)) != 0) { 384 if ((r = sshkey_load_private(path, passphrase, &ret, commentp)) != 0) {
383 fatal_on_fatal_errors(r, __func__, SSH_ERR_LIBCRYPTO_ERROR); 385 fatal_on_fatal_errors(r, __func__, SSH_ERR_LIBCRYPTO_ERROR);
384 if (r == SSH_ERR_SYSTEM_ERROR && errno == ENOENT) 386 /* Old authfile.c ignored all file errors. */
387 if (r == SSH_ERR_SYSTEM_ERROR)
385 debug("%s: %s", __func__, ssh_err(r)); 388 debug("%s: %s", __func__, ssh_err(r));
386 else 389 else
387 error("%s: %s", __func__, ssh_err(r)); 390 error("%s: %s", __func__, ssh_err(r));
@@ -400,7 +403,8 @@ key_load_private_cert(int type, const char *filename, const char *passphrase,
400 if ((r = sshkey_load_private_cert(type, filename, passphrase, 403 if ((r = sshkey_load_private_cert(type, filename, passphrase,
401 &ret, perm_ok)) != 0) { 404 &ret, perm_ok)) != 0) {
402 fatal_on_fatal_errors(r, __func__, SSH_ERR_LIBCRYPTO_ERROR); 405 fatal_on_fatal_errors(r, __func__, SSH_ERR_LIBCRYPTO_ERROR);
403 if (r == SSH_ERR_SYSTEM_ERROR && errno == ENOENT) 406 /* Old authfile.c ignored all file errors. */
407 if (r == SSH_ERR_SYSTEM_ERROR)
404 debug("%s: %s", __func__, ssh_err(r)); 408 debug("%s: %s", __func__, ssh_err(r));
405 else 409 else
406 error("%s: %s", __func__, ssh_err(r)); 410 error("%s: %s", __func__, ssh_err(r));
@@ -419,7 +423,8 @@ key_load_private_type(int type, const char *filename, const char *passphrase,
419 if ((r = sshkey_load_private_type(type, filename, passphrase, 423 if ((r = sshkey_load_private_type(type, filename, passphrase,
420 &ret, commentp, perm_ok)) != 0) { 424 &ret, commentp, perm_ok)) != 0) {
421 fatal_on_fatal_errors(r, __func__, SSH_ERR_LIBCRYPTO_ERROR); 425 fatal_on_fatal_errors(r, __func__, SSH_ERR_LIBCRYPTO_ERROR);
422 if ((r == SSH_ERR_SYSTEM_ERROR && errno == ENOENT) || 426 /* Old authfile.c ignored all file errors. */
427 if (r == SSH_ERR_SYSTEM_ERROR ||
423 (r == SSH_ERR_KEY_WRONG_PASSPHRASE)) 428 (r == SSH_ERR_KEY_WRONG_PASSPHRASE))
424 debug("%s: %s", __func__, ssh_err(r)); 429 debug("%s: %s", __func__, ssh_err(r));
425 else 430 else