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

gpg: Fix short key ID for v5key.

* g10/keyid.c (keyid_from_pk): Return keyid[0] for v5key.
* g10/keyring.c (keyring_search): Handle short key ID for v5key.

--

GnuPG-bug-id: 5000
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka 2020-08-07 12:41:47 +09:00
parent 646a30fd39
commit 20982bbd75
2 changed files with 8 additions and 3 deletions

View file

@ -1174,8 +1174,10 @@ keyring_search (KEYRING_HANDLE hd, KEYDB_SEARCH_DESC *desc,
break;
case KEYDB_SEARCH_MODE_SHORT_KID:
if (pk && desc[n].u.kid[1] == aki[1])
goto found;
if (pk
&& ((pk->fprlen == 32 && desc[n].u.kid[1] == aki[0])
|| (pk->fprlen != 32 && desc[n].u.kid[1] == aki[1])))
goto found;
break;
case KEYDB_SEARCH_MODE_LONG_KID:
if (pk && desc[n].u.kid[0] == aki[0]