diff options
author | NIIBE Yutaka <gniibe@fsij.org> | 2020-08-07 05:41:47 +0200 |
---|---|---|
committer | NIIBE Yutaka <gniibe@fsij.org> | 2020-08-07 06:02:40 +0200 |
commit | 20982bbd7539d2032f4d6249a2654c245445521d (patch) | |
tree | 8b894c5a4ee7994ecb7385d2c43aa0f8cf96fbda /g10/keyring.c | |
parent | gpgsm: New option --chuid. (diff) | |
download | gnupg2-20982bbd7539d2032f4d6249a2654c245445521d.tar.xz gnupg2-20982bbd7539d2032f4d6249a2654c245445521d.zip |
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>
Diffstat (limited to 'g10/keyring.c')
-rw-r--r-- | g10/keyring.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/g10/keyring.c b/g10/keyring.c index 992c280d2..9cd66db3a 100644 --- a/g10/keyring.c +++ b/g10/keyring.c @@ -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] |