aboutsummaryrefslogtreecommitdiffstats
path: root/dirmngr/misc.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2017-11-14 15:24:12 +0000
committerWerner Koch <[email protected]>2017-11-14 15:24:12 +0000
commitd4e2302d8f4a1ff52d56da4f8e3a5d1c6303822d (patch)
tree5b4411772c0b11d7f079aad9407d5504f8f4938c /dirmngr/misc.c
parentdirmngr: Add a background task framework. (diff)
downloadgnupg-d4e2302d8f4a1ff52d56da4f8e3a5d1c6303822d.tar.gz
gnupg-d4e2302d8f4a1ff52d56da4f8e3a5d1c6303822d.zip
dirmngr: Check for WKD support at session end
* dirmngr/domaininfo.c (insert_or_update): Copy the name. * dirmngr/misc.c (copy_stream): Allow arg OUT to be NULL. * dirmngr/server.c (set_error): Protect CTX. (dirmngr_status): Protect against missing ASSUAN_CTX. (dirmngr_status_help): Ditto. (dirmngr_status_printf): Ditto. (cmd_wkd_get): Factor code out to ... (proc_wkd_get): new func. Support silent operation with no CTX. (task_check_wkd_support): New. -- This finalizes the feature to efficiently cache WKD checks. If a standard WKD query returns no data, we queue a test to be run after the end of the session (so that we do not delay the calling client). This check tests whether the server responsible for the queried address has WKD at all enabled. The test is done by checking whether the "policy" file exists. We do not check the "submission-address" file because that is not necessary for the web key operation. The policy file is now required. Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'dirmngr/misc.c')
-rw-r--r--dirmngr/misc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/dirmngr/misc.c b/dirmngr/misc.c
index 1716141a6..6291a9a35 100644
--- a/dirmngr/misc.c
+++ b/dirmngr/misc.c
@@ -636,7 +636,9 @@ armor_data (char **r_string, const void *data, size_t datalen)
return 0;
}
-/* Copy all data from IN to OUT. */
+
+/* Copy all data from IN to OUT. OUT may be NULL to use this fucntion
+ * as a dummy reader. */
gpg_error_t
copy_stream (estream_t in, estream_t out)
{
@@ -647,9 +649,8 @@ copy_stream (estream_t in, estream_t out)
{
if (!nread)
return 0; /* EOF */
- if (es_write (out, buffer, nread, NULL))
+ if (out && es_write (out, buffer, nread, NULL))
break;
-
}
return gpg_error_from_syserror ();
}