mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
gpg: Do not bail out on v5 keys in the local keyring.
* g10/parse-packet.c (parse_key): Return GPG_ERR_UNKNOWN_VERSION instead of invalid packet. * g10/keydb.c (parse_keyblock_image): Do not map the unknown version error to invalid keyring. (keydb_search): Skip unknown version errors simlar to legacy keys. * g10/keyring.c (keyring_rebuild_cache): Skip keys with unknown versions. * g10/import.c (read_block): Handle unknown version. -- When using gpg 2.3 the local keyring may contain v5 keys. This patch allows the use of such a keyring also with a 2.2 version which does not support v5 keys. We will probably need some more tweaking here but this covers the most common cases of listing keys and also importing v5 keys. Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
0e73214dd2
commit
de70a2f377
5 changed files with 18 additions and 7 deletions
|
@ -860,12 +860,14 @@ read_block( IOBUF a, int with_meta,
|
|||
skip_sigs = 0;
|
||||
while ((rc=parse_packet (&parsectx, pkt)) != -1)
|
||||
{
|
||||
if (rc && (gpg_err_code (rc) == GPG_ERR_LEGACY_KEY
|
||||
if (rc && ((gpg_err_code (rc) == GPG_ERR_LEGACY_KEY
|
||||
|| gpg_err_code (rc) == GPG_ERR_UNKNOWN_VERSION)
|
||||
&& (pkt->pkttype == PKT_PUBLIC_KEY
|
||||
|| pkt->pkttype == PKT_SECRET_KEY)))
|
||||
{
|
||||
in_v3key = 1;
|
||||
++*r_v3keys;
|
||||
if (gpg_err_code (rc) != GPG_ERR_UNKNOWN_VERSION)
|
||||
++*r_v3keys;
|
||||
free_packet (pkt, &parsectx);
|
||||
init_packet (pkt);
|
||||
continue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue