mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
gpg: Move key cleaning functions to a separate file.
* g10/trust.c (mark_usable_uid_certs, clean_sigs_from_uid) (clean_uid_from_key, clean_one_uid, clean_key): Move to ... * g10/key-clean.c: new file. * g10/key-clean.h: New. * g10/Makefile.am (gpg_sources): Add new files. * g10/export.c, g10/import.c, g10/keyedit.c, g10/trustdb.c: Include new header. * g10/trustdb.h (struct key_item, is_in_klist): Move to ... * g10/keydb.h: here. -- Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
cb71573f37
commit
135e46ea48
10 changed files with 495 additions and 429 deletions
30
g10/keydb.h
30
g10/keydb.h
|
@ -64,6 +64,20 @@ struct kbnode_struct {
|
|||
#define is_cloned_kbnode(a) ((a)->private_flag & 2)
|
||||
|
||||
|
||||
/*
|
||||
* A structure to store key identification as well as some stuff
|
||||
* needed for key validation.
|
||||
*/
|
||||
struct key_item {
|
||||
struct key_item *next;
|
||||
unsigned int ownertrust,min_ownertrust;
|
||||
byte trust_depth;
|
||||
byte trust_value;
|
||||
char *trust_regexp;
|
||||
u32 kid[2];
|
||||
};
|
||||
|
||||
|
||||
/* Bit flags used with build_pk_list. */
|
||||
enum
|
||||
{
|
||||
|
@ -133,6 +147,22 @@ enum
|
|||
};
|
||||
|
||||
|
||||
/*
|
||||
* Check whether the signature SIG is in the klist K.
|
||||
*/
|
||||
static inline struct key_item *
|
||||
is_in_klist (struct key_item *k, PKT_signature *sig)
|
||||
{
|
||||
for (; k; k = k->next)
|
||||
{
|
||||
if (k->kid[0] == sig->keyid[0] && k->kid[1] == sig->keyid[1])
|
||||
return k;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*-- keydb.c --*/
|
||||
|
||||
#define KEYDB_RESOURCE_FLAG_PRIMARY 2 /* The primary resource. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue