summaryrefslogtreecommitdiffstats
path: root/dirmngr/ks-action.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2011-02-09 15:42:29 +0100
committerWerner Koch <wk@gnupg.org>2011-02-09 15:42:29 +0100
commitf02d972aec94e3ec8fdadd080d159d5a34c96722 (patch)
treebc10d5f96c9d58adb0a48c94154694963e2b2b8e /dirmngr/ks-action.c
parentAdd finger support to dirmngr. (diff)
downloadgnupg2-f02d972aec94e3ec8fdadd080d159d5a34c96722.tar.xz
gnupg2-f02d972aec94e3ec8fdadd080d159d5a34c96722.zip
Support key fetching using HTTP.
A simple test case is: gpg2 --fetch-key http://werner.eifelkommune.de/mykey.asc
Diffstat (limited to 'dirmngr/ks-action.c')
-rw-r--r--dirmngr/ks-action.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/dirmngr/ks-action.c b/dirmngr/ks-action.c
index dff49979f..ec691fe2a 100644
--- a/dirmngr/ks-action.c
+++ b/dirmngr/ks-action.c
@@ -167,7 +167,12 @@ ks_action_fetch (ctrl_t ctrl, const char *url, estream_t outfp)
if (parsed_uri->is_http)
{
- err = gpg_error (GPG_ERR_NOT_IMPLEMENTED);
+ err = ks_http_fetch (ctrl, url, &infp);
+ if (!err)
+ {
+ err = copy_stream (infp, outfp);
+ es_fclose (infp);
+ }
}
else if (!parsed_uri->opaque)
{
@@ -175,12 +180,10 @@ ks_action_fetch (ctrl_t ctrl, const char *url, estream_t outfp)
}
else if (!strcmp (parsed_uri->scheme, "finger"))
{
- err = ks_finger_get (ctrl, parsed_uri, &infp);
+ err = ks_finger_fetch (ctrl, parsed_uri, &infp);
if (!err)
{
err = copy_stream (infp, outfp);
- /* Reading from the finger serrver should not fail, thus
- return this error. */
es_fclose (infp);
}
}