gpg: Add accessor & utility functions for pk->keyid and pk->main_keyid.
authorNeal H. Walfield <neal@g10code.com>
Fri, 19 Feb 2016 13:48:56 +0000 (14:48 +0100)
committerNeal H. Walfield <neal@g10code.com>
Fri, 19 Feb 2016 15:13:00 +0000 (16:13 +0100)
commitc45633a571bf663bc7f3610fc481acded6acfc19
tree4f018128b3528d725717bdcf1102dc6d7fb9d236
parent7e7f35a2d7d40267a4dd30791df77420efeebfa7
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.
g10/keydb.h
g10/keyid.c
g10/packet.h