From a72b1e0a575ed28a5421d2daa96210c38e9bd879 Mon Sep 17 00:00:00 2001 From: David Shaw Date: Wed, 4 Jun 2003 22:27:05 +0000 Subject: [PATCH] * options.skel: Use new hkp://subkeys.pgp.net as sample keyserver since they at least handle subkeys correctly. * mainproc.c (print_notation_data), parse-packet.c (dump_sig_subpkt, parse_one_sig_subpkt, can_handle_critical): Add read-only support for preferred keyserver subpackets. They're basically policy URLs with a different name. * g10.c (main): Add "--set-notation" as alias to "--notation-data" this is to make things consistent with --set-policy-url meaning both sigs and certs. --- g10/ChangeLog | 14 ++++++++++++++ g10/g10.c | 11 ++++++----- g10/mainproc.c | 9 +++++++++ g10/options.skel | 6 +++--- g10/parse-packet.c | 8 ++++++-- 5 files changed, 38 insertions(+), 10 deletions(-) diff --git a/g10/ChangeLog b/g10/ChangeLog index 13d670366..8378f49c7 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,3 +1,17 @@ +2003-06-04 David Shaw + + * options.skel: Use new hkp://subkeys.pgp.net as sample keyserver + since they at least handle subkeys correctly. + + * mainproc.c (print_notation_data), parse-packet.c + (dump_sig_subpkt, parse_one_sig_subpkt, can_handle_critical): Add + read-only support for preferred keyserver subpackets. They're + basically policy URLs with a different name. + + * g10.c (main): Add "--set-notation" as alias to "--notation-data" + this is to make things consistent with --set-policy-url meaning + both sigs and certs. + 2003-05-31 David Shaw * main.h, misc.c (parse_options): New general option line parser. diff --git a/g10/g10.c b/g10/g10.c index 0a47c39c4..e4ab999c6 100644 --- a/g10/g10.c +++ b/g10/g10.c @@ -69,7 +69,7 @@ enum cmd_and_opt_values { aNull = 0, oUser = 'u', oVerbose = 'v', oCompress = 'z', - oNotation = 'N', + oSetNotation = 'N', oBatch = 500, oSigNotation, oCertNotation, @@ -461,9 +461,10 @@ static ARGPARSE_OPTS opts[] = { { oShowPhotos, "show-photos", 0, N_("Show Photo IDs")}, { oNoShowPhotos, "no-show-photos", 0, N_("Don't show Photo IDs")}, { oPhotoViewer, "photo-viewer", 2, N_("Set command line to view Photo IDs")}, - { oNotation, "notation-data", 2, "@" }, - { oSigNotation, "sig-notation", 2, "@" }, - { oCertNotation, "cert-notation", 2, "@" }, + { oSetNotation, "set-notation", 2, "@" }, + { oSetNotation, "notation-data", 2, "@" }, /* Alias */ + { oSigNotation, "sig-notation", 2, "@" }, + { oCertNotation, "cert-notation", 2, "@" }, { 302, NULL, 0, N_( "@\n(See the man page for a complete listing of all commands and options)\n" @@ -1605,7 +1606,7 @@ main( int argc, char **argv ) else opt.exec_path_set=1; break; - case oNotation: + case oSetNotation: add_notation_data( pargs.r.ret_str, 0 ); add_notation_data( pargs.r.ret_str, 1 ); break; diff --git a/g10/mainproc.c b/g10/mainproc.c index 49fefdab1..2558b4d57 100644 --- a/g10/mainproc.c +++ b/g10/mainproc.c @@ -796,6 +796,15 @@ print_notation_data( PKT_signature *sig ) write_status_buffer ( STATUS_POLICY_URL, p, n, 0 ); } + seq=0; + + while((p=enum_sig_subpkt(sig->hashed,SIGSUBPKT_PREF_KS,&n,&seq,NULL))) { + log_info(_("Preferred keyserver: ") ); + print_string( log_stream(), p, n, 0 ); + putc( '\n', log_stream() ); + /* TODO: put in a status-fd tag for preferred keyservers */ + } + /* Now check whether the key of this signature has some * notation data */ diff --git a/g10/options.skel b/g10/options.skel index e50f66ffe..5c8afced2 100644 --- a/g10/options.skel +++ b/g10/options.skel @@ -90,10 +90,10 @@ # support). # # Example HKP keyserver: -# x-hkp://pgp.mit.edu +# x-hkp://subkeys.pgp.net # # Example email keyserver: -# mailto:pgp-public-keys@keys.nl.pgp.net +# mailto:pgp-public-keys@keys.pgp.net # # Example LDAP keyservers: # ldap://pgp.surfnet.nl:11370 @@ -112,7 +112,7 @@ # Most servers do synchronize with each other and DNS round-robin may # give you a quasi-random server each time. -#keyserver x-hkp://pgp.mit.edu +#keyserver x-hkp://subkeys.pgp.net #keyserver mailto:pgp-public-keys@keys.nl.pgp.net #keyserver ldap://pgp.surfnet.nl:11370 #keyserver ldap://keyserver.pgp.com diff --git a/g10/parse-packet.c b/g10/parse-packet.c index c64c2eda9..8a3235fe3 100644 --- a/g10/parse-packet.c +++ b/g10/parse-packet.c @@ -861,7 +861,8 @@ dump_sig_subpkt( int hashed, int type, int critical, printf(" %02X", buffer[i]); break; case SIGSUBPKT_PREF_KS: - p = "preferred key server"; + fputs("preferred key server: ", stdout ); + print_string( stdout, buffer, length, ')' ); break; case SIGSUBPKT_PRIMARY_UID: p = "primary user ID"; @@ -937,6 +938,7 @@ parse_one_sig_subpkt( const byte *buffer, size_t n, int type ) case SIGSUBPKT_PREF_HASH: case SIGSUBPKT_PREF_COMPR: case SIGSUBPKT_POLICY: + case SIGSUBPKT_PREF_KS: case SIGSUBPKT_FEATURES: return 0; case SIGSUBPKT_EXPORTABLE: @@ -988,7 +990,9 @@ can_handle_critical( const byte *buffer, size_t n, int type ) case SIGSUBPKT_KEY_FLAGS: case SIGSUBPKT_PRIMARY_UID: case SIGSUBPKT_FEATURES: - case SIGSUBPKT_POLICY: /* Is it enough to show the policy? */ + /* Is it enough to show the policy or keyserver? */ + case SIGSUBPKT_POLICY: + case SIGSUBPKT_PREF_KS: return 1; default: