mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-17 14:07:03 +01: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:
parent
646a30fd39
commit
20982bbd75
@ -567,7 +567,10 @@ keyid_from_pk (PKT_public_key *pk, u32 *keyid)
|
|||||||
keyid[0] = pk->keyid[0];
|
keyid[0] = pk->keyid[0];
|
||||||
keyid[1] = pk->keyid[1];
|
keyid[1] = pk->keyid[1];
|
||||||
|
|
||||||
return keyid[1]; /*FIXME:shortkeyid is different for v5*/
|
if (pk->fprlen == 32)
|
||||||
|
return keyid[0];
|
||||||
|
else
|
||||||
|
return keyid[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1174,8 +1174,10 @@ keyring_search (KEYRING_HANDLE hd, KEYDB_SEARCH_DESC *desc,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case KEYDB_SEARCH_MODE_SHORT_KID:
|
case KEYDB_SEARCH_MODE_SHORT_KID:
|
||||||
if (pk && desc[n].u.kid[1] == aki[1])
|
if (pk
|
||||||
goto found;
|
&& ((pk->fprlen == 32 && desc[n].u.kid[1] == aki[0])
|
||||||
|
|| (pk->fprlen != 32 && desc[n].u.kid[1] == aki[1])))
|
||||||
|
goto found;
|
||||||
break;
|
break;
|
||||||
case KEYDB_SEARCH_MODE_LONG_KID:
|
case KEYDB_SEARCH_MODE_LONG_KID:
|
||||||
if (pk && desc[n].u.kid[0] == aki[0]
|
if (pk && desc[n].u.kid[0] == aki[0]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user