gpg: Obsolete some keyserver helper options.

* g10/options.h (opt): Remove keyserver_options.other.
* g10/gpg.c (main): Obsolete option --honor-http-proxt.
* g10/keyserver.c (add_canonical_option): Replace by ...
(warn_kshelper_option): New.
(parse_keyserver_uri): Obsolete "x-broken-http".
--

Some of these options are deprecated for 10 years and they do not make
any sense without the keyserver helpers.  For one we print a hint on
how to replace it:

  gpg: keyserver option 'ca-cert-file' is obsolete; \
  please use 'hkp-cacert' in dirmngr.conf

Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
Werner Koch 2014-12-08 15:14:35 +01:00
parent cdc404fe52
commit 5bf93f4ea7
3 changed files with 22 additions and 32 deletions

View File

@ -702,7 +702,6 @@ static ARGPARSE_OPTS opts[] = {
ARGPARSE_s_n (oNoAllowFreeformUID, "no-allow-freeform-uid", "@"), ARGPARSE_s_n (oNoAllowFreeformUID, "no-allow-freeform-uid", "@"),
ARGPARSE_s_n (oNoLiteral, "no-literal", "@"), ARGPARSE_s_n (oNoLiteral, "no-literal", "@"),
ARGPARSE_p_u (oSetFilesize, "set-filesize", "@"), ARGPARSE_p_u (oSetFilesize, "set-filesize", "@"),
ARGPARSE_s_n (oHonorHttpProxy, "honor-http-proxy", "@"),
ARGPARSE_s_n (oFastListMode, "fast-list-mode", "@"), ARGPARSE_s_n (oFastListMode, "fast-list-mode", "@"),
ARGPARSE_s_n (oFixedListMode, "fixed-list-mode", "@"), ARGPARSE_s_n (oFixedListMode, "fixed-list-mode", "@"),
ARGPARSE_s_n (oLegacyListMode, "legacy-list-mode", "@"), ARGPARSE_s_n (oLegacyListMode, "legacy-list-mode", "@"),
@ -794,6 +793,7 @@ static ARGPARSE_OPTS opts[] = {
ARGPARSE_s_s (octapiDriver, "ctapi-driver", "@"), ARGPARSE_s_s (octapiDriver, "ctapi-driver", "@"),
ARGPARSE_s_s (opcscDriver, "pcsc-driver", "@"), ARGPARSE_s_s (opcscDriver, "pcsc-driver", "@"),
ARGPARSE_s_n (oDisableCCID, "disable-ccid", "@"), ARGPARSE_s_n (oDisableCCID, "disable-ccid", "@"),
ARGPARSE_s_n (oHonorHttpProxy, "honor-http-proxy", "@"),
/* Dummy options. */ /* Dummy options. */
ARGPARSE_s_n (oNoop, "sk-comments", "@"), ARGPARSE_s_n (oNoop, "sk-comments", "@"),
@ -2375,6 +2375,9 @@ main (int argc, char **argv)
case oDisableCCID: case oDisableCCID:
obsolete_scdaemon_option (configname, configlineno, "disable-ccid"); obsolete_scdaemon_option (configname, configlineno, "disable-ccid");
break; break;
case oHonorHttpProxy:
obsolete_option (configname, configlineno, "honor-http-proxy");
break;
case oAnswerYes: opt.answer_yes = 1; break; case oAnswerYes: opt.answer_yes = 1; break;
case oAnswerNo: opt.answer_no = 1; break; case oAnswerNo: opt.answer_no = 1; break;
@ -2940,12 +2943,6 @@ main (int argc, char **argv)
case oNoAllowFreeformUID: opt.allow_freeform_uid = 0; break; case oNoAllowFreeformUID: opt.allow_freeform_uid = 0; break;
case oNoLiteral: opt.no_literal = 1; break; case oNoLiteral: opt.no_literal = 1; break;
case oSetFilesize: opt.set_filesize = pargs.r.ret_ulong; break; case oSetFilesize: opt.set_filesize = pargs.r.ret_ulong; break;
case oHonorHttpProxy:
add_to_strlist(&opt.keyserver_options.other,"http-proxy");
deprecated_warning(configname,configlineno,
"--honor-http-proxy",
"--keyserver-options ","http-proxy");
break;
case oFastListMode: opt.fast_list_mode = 1; break; case oFastListMode: opt.fast_list_mode = 1; break;
case oFixedListMode: /* Dummy */ break; case oFixedListMode: /* Dummy */ break;
case oLegacyListMode: opt.legacy_list_mode = 1; break; case oLegacyListMode: opt.legacy_list_mode = 1; break;

View File

@ -124,26 +124,23 @@ static gpg_error_t keyserver_put (ctrl_t ctrl, strlist_t keyspecs,
static size_t max_cert_size=DEFAULT_MAX_CERT_SIZE; static size_t max_cert_size=DEFAULT_MAX_CERT_SIZE;
static void static void
add_canonical_option(char *option,strlist_t *list) warn_kshelper_option(char *option)
{ {
char *arg=argsplit(option); char *p;
if(arg) if ((p=strchr (option, '=')))
{ *p = 0;
char *joined;
joined=xmalloc(strlen(option)+1+strlen(arg)+1); if (!strcmp (option, "ca-cert-file"))
/* Make a canonical name=value form with no spaces */ log_info ("keyserver option '%s' is obsolete; please use "
strcpy(joined,option); "'%s' in dirmngr.conf\n",
strcat(joined,"="); "ca-cert-file", "hkp-cacert");
strcat(joined,arg); else if (!strcmp (option, "check-cert")
append_to_strlist(list,joined); || !strcmp (option, "broken-http-proxy"))
xfree(joined); log_info ("keyserver option '%s' is obsolete\n", option);
}
else
append_to_strlist(list,option);
} }
int int
parse_keyserver_options(char *options) parse_keyserver_options(char *options)
{ {
@ -190,9 +187,9 @@ parse_keyserver_options(char *options)
&& !parse_export_options(tok, && !parse_export_options(tok,
&opt.keyserver_options.export_options,0)) &opt.keyserver_options.export_options,0))
{ {
/* All of the standard options have failed, so the option is /* All of the standard options have failed, so the option was
destined for a keyserver plugin. */ destined for a keyserver plugin as used by GnuPG < 2.1 */
add_canonical_option(tok,&opt.keyserver_options.other); warn_kshelper_option (tok);
} }
} }
@ -285,7 +282,7 @@ parse_keyserver_uri (const char *string,int require_scheme,
options++; options++;
while((tok=optsep(&options))) while((tok=optsep(&options)))
add_canonical_option(tok,&keyserver->options); warn_kshelper_option (tok);
} }
/* Get the scheme */ /* Get the scheme */
@ -344,11 +341,8 @@ parse_keyserver_uri (const char *string,int require_scheme,
if(ascii_strcasecmp(keyserver->scheme,"x-broken-hkp")==0) if(ascii_strcasecmp(keyserver->scheme,"x-broken-hkp")==0)
{ {
deprecated_warning(configname,configlineno,"x-broken-hkp", log_info ("keyserver option '%s' is obsolete\n",
"--keyserver-options ","broken-http-proxy"); "x-broken-hkp");
xfree(keyserver->scheme);
keyserver->scheme=xstrdup("hkp");
append_to_strlist(&opt.keyserver_options.other,"broken-http-proxy");
} }
else if(ascii_strcasecmp(keyserver->scheme,"x-hkp")==0) else if(ascii_strcasecmp(keyserver->scheme,"x-hkp")==0)
{ {

View File

@ -146,7 +146,6 @@ struct
unsigned int options; unsigned int options;
unsigned int import_options; unsigned int import_options;
unsigned int export_options; unsigned int export_options;
strlist_t other;
} keyserver_options; } keyserver_options;
int exec_disable; int exec_disable;
int exec_path_set; int exec_path_set;