aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2019-07-04 13:21:39 +0000
committerWerner Koch <[email protected]>2019-07-04 13:21:39 +0000
commit91a6ba32347a21c9029728eec96b8ff80f944629 (patch)
treecb48d29b21f4a7a0d9b85ff3e8524bc8759a1c67
parentgpg: New command --locate-external-key. (diff)
downloadgnupg-91a6ba32347a21c9029728eec96b8ff80f944629.tar.gz
gnupg-91a6ba32347a21c9029728eec96b8ff80f944629.zip
gpg: Avoid printing false AKL error message.
* g10/getkey.c (get_pubkey_byname): Add special traeatment for default and skipped-local. -- This change avoids error message like gpg: error retrieving '[email protected]' via None: No public key A 'None' mechanism is something internal. Signed-off-by: Werner Koch <[email protected]>
-rw-r--r--g10/getkey.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/g10/getkey.c b/g10/getkey.c
index 62142772e..228042d1a 100644
--- a/g10/getkey.c
+++ b/g10/getkey.c
@@ -1015,14 +1015,14 @@ get_pubkey_byname (ctrl_t ctrl, enum get_pubkey_modes mode,
{
case AKL_NODEFAULT:
/* This is a dummy mechanism. */
- mechanism_string = "None";
+ mechanism_string = "";
rc = GPG_ERR_NO_PUBKEY;
break;
case AKL_LOCAL:
if (mode == GET_PUBKEY_NO_LOCAL)
{
- mechanism_string = "None";
+ mechanism_string = "";
rc = GPG_ERR_NO_PUBKEY;
}
else
@@ -1165,8 +1165,8 @@ get_pubkey_byname (ctrl_t ctrl, enum get_pubkey_modes mode,
name, mechanism_string);
break;
}
- if (gpg_err_code (rc) != GPG_ERR_NO_PUBKEY
- || opt.verbose || no_fingerprint)
+ if ((gpg_err_code (rc) != GPG_ERR_NO_PUBKEY
+ || opt.verbose || no_fingerprint) && *mechanism_string)
log_info (_("error retrieving '%s' via %s: %s\n"),
name, mechanism_string,
no_fingerprint ? _("No fingerprint") : gpg_strerror (rc));