aboutsummaryrefslogtreecommitdiffstats
path: root/g10/call-dirmngr.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2016-10-27 06:44:19 +0000
committerWerner Koch <[email protected]>2016-10-27 07:06:10 +0000
commita15ed5a1fd5307b3ec1822daf3b138b187db0b5e (patch)
treede308cfd919343fc9b8109ae1b2c547401140ede /g10/call-dirmngr.c
parentcommon: Fix gnupg_inotify_has_name, differently. (diff)
downloadgnupg-a15ed5a1fd5307b3ec1822daf3b138b187db0b5e.tar.gz
gnupg-a15ed5a1fd5307b3ec1822daf3b138b187db0b5e.zip
gpg: Convey --quick option to dirmngr for --auto-key-retrieve.
* g10/call-dirmngr.c (gpg_dirmngr_ks_get): Add arg 'quick'. (gpg_dirmngr_wkd_get): Ditto. * g10/keyserver.c (keyserver_get): Add arg 'quick'. (keyserver_get_chunk): Add arg 'quick'. (keyserver_import_fprint): Ditto. Change callers to pass 0 for it. (keyserver_import_keyid): Ditto. (keyserver_import_wkd): Ditto. * g10/mainproc.c (check_sig_and_print): Call the 3 fucntions with QUICK set. -- Note that this option has not yet been implemented by dirmngr. Dirmngr will simply ignore it for now. Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'g10/call-dirmngr.c')
-rw-r--r--g10/call-dirmngr.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/g10/call-dirmngr.c b/g10/call-dirmngr.c
index 75a7f4650..f7398333c 100644
--- a/g10/call-dirmngr.c
+++ b/g10/call-dirmngr.c
@@ -600,6 +600,8 @@ ks_get_data_cb (void *opaque, const void *data, size_t datalen)
don't need to escape the patterns before sending them to the
server.
+ If QUICK is set the dirmngr is advised to use a shorter timeout.
+
If R_SOURCE is not NULL the source of the data is stored as a
malloced string there. If a source is not known NULL is stored.
@@ -609,7 +611,7 @@ ks_get_data_cb (void *opaque, const void *data, size_t datalen)
are able to ask for (1000-10-1)/(2+8+1) = 90 keys at once. */
gpg_error_t
gpg_dirmngr_ks_get (ctrl_t ctrl, char **pattern,
- keyserver_spec_t override_keyserver,
+ keyserver_spec_t override_keyserver, int quick,
estream_t *r_fp, char **r_source)
{
gpg_error_t err;
@@ -655,7 +657,7 @@ gpg_dirmngr_ks_get (ctrl_t ctrl, char **pattern,
/* Lump all patterns into one string. */
init_membuf (&mb, 1024);
- put_membuf_str (&mb, "KS_GET --");
+ put_membuf_str (&mb, quick? "KS_GET --quick --" : "KS_GET --");
for (idx=0; pattern[idx]; idx++)
{
put_membuf (&mb, " ", 1); /* Append Delimiter. */
@@ -1289,11 +1291,11 @@ gpg_dirmngr_get_pka (ctrl_t ctrl, const char *userid,
/* Ask the dirmngr to retrieve a key via the Web Key Directory
- * protocol. On success a new estream with the key is stored at
- * R_KEY.
+ * protocol. If QUICK is set the dirmngr is advised to use a shorter
+ * timeout. On success a new estream with the key is stored at R_KEY.
*/
gpg_error_t
-gpg_dirmngr_wkd_get (ctrl_t ctrl, const char *name, estream_t *r_key)
+gpg_dirmngr_wkd_get (ctrl_t ctrl, const char *name, int quick, estream_t *r_key)
{
gpg_error_t err;
assuan_context_t ctx;
@@ -1306,7 +1308,7 @@ gpg_dirmngr_wkd_get (ctrl_t ctrl, const char *name, estream_t *r_key)
if (err)
return err;
- line = es_bsprintf ("WKD_GET -- %s", name);
+ line = es_bsprintf ("WKD_GET%s -- %s", quick?" --quick":"", name);
if (!line)
{
err = gpg_error_from_syserror ();