aboutsummaryrefslogtreecommitdiffstats
path: root/g10/keyserver.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2015-04-21 08:15:04 +0000
committerWerner Koch <[email protected]>2015-04-21 08:15:04 +0000
commitda1990bac71f6447d8ebd169c3b3b186e9f287d9 (patch)
tree900ced4003c49e92bbfaac96a1b8b3cfa4c372b0 /g10/keyserver.c
parentRemove the obsolete keyserver directory from the repo. (diff)
downloadgnupg-da1990bac71f6447d8ebd169c3b3b186e9f287d9.tar.gz
gnupg-da1990bac71f6447d8ebd169c3b3b186e9f287d9.zip
gpg: Update sub-options of --keyserver-options
* g10/options.h (KEYSERVER_HTTP_PROXY): New. (KEYSERVER_USE_TEMP_FILES, KEYSERVER_KEEP_TEMP_FILES): Remove. (KEYSERVER_TIMEOUT): New. * common/keyserver.h (KEYSERVER_TIMEOUT): Remove. * g10/keyserver.c (keyserver_opts): Remove obsolete "use-temp-files" and "keep-temp-files". Add "http-proxy" and "timeout". (parse_keyserver_options): Remove 1.2 compatibility option "honor-http_proxy". Remove "use-temp-files" and "keep-temp-files" code. -- Note that many of these options where implicitly used by passing any unknown option down to the former keyserver helpers. The don't exist anymore thus we need to make them explicit. Another patch will convey them to dirmngr. Temp files are not anymore used thus they can be removed and will be ignored when used. Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to '')
-rw-r--r--g10/keyserver.c46
1 files changed, 12 insertions, 34 deletions
diff --git a/g10/keyserver.c b/g10/keyserver.c
index 7cac55eda..3aed54bc9 100644
--- a/g10/keyserver.c
+++ b/g10/keyserver.c
@@ -91,13 +91,14 @@ static struct parse_options keyserver_opts[]=
{
/* some of these options are not real - just for the help
message */
- {"max-cert-size",0,NULL,NULL},
+ {"max-cert-size",0,NULL,NULL}, /* MUST be the first in this array! */
+
{"include-revoked",0,NULL,N_("include revoked keys in search results")},
{"include-subkeys",0,NULL,N_("include subkeys when searching by key ID")},
- {"use-temp-files",0,NULL,
- N_("use temporary files to pass data to keyserver helpers")},
- {"keep-temp-files",KEYSERVER_KEEP_TEMP_FILES,NULL,
- N_("do not delete temporary files after using them")},
+ {"http-proxy", KEYSERVER_HTTP_PROXY, NULL,
+ N_("override proxy options set for dirmngr")},
+ {"timeout", KEYSERVER_TIMEOUT, NULL,
+ N_("override timeout options set for dirmngr")},
{"refresh-add-fake-v3-keyids",KEYSERVER_ADD_FAKE_V3,NULL,
NULL},
{"auto-key-retrieve",KEYSERVER_AUTO_KEY_RETRIEVE,NULL,
@@ -155,37 +156,13 @@ parse_keyserver_options(char *options)
if(tok[0]=='\0')
continue;
- /* For backwards compatibility. 1.2.x used honor-http-proxy and
- there are a good number of documents published that recommend
- it. */
- if(ascii_strcasecmp(tok,"honor-http-proxy")==0)
- tok="http-proxy";
- else if(ascii_strcasecmp(tok,"no-honor-http-proxy")==0)
- tok="no-http-proxy";
-
/* We accept quite a few possible options here - some options to
handle specially, the keyserver_options list, and import and
- export options that pertain to keyserver operations. Note
- that you must use strncasecmp here as there might be an
- =argument attached which will foil the use of strcasecmp. */
-
-#ifdef EXEC_TEMPFILE_ONLY
- if(ascii_strncasecmp(tok,"use-temp-files",14)==0 ||
- ascii_strncasecmp(tok,"no-use-temp-files",17)==0)
- log_info(_("WARNING: keyserver option '%s' is not used"
- " on this platform\n"),tok);
-#else
- if(ascii_strncasecmp(tok,"use-temp-files",14)==0)
- opt.keyserver_options.options|=KEYSERVER_USE_TEMP_FILES;
- else if(ascii_strncasecmp(tok,"no-use-temp-files",17)==0)
- opt.keyserver_options.options&=~KEYSERVER_USE_TEMP_FILES;
-#endif
- else if(!parse_options(tok,&opt.keyserver_options.options,
- keyserver_opts,0)
- && !parse_import_options(tok,
- &opt.keyserver_options.import_options,0)
- && !parse_export_options(tok,
- &opt.keyserver_options.export_options,0))
+ export options that pertain to keyserver operations. */
+
+ if (!parse_options (tok,&opt.keyserver_options.options, keyserver_opts,0)
+ && !parse_import_options(tok,&opt.keyserver_options.import_options,0)
+ && !parse_export_options(tok,&opt.keyserver_options.export_options,0))
{
/* All of the standard options have failed, so the option was
destined for a keyserver plugin as used by GnuPG < 2.1 */
@@ -204,6 +181,7 @@ parse_keyserver_options(char *options)
return ret;
}
+
void
free_keyserver_spec(struct keyserver_spec *keyserver)
{