1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02:00

* 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.
This commit is contained in:
David Shaw 2003-05-31 23:23:19 +00:00
parent ff43d07819
commit b17358948d
9 changed files with 157 additions and 93 deletions

View file

@ -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 */