mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-22 10:19:57 +01:00
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 'foo@example.org' via None: No public key A 'None' mechanism is something internal. Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
d00c8024e5
commit
91a6ba3234
@ -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));
|
||||
|
Loading…
x
Reference in New Issue
Block a user