1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-06-10 23:49:50 +02:00

* trustdb.h, trustdb.c (read_trust_options): New. Returns items from the

trustdb version record.

* keylist.c (public_key_list): Use it here for the new "tru" record.
This commit is contained in:
David Shaw 2003-07-21 16:51:59 +00:00
parent 9f839ac937
commit 828abe6483
4 changed files with 52 additions and 7 deletions

View File

@ -1,11 +1,17 @@
2003-07-21 David Shaw <dshaw@jabberwocky.com>
* trustdb.h, trustdb.c (read_trust_options): New. Returns items
from the trustdb version record.
* keylist.c (public_key_list): Use it here for the new "tru"
record.
* sig-check.c (signature_check, signature_check2,
check_key_signature, check_key_signature2): Allow passing NULLs
for unused parameters in the x2 form of each function to avoid the
need for dummy variables. getkey.c, mainproc.c: Change all
callers.
2003-07-15 David Shaw <dshaw@jabberwocky.com>
* keygen.c (do_add_key_flags): Don't set the certify flag for

View File

@ -57,10 +57,31 @@ static FILE *attrib_fp=NULL;
void
public_key_list( STRLIST list )
{
if( !list )
list_all(0);
else
list_one( list, 0 );
if(opt.with_colons)
{
byte trust_model;
ulong created,nextcheck;
read_trust_options(&trust_model,&created,&nextcheck);
printf("tru:");
if(nextcheck && nextcheck <= make_timestamp())
printf("o");
if(trust_model!=0)
printf("t");
/* We don't show marginals, completes, or cert_depth since
they are not accurate in 1.2.x - they are not updated when
the trustdb is rebuilt with different options. */
printf(":%d:%lu:%lu\n",trust_model,created,nextcheck);
}
if( !list )
list_all(0);
else
list_one( list, 0 );
}
void

View File

@ -440,7 +440,6 @@ trust_letter (unsigned int value)
}
}
/****************
* Recreate the WoT but do not ask for new ownertrusts. Special
* feature: In batch mode and without a forced yes, this is only done
@ -494,7 +493,24 @@ revalidation_mark (void)
pending_check_trustdb = 1;
}
void
read_trust_options(byte *trust_model,ulong *created,ulong *nextcheck)
{
TRUSTREC opts;
init_trustdb();
read_record(0,&opts,RECTYPE_VER);
if(trust_model)
*trust_model=opts.r.ver.trust_model;
if(created)
*created=opts.r.ver.created;
if(nextcheck)
*nextcheck=opts.r.ver.nextcheck;
}
/***********************************************
*********** Ownertrust et al. ****************
***********************************************/

View File

@ -59,6 +59,8 @@ int enum_cert_paths( void **context, ulong *lid,
void enum_cert_paths_print( void **context, FILE *fp,
int refresh, ulong selected_lid );
void read_trust_options(byte *trust_model,ulong *created,ulong *nextcheck);
unsigned int get_ownertrust (PKT_public_key *pk);
int get_ownertrust_info (PKT_public_key *pk);
void update_ownertrust (PKT_public_key *pk, unsigned int new_trust );