X-Git-Url: https://git.sommitrealweird.co.uk/onak.git/blobdiff_plain/8e58a1769ce5e492dd68904dfc81b6e077fc2a3a..3cdd1ba5400b97412d8e69fdcf59284b7cde6e28:/keystructs.h diff --git a/keystructs.h b/keystructs.h index 10dfcc6..c77e346 100644 --- a/keystructs.h +++ b/keystructs.h @@ -9,9 +9,12 @@ #ifndef __KEYSTRUCTS_H__ #define __KEYSTRUCTS_H__ +#include #include #include +#include "ll.h" + /** * struct openpgp_packet - Stores an OpenPGP packet. * @tag: The packet tag (ie type). @@ -62,15 +65,17 @@ struct openpgp_signedpacket_list { /** * struct openpgp_publickey - An OpenPGP public key complete with sigs. * @publickey: The OpenPGP packet for the public key. - * @revocation: The OpenPGP packet for the revocation [optional] + * @revoked: True if the key is revoked. + * @sigs: Any signatures directly on the publickey packet. * @uids: The list of UIDs with signatures for this key. * @subkeys: The list of subkeys with signatures for this key. * @next: The next public key. */ struct openpgp_publickey { struct openpgp_packet *publickey; - struct openpgp_packet_list *revocations; - struct openpgp_packet_list *last_revocation; + bool revoked; + struct openpgp_packet_list *sigs; + struct openpgp_packet_list *last_sig; struct openpgp_signedpacket_list *uids; struct openpgp_signedpacket_list *last_uid; struct openpgp_signedpacket_list *subkeys; @@ -78,4 +83,33 @@ struct openpgp_publickey { struct openpgp_publickey *next; }; +/** + * struct stats_key - holds key details suitable for doing stats on. + * @keyid: The keyid. + * @colour: Used for marking during DFS/BFS. + * @parent: The key that lead us to this one for DFS/BFS. + * @sigs: A linked list of the signatures on this key. + * @gotsigs: A bool indicating if we've initialized the sigs element yet. + * @disabled: If we shouldn't consider the key in calculations. + * @revoked: If the key is revoked (and shouldn't be considered). + */ +struct stats_key { + uint64_t keyid; + int colour; + uint64_t parent; + struct ll *sigs; + struct ll *signs; + bool gotsigs; + bool disabled; + bool revoked; +}; + +/** + * struct skshash - holds an SKS key hash (md5 over sorted packet list) + * @hash: The 128 bit MD5 hash of the sorted packet list from the key + */ +struct skshash { + uint8_t hash[16]; +}; + #endif /* __KEYSTRUCTS_H__ */