1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02:00

gpg: Lookup key for merging/inserting only beu primary key.

* g10/getkey.c (get_keyblock_byfpr_fast): Add arg primary_only and
implement.
* g10/import.c (import_one_real): Simplify filling the fpr buffer with
zeroes.
(import_one_real): Find key only by primary fingerprint.
--

This should have been done early: When looking up the original
keyblock we want to update, we need to lookup it up only using the
primary key.  This avoids to find a key which has the primary key also
has a subkey.

GnuPG-bug-id: 7527
This commit is contained in:
Werner Koch 2025-02-11 14:44:23 +01:00
parent ef4acfd77b
commit 70049e5f16
No known key found for this signature in database
GPG key ID: E3FDFF218E45B72B
3 changed files with 24 additions and 6 deletions

View file

@ -422,6 +422,7 @@ gpg_error_t get_pubkey_byfpr_fast (ctrl_t ctrl, PKT_public_key *pk,
gpg_error_t get_keyblock_byfpr_fast (ctrl_t ctrl,
kbnode_t *r_keyblock,
KEYDB_HANDLE *r_hd,
int primary_only,
const byte *fpr, size_t fprlen,
int lock);