mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
* packet.h, parse-packet.c (setup_user_id), free-packet.c (free_user_id),
keydb.h, keyid.c (namehash_from_uid): New function to rmd160-hash the contents of a user ID packet and cache it in the uid object. * keylist.c (list_keyblock_colon): Use namehash in field 8 of uids. Show dates for creation (selfsig date), and expiration in fields 6 and 7. * trustdb.c (get_validity, get_validity_counts, update_validity): Use new namehash function rather than hashing it locally.
This commit is contained in:
parent
2a9bd94734
commit
773513c70b
8 changed files with 65 additions and 39 deletions
16
g10/keyid.c
16
g10/keyid.c
|
@ -241,6 +241,22 @@ keyid_from_sig( PKT_signature *sig, u32 *keyid )
|
|||
return sig->keyid[1];
|
||||
}
|
||||
|
||||
byte *
|
||||
namehash_from_uid(PKT_user_id *uid)
|
||||
{
|
||||
if(uid->namehash==NULL)
|
||||
{
|
||||
uid->namehash=m_alloc(20);
|
||||
|
||||
if(uid->attrib_data)
|
||||
rmd160_hash_buffer(uid->namehash,uid->attrib_data,uid->attrib_len);
|
||||
else
|
||||
rmd160_hash_buffer(uid->namehash,uid->name,uid->len);
|
||||
}
|
||||
|
||||
return uid->namehash;
|
||||
}
|
||||
|
||||
/****************
|
||||
* return the number of bits used in the pk
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue