diff options
author | David Shaw <[email protected]> | 2003-05-31 23:23:19 +0000 |
---|---|---|
committer | David Shaw <[email protected]> | 2003-05-31 23:23:19 +0000 |
commit | b17358948de8a71e94f59390e128665e7466bb8c (patch) | |
tree | e3cde5cef2119ae2e05ca0e476a1f6d6e97679c5 /g10/mainproc.c | |
parent | * main.h, misc.c (parse_options): New general option line parser. Fix the (diff) | |
download | gnupg-b17358948de8a71e94f59390e128665e7466bb8c.tar.gz gnupg-b17358948de8a71e94f59390e128665e7466bb8c.zip |
* mainproc.c (check_sig_and_print), main.h, keylist.c (show_policy,
show_notation): Collapse the old print_notation_data into show_policy()
and show_notation() so there is only one function to print notations and
policy URLs.
* options.h, main.h, g10.c (main), keyedit.c (print_and_check_one_sig),
keylist.c (list_one, list_keyblock_print), pkclist.c (do_edit_ownertrust),
sign.c (mk_notation_and_policy): New "list-options" and "verify-options"
commands. These replace the existing --show-photos/--no-show-photos,
--show-notation/--no-show-notation,
--show-policy-url/--no-show-policy-url, and --show-keyring options. The
new method is more flexible since a user can specify (for example) showing
photos during sig verification, but not in key listings. The old options
are emulated.
Diffstat (limited to '')
-rw-r--r-- | g10/mainproc.c | 53 |
1 files changed, 5 insertions, 48 deletions
diff --git a/g10/mainproc.c b/g10/mainproc.c index b1158a5b0..faba197fe 100644 --- a/g10/mainproc.c +++ b/g10/mainproc.c @@ -757,52 +757,6 @@ print_userid( PACKET *pkt ) } -static void -print_notation_data( PKT_signature *sig ) -{ - size_t n, n1, n2; - const byte *p; - int seq = 0; - - while((p=enum_sig_subpkt(sig->hashed,SIGSUBPKT_NOTATION,&n,&seq,NULL))) { - if( n < 8 ) { - log_info(_("WARNING: invalid notation data found\n")); - return; - } - if( !(*p & 0x80) ) - return; /* not human readable */ - n1 = (p[4] << 8) | p[5]; - n2 = (p[6] << 8) | p[7]; - p += 8; - if( 8+n1+n2 != n ) { - log_info(_("WARNING: invalid notation data found\n")); - return; - } - log_info(_("Notation: ") ); - print_string( log_stream(), p, n1, 0 ); - putc( '=', log_stream() ); - print_string( log_stream(), p+n1, n2, 0 ); - putc( '\n', log_stream() ); - write_status_buffer ( STATUS_NOTATION_NAME, p , n1, 0 ); - write_status_buffer ( STATUS_NOTATION_DATA, p+n1, n2, 50 ); - } - - seq=0; - - while((p=enum_sig_subpkt(sig->hashed,SIGSUBPKT_POLICY,&n,&seq,NULL))) { - log_info(_("Policy: ") ); - print_string( log_stream(), p, n, 0 ); - putc( '\n', log_stream() ); - write_status_buffer ( STATUS_POLICY_URL, p, n, 0 ); - } - - /* Now check whether the key of this signature has some - * notation data */ - - /* TODO */ -} - - /**************** * List the certificate in a user friendly way */ @@ -1433,7 +1387,7 @@ check_sig_and_print( CTX c, KBNODE node ) { dump_attribs(un->pkt->pkt.user_id,pk,NULL); - if(opt.show_photos) + if(opt.verify_options&VERIFY_SHOW_PHOTOS) show_photos(un->pkt->pkt.user_id->attribs, un->pkt->pkt.user_id->numattribs,pk,NULL); } @@ -1447,7 +1401,10 @@ check_sig_and_print( CTX c, KBNODE node ) release_kbnode( keyblock ); if( !rc ) - print_notation_data( sig ); + { + show_notation(sig,0,1); + show_policy_url(sig,0,1); + } if( !rc && is_status_enabled() ) { /* print a status response with the fingerprint */ |