mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
gpg: Improve skipping of PGP-2 keys.
* g10/keydb.c (keydb_search_first, keydb_search_next): Skip legacy keys. * g10/keyring.c (keyring_get_keyblock): Handle GPG_ERR_LEGACY_KEY. (prepare_search): Ditto. (keyring_rebuild_cache): Skip legacy keys. * g10/keyserver.c (keyidlist): Ditto. * g10/trustdb.c (validate_key_list): Ditto. -- This is not the most elegant way to handle it but it reduces the chance for unwanted side effects. GnuPG-bug-id: 1816 Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
6f3d11d883
commit
09e8f35d38
5 changed files with 61 additions and 11 deletions
|
@ -1248,16 +1248,25 @@ keyidlist(strlist_t users,KEYDB_SEARCH_DESC **klist,int *count,int fakev3)
|
|||
}
|
||||
}
|
||||
|
||||
while (!(rc = keydb_search (kdbhd, desc, ndesc, NULL)))
|
||||
for (;;)
|
||||
{
|
||||
rc = keydb_search (kdbhd, desc, ndesc, NULL);
|
||||
if (rc && gpg_err_code (rc) != GPG_ERR_LEGACY_KEY)
|
||||
break; /* ready. */
|
||||
|
||||
if (!users)
|
||||
desc[0].mode = KEYDB_SEARCH_MODE_NEXT;
|
||||
|
||||
if (gpg_err_code (rc) == GPG_ERR_LEGACY_KEY)
|
||||
continue;
|
||||
|
||||
/* read the keyblock */
|
||||
rc = keydb_get_keyblock (kdbhd, &keyblock );
|
||||
if( rc )
|
||||
{
|
||||
log_error (_("error reading keyblock: %s\n"), gpg_strerror (rc) );
|
||||
if (gpg_err_code (rc) == GPG_ERR_LEGACY_KEY)
|
||||
continue;
|
||||
log_error (_("error reading keyblock: %s\n"), gpg_strerror (rc) );
|
||||
goto leave;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue