summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2014-12-08 15:14:35 +0100
committerWerner Koch <wk@gnupg.org>2014-12-08 15:14:35 +0100
commit5bf93f4ea7a11381dd256b5fd4e5913366828265 (patch)
tree45a588f8f2d1fbc4daa4e07eddcee5a1575f46dc
parentgpg: Add OpenPGP card vendor 0x1337. (diff)
downloadgnupg2-5bf93f4ea7a11381dd256b5fd4e5913366828265.tar.xz
gnupg2-5bf93f4ea7a11381dd256b5fd4e5913366828265.zip
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>
-rw-r--r--g10/gpg.c11
-rw-r--r--g10/keyserver.c46
-rw-r--r--g10/options.h1
3 files changed, 24 insertions, 34 deletions
diff --git a/g10/gpg.c b/g10/gpg.c
index 0bedf2533..12fe7b2ef 100644
--- a/g10/gpg.c
+++ b/g10/gpg.c
@@ -702,7 +702,6 @@ static ARGPARSE_OPTS opts[] = {
ARGPARSE_s_n (oNoAllowFreeformUID, "no-allow-freeform-uid", "@"),
ARGPARSE_s_n (oNoLiteral, "no-literal", "@"),
ARGPARSE_p_u (oSetFilesize, "set-filesize", "@"),
- ARGPARSE_s_n (oHonorHttpProxy, "honor-http-proxy", "@"),
ARGPARSE_s_n (oFastListMode, "fast-list-mode", "@"),
ARGPARSE_s_n (oFixedListMode, "fixed-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 (opcscDriver, "pcsc-driver", "@"),
ARGPARSE_s_n (oDisableCCID, "disable-ccid", "@"),
+ ARGPARSE_s_n (oHonorHttpProxy, "honor-http-proxy", "@"),
/* Dummy options. */
ARGPARSE_s_n (oNoop, "sk-comments", "@"),
@@ -2375,6 +2375,9 @@ main (int argc, char **argv)
case oDisableCCID:
obsolete_scdaemon_option (configname, configlineno, "disable-ccid");
break;
+ case oHonorHttpProxy:
+ obsolete_option (configname, configlineno, "honor-http-proxy");
+ break;
case oAnswerYes: opt.answer_yes = 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 oNoLiteral: opt.no_literal = 1; 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 oFixedListMode: /* Dummy */ break;
case oLegacyListMode: opt.legacy_list_mode = 1; break;
diff --git a/g10/keyserver.c b/g10/keyserver.c
index 6b603cd9c..a92544c45 100644
--- a/g10/keyserver.c
+++ b/g10/keyserver.c
@@ -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 void
-add_canonical_option(char *option,strlist_t *list)
+warn_kshelper_option(char *option)
{
- char *arg=argsplit(option);
-
- if(arg)
- {
- char *joined;
-
- joined=xmalloc(strlen(option)+1+strlen(arg)+1);
- /* Make a canonical name=value form with no spaces */
- strcpy(joined,option);
- strcat(joined,"=");
- strcat(joined,arg);
- append_to_strlist(list,joined);
- xfree(joined);
- }
- else
- append_to_strlist(list,option);
+ char *p;
+
+ if ((p=strchr (option, '=')))
+ *p = 0;
+
+ if (!strcmp (option, "ca-cert-file"))
+ log_info ("keyserver option '%s' is obsolete; please use "
+ "'%s' in dirmngr.conf\n",
+ "ca-cert-file", "hkp-cacert");
+ else if (!strcmp (option, "check-cert")
+ || !strcmp (option, "broken-http-proxy"))
+ log_info ("keyserver option '%s' is obsolete\n", option);
}
+
int
parse_keyserver_options(char *options)
{
@@ -190,9 +187,9 @@ parse_keyserver_options(char *options)
&& !parse_export_options(tok,
&opt.keyserver_options.export_options,0))
{
- /* All of the standard options have failed, so the option is
- destined for a keyserver plugin. */
- add_canonical_option(tok,&opt.keyserver_options.other);
+ /* All of the standard options have failed, so the option was
+ destined for a keyserver plugin as used by GnuPG < 2.1 */
+ warn_kshelper_option (tok);
}
}
@@ -285,7 +282,7 @@ parse_keyserver_uri (const char *string,int require_scheme,
options++;
while((tok=optsep(&options)))
- add_canonical_option(tok,&keyserver->options);
+ warn_kshelper_option (tok);
}
/* 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)
{
- deprecated_warning(configname,configlineno,"x-broken-hkp",
- "--keyserver-options ","broken-http-proxy");
- xfree(keyserver->scheme);
- keyserver->scheme=xstrdup("hkp");
- append_to_strlist(&opt.keyserver_options.other,"broken-http-proxy");
+ log_info ("keyserver option '%s' is obsolete\n",
+ "x-broken-hkp");
}
else if(ascii_strcasecmp(keyserver->scheme,"x-hkp")==0)
{
diff --git a/g10/options.h b/g10/options.h
index 9aadb4219..7b9f36635 100644
--- a/g10/options.h
+++ b/g10/options.h
@@ -146,7 +146,6 @@ struct
unsigned int options;
unsigned int import_options;
unsigned int export_options;
- strlist_t other;
} keyserver_options;
int exec_disable;
int exec_path_set;