diff options
author | Werner Koch <[email protected]> | 2011-02-08 20:11:19 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2011-02-08 20:11:19 +0000 |
commit | 2c79a2832cd3cbc1c09f4f7a7b2653ba6cbd2845 (patch) | |
tree | 87e424f10a74c0cecce3c3ecc96b43eaca1b892c /dirmngr/server.c | |
parent | Fix ECDSA 521 bit signing. (diff) | |
download | gnupg-2c79a2832cd3cbc1c09f4f7a7b2653ba6cbd2845.tar.gz gnupg-2c79a2832cd3cbc1c09f4f7a7b2653ba6cbd2845.zip |
Add finger support to dirmngr.
The basic network code from http.c is used for finger. This keeps the
network related code at one place and we are able to use the somewhat
matured code form http.c. Unfortunately I had to enhance the http
code for more robustness and probably introduced new bugs.
Test this code using
gpg --fetch-key finger:[email protected]
(I might be the last user of finger ;-)
Diffstat (limited to 'dirmngr/server.c')
-rw-r--r-- | dirmngr/server.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/dirmngr/server.c b/dirmngr/server.c index 86b21b67b..403a13692 100644 --- a/dirmngr/server.c +++ b/dirmngr/server.c @@ -1541,6 +1541,34 @@ cmd_ks_get (assuan_context_t ctx, char *line) } +static const char hlp_ks_fetch[] = + "KS_FETCH <URL>\n" + "\n" + "Get the key(s) from URL."; +static gpg_error_t +cmd_ks_fetch (assuan_context_t ctx, char *line) +{ + ctrl_t ctrl = assuan_get_pointer (ctx); + gpg_error_t err; + estream_t outfp; + + /* No options for now. */ + line = skip_options (line); + + /* Setup an output stream and perform the get. */ + outfp = es_fopencookie (ctx, "w", data_line_cookie_functions); + if (!outfp) + err = set_error (GPG_ERR_ASS_GENERAL, "error setting up a data stream"); + else + { + err = ks_action_fetch (ctrl, line, outfp); + es_fclose (outfp); + } + + return leave_cmd (ctx, err); +} + + static const char hlp_ks_put[] = "KS_PUT\n" @@ -1742,6 +1770,7 @@ register_commands (assuan_context_t ctx) { "KEYSERVER", cmd_keyserver, hlp_keyserver }, { "KS_SEARCH", cmd_ks_search, hlp_ks_search }, { "KS_GET", cmd_ks_get, hlp_ks_get }, + { "KS_FETCH", cmd_ks_fetch, hlp_ks_fetch }, { "KS_PUT", cmd_ks_put, hlp_ks_put }, { "GETINFO", cmd_getinfo, hlp_getinfo }, { "KILLDIRMNGR",cmd_killdirmngr,hlp_killdirmngr }, |