1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

gpg: Add dedicated error code for PGP-2 keys.

* g10/parse-packet.c (parse_key): Return GPG_ERR_LEGACY_KEY for PGP2
keys.
* g10/import.c (read_block): Simplify by checking GPG_ERR_LEGACY_KEY.
* g10/getkey.c (lookup): Silence error message for PGP-2 keys.

* common/util.h (GPG_ERR_LEGACY_KEY): Add replacement for older
libgpg-error.

Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
Werner Koch 2015-01-22 12:14:48 +01:00
parent 11142e0ad7
commit 6f3d11d883
5 changed files with 7 additions and 11 deletions

View file

@ -403,8 +403,6 @@ get_pubkey (PKT_public_key * pk, u32 * keyid)
if (!rc)
goto leave;
log_debug ("looking up key %08X%08X failed: %s\n", keyid[0], keyid[1],
gpg_strerror (rc));
rc = GPG_ERR_NO_PUBKEY;
leave:
@ -2573,7 +2571,8 @@ lookup (getkey_ctx_t ctx, kbnode_t *ret_keyblock, int want_secret)
}
found:
if (rc && gpg_err_code (rc) != GPG_ERR_NOT_FOUND)
if (rc && gpg_err_code (rc) != GPG_ERR_NOT_FOUND
&& gpg_err_code (rc) != GPG_ERR_LEGACY_KEY)
log_error ("keydb_search failed: %s\n", gpg_strerror (rc));
if (!rc)