diff options
author | David Shaw <[email protected]> | 2003-07-21 23:19:15 +0000 |
---|---|---|
committer | David Shaw <[email protected]> | 2003-07-21 23:19:15 +0000 |
commit | fbdee01db968d501d26cf5c2ea21c803815ce1ef (patch) | |
tree | 96422839217e179100ec53c2acc34c6ad187252c /g10/keylist.c | |
parent | * keyedit.c (show_key_with_all_names): Use list-option show-validity in (diff) | |
download | gnupg-fbdee01db968d501d26cf5c2ea21c803815ce1ef.tar.gz gnupg-fbdee01db968d501d26cf5c2ea21c803815ce1ef.zip |
* keygen.c (do_add_key_flags): Don't set the certify flag for subkeys.
(ask_algo): Provide key flags for DSA, Elgamal_e, and Elgamal subkeys.
(generate_keypair): Provide key flags for the default DSA/Elgamal keys.
* 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.
* 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.
* gpgv.c (read_trust_options): Stub.
Diffstat (limited to 'g10/keylist.c')
-rw-r--r-- | g10/keylist.c | 48 |
1 files changed, 41 insertions, 7 deletions
diff --git a/g10/keylist.c b/g10/keylist.c index 181a622d2..12cf4e573 100644 --- a/g10/keylist.c +++ b/g10/keylist.c @@ -58,10 +58,46 @@ 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,marginals,completes,cert_depth; + ulong created,nextcheck; + + read_trust_options(&trust_model,&created,&nextcheck, + &marginals,&completes,&cert_depth); + + printf("tru:"); + + if(nextcheck && nextcheck <= make_timestamp()) + printf("o"); + if(trust_model!=opt.trust_model) + printf("t"); + if(opt.trust_model==TM_PGP || opt.trust_model==TM_CLASSIC) + { + if(marginals!=opt.marginals_needed) + printf("m"); + if(completes!=opt.completes_needed) + printf("c"); + if(cert_depth!=opt.max_cert_depth) + printf("d"); + } + + printf(":%d:%lu:%lu",trust_model,created,nextcheck); + + /* Only show marginals, completes, and cert_depth in the classic + or PGP trust models since they are not meaningful + otherwise. */ + + if(trust_model==TM_PGP || trust_model==TM_CLASSIC) + printf(":%d:%d:%d",marginals,completes,cert_depth); + + printf("\n"); + } + + if( !list ) + list_all(0); + else + list_one( list, 0 ); } void @@ -1070,15 +1106,13 @@ list_keyblock_colon( KBNODE keyblock, int secret, int fpr ) } if( opt.check_sigs ) { PKT_public_key *signer_pk=NULL; - u32 dummy; - int dum2; fflush(stdout); if(opt.no_sig_cache) signer_pk=m_alloc_clear(sizeof(PKT_public_key)); rc = check_key_signature2( keyblock, node, NULL, signer_pk, - NULL, &dummy, &dum2); + NULL, NULL, NULL ); switch( rc ) { case 0: sigrc = '!'; break; case G10ERR_BAD_SIGN: sigrc = '-'; break; |