mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
gpg: Add accessor & utility functions for pk->keyid and pk->main_keyid.
* g10/keydb.h (keyid_cmp): New function. * g10/keyid.c (pk_keyid): New function. (pk_main_keyid): New function. (keyid_copy): New function. (pk_keyid_str): New function. * g10/packet.h (PKT_public_key): Update comments for main_keyid and keyid. -- Signed-off-by: Neal H. Walfield <neal@g10code.com> Before accessing pk->keyid, it is necessary to call keyid_from_pk (pk, NULL) to ensure that pk->keyid is valid. Because it is easy to forget to do this, these accessor functions take care of it.
This commit is contained in:
parent
7e7f35a2d7
commit
c45633a571
3 changed files with 94 additions and 3 deletions
|
@ -279,8 +279,12 @@ typedef struct
|
|||
byte pubkey_usage; /* for now only used to pass it to getkey() */
|
||||
byte req_usage; /* hack to pass a request to getkey() */
|
||||
u32 has_expired; /* set to the expiration date if expired */
|
||||
u32 main_keyid[2]; /* keyid of the primary key */
|
||||
u32 keyid[2]; /* calculated by keyid_from_pk() */
|
||||
/* keyid of the primary key. Never access this value directly.
|
||||
Instead, use pk_main_keyid(). */
|
||||
u32 main_keyid[2];
|
||||
/* keyid of this key. Never access this value directly! Instead,
|
||||
use pk_keyid(). */
|
||||
u32 keyid[2];
|
||||
prefitem_t *prefs; /* list of preferences (may be NULL) */
|
||||
struct
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue