mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-22 14:57:02 +01:00
gpg: Fix duplicate key import due to legacy key in keyring.
* g10/keydb.c (keydb_search_fpr): Skip legacy keys. -- A test case for this problem can be found at GnuPG-bug-id: 2031 Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
f05a63b104
commit
4a326d7c9a
@ -1753,10 +1753,17 @@ keydb_search_kid (KEYDB_HANDLE hd, u32 *kid)
|
|||||||
gpg_error_t
|
gpg_error_t
|
||||||
keydb_search_fpr (KEYDB_HANDLE hd, const byte *fpr)
|
keydb_search_fpr (KEYDB_HANDLE hd, const byte *fpr)
|
||||||
{
|
{
|
||||||
|
gpg_error_t err;
|
||||||
KEYDB_SEARCH_DESC desc;
|
KEYDB_SEARCH_DESC desc;
|
||||||
|
|
||||||
memset (&desc, 0, sizeof desc);
|
memset (&desc, 0, sizeof desc);
|
||||||
desc.mode = KEYDB_SEARCH_MODE_FPR;
|
desc.mode = KEYDB_SEARCH_MODE_FPR;
|
||||||
memcpy (desc.u.fpr, fpr, MAX_FINGERPRINT_LEN);
|
memcpy (desc.u.fpr, fpr, MAX_FINGERPRINT_LEN);
|
||||||
return keydb_search (hd, &desc, 1, NULL);
|
do
|
||||||
|
{
|
||||||
|
err = keydb_search (hd, &desc, 1, NULL);
|
||||||
|
}
|
||||||
|
while (gpg_err_code (err) == GPG_ERR_LEGACY_KEY);
|
||||||
|
|
||||||
|
return err;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user