1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-06-13 00:09:51 +02:00
Commit Graph

145 Commits

Author SHA1 Message Date
David Shaw
c826ccdec1 * ksutil.c (curl_err_to_gpg_err): Add CURLE_OK and CURLE_COULDNT_CONNECT.
* gpgkeys_curl.c (get_key): Give key-not-found error if no data is found
(or file itself is not found) during a fetch.
2005-12-07 22:25:58 +00:00
David Shaw
d6e918e40f * curl-shim.c (curl_easy_perform): Fix build warning (code before
declaration).
2005-12-06 18:49:34 +00:00
David Shaw
2a662f7870 Fix various build warnings reported by Joe Vender on MinGW. 2005-11-03 04:46:20 +00:00
David Shaw
aec65a94d8 * ksutil.h, ksutil.c (parse_ks_options): Remove exact-name and
exact-email.  (classify_ks_search): Mimic the gpg search modes instead
with *, =, <, and @.

* gpgkeys_ldap.c (search_key), gpgkeys_hkp.c (search_key): Call them
here.  Suggested by Jason Harris.
2005-08-26 04:24:46 +00:00
David Shaw
70bf6d9204 * ksutil.h, ksutil.c (parse_ks_options): New keyserver-option exact-name.
The last of exact-name and exact-email overrides the earlier.

* gpgkeys_ldap.c (search_key), gpgkeys_hkp.c (search_key): Use it here to
do a name-only search.
2005-08-18 21:14:16 +00:00
David Shaw
2d353af65d * gpgkeys_ldap.c (ldap_quote): \-quote a string for LDAP.
* gpgkeys_ldap.c (search_key): Use it here to escape reserved characters
in searches.
2005-08-18 17:40:04 +00:00
David Shaw
e9b444a9d0 * ksutil.h, ksutil.c (parse_ks_options): New keyserver-option
exact-email.

* gpgkeys_ldap.c (search_key), gpgkeys_hkp.c (search_key): Use it here
to do an email-only search.
2005-08-18 04:17:20 +00:00
David Shaw
f02c0f6849 * Makefile.am: Include LDAP_CPPFLAGS when building LDAP. 2005-08-08 17:35:29 +00:00
David Shaw
1990aacce0 * gpgkeys_hkp.c (main), gpgkeys_curl.c (main), curl-shim.h: Show
version of curl (or curl-shim) when debug is set.
2005-08-04 03:59:16 +00:00
David Shaw
6f0ed8571b * gpgkeys_curl.c (get_key, main): Don't try and be smart about what
protocols we handle.  Directly pass them to curl or fake-curl and see if
an error comes back.

* curl-shim.h, curl-shim.c (handle_error), ksutil.c (curl_err_to_gpg_err):
Add support for CURLE_UNSUPPORTED_PROTOCOL in fake curl.

* Makefile.am: Don't need -DFAKE_CURL any longer since it's in config.h.
2005-07-20 21:48:28 +00:00
David Shaw
ccab129be5 * gpgkeys_mailto.in, gpgkeys_test.in: Use @VERSION@ so version string
stays up to date.

* gpgkeys_http.c: Don't need to define HTTP_PROXY_ENV here since it's
in ksutil.h.

* gpgkeys_curl.c (get_key, main), gpgkeys_hkp.c (main): Pass AUTH
values to curl or curl-shim.

* curl-shim.c (curl_easy_perform), gpgkeys_curl.c (main),
gpgkeys_hkp.c (main): Use curl-style proxy semantics.
2005-06-23 23:42:35 +00:00
David Shaw
d65763eccd * curl-shim.h, curl-shim.c (curl_easy_setopt, curl_easy_perform): Add
CURLOPT_USERPWD option for HTTP auth.
2005-06-23 04:44:20 +00:00
David Shaw
ffa6854080 * gpgkeys_http.c (get_key), gpgkeys_oldhkp (send_key, get_key,
search_key): No longer need to pass a proxyauth.

* gpgkeys_http.c (get_key): Pass auth outside of the URL.
2005-06-23 04:26:01 +00:00
David Shaw
7f4d49b470 * gpgkeys_http.c (get_key), gpgkeys_oldhkp.c (send_key, get_key,
search_key): Fix http_open/http_open_document calls to pass NULL for
auth and proxyauth since these programs pass them in the URL.
2005-06-22 04:16:29 +00:00
David Shaw
4e9797031f * gpgkeys_hkp.c (append_path, send_key, get_key, search_key, main),
gpgkeys_oldhkp.c (main): Properly handle double slashes in paths.
2005-06-21 04:24:10 +00:00
David Shaw
34ff103d2a * ksutil.c (init_ks_options, parse_ks_options): Provide a default "/"
path unless overridden by the config.  Allow config to specify items
multiple times and take the last specified item.
2005-06-05 14:34:47 +00:00
David Shaw
c347404bfd * gpgkeys_hkp.c, gpgkeys_oldhkp.c: Add support for HKP servers that
aren't at the root path.  Suggested by Jack Bates.
2005-06-04 23:09:27 +00:00
David Shaw
a644a1d3d7 * ksutil.c [HAVE_DOSISH_SYSTEM]: Fix warnings on mingw32. Noted by Joe
Vender.
2005-06-01 19:08:56 +00:00
David Shaw
d9d902dffb * ksutil.h, ksutil.c: #ifdef so we can build without libcurl or
fake-curl.
2005-05-04 13:34:25 +00:00
David Shaw
049195f9e0 * gpgkeys_http.c: Need GET defined. 2005-05-04 02:46:02 +00:00
David Shaw
5e6d360596 * gpgkeys_hkp.c, gpgkeys_oldhkp.c, ksutil.h: Some minor cleanup and
comments as to the size of MAX_LINE and MAX_URL.
2005-05-02 00:46:39 +00:00
David Shaw
0884653a13 * gpgkeys_hkp.c: New hkp handler that uses curl or curl-shim.
* Makefile.am: Build new gpgkeys_hkp.

* curl-shim.c (curl_easy_perform): Cleanup.
2005-04-17 02:18:32 +00:00
David Shaw
5609f5eafd * ksutil.h, ksutil.c (curl_writer), gpgkeys_curl.c (get_key): Pass a
context to curl_writer so we can support multiple fetches in a single
session.
2005-04-17 01:52:04 +00:00
David Shaw
f50e99ed7b * curl-shim.h, curl-shim.c (handle_error, curl_easy_setopt,
curl_easy_perform): Add POST functionality to the curl shim.
2005-04-17 01:39:24 +00:00
David Shaw
d8e1f7656b * curl-shim.h, curl-shim.c (curl_escape, curl_free): Emulate
curl_escape and curl_free.
2005-04-16 22:21:28 +00:00
David Shaw
5748f595b0 * gpgkeys_curl.c (main): If the http-proxy option is given without any
arguments, try to get the proxy from the environment.

* ksutil.h, ksutil.c (curl_err_to_gpg_err, curl_writer): Copy from
gpgkeys_curl.c.

* gpgkeys_oldhkp.c: Copy from gpgkeys_hkp.c.
2005-04-16 18:50:46 +00:00
David Shaw
1517f0e945 * gpgkeys_ldap.c, ksutil.h, ksutil.c (print_nocr): Moved from
gpgkeys_ldap.c.  Print a string, but strip out any CRs.

* gpgkeys_finger.c (get_key), gpgkeys_hkp.c (get_key), gpgkeys_http.c
(get_key): Use it here when outputting key material to canonicalize
line endings.
2005-03-22 23:41:08 +00:00
David Shaw
8885f0b0cc * gpgkeys_ldap.c (main): Fix three wrong calls to fail_all(). Noted
by Stefan Bellon.
2005-03-19 14:24:36 +00:00
David Shaw
24a34eea61 * ksutil.c (parse_ks_options): Handle verbose=nnn.
* Makefile.am: Calculate GNUPG_LIBEXECDIR directly.  Do not redefine
$libexecdir.
2005-03-17 23:16:41 +00:00
David Shaw
efa0dd21a2 * gpgkeys_curl.c, gpgkeys_finger.c, gpgkeys_ldap.c: Start using
parse_ks_options and remove a lot of common code.

* ksutil.h, ksutil.c (parse_ks_options): Parse OPAQUE, and default
debug with no arguments to 1.
2005-03-17 16:42:41 +00:00
David Shaw
dee66f5cc9 * gpgkeys_ldap.c: Include lber.h if configure determines we need it. 2005-03-17 04:02:17 +00:00
David Shaw
4f347281a9 * ksutil.h, ksutil.c (ks_action_to_string): New. (free_ks_options): Only
free if options exist.
2005-03-16 23:46:07 +00:00
David Shaw
a90637513c * ksutil.h, ksutil.c (init_ks_options, free_ks_options,
parse_ks_options): Pull a lot of duplicated code into a single options
parser for all keyserver helpers.
2005-03-16 15:17:03 +00:00
David Shaw
2833a0eadc * curl-shim.c (curl_easy_perform): Fix compile warning.
* curl-shim.h, gpgkeys_curl.c (main), gpgkeys_ldap.c (main): Add
ca-cert-file option, to pass in the SSL cert.
2005-02-12 03:15:02 +00:00
David Shaw
25001837e9 * curl-shim.h, curl-shim.c: New. This is code to fake the curl API in
terms of the current HTTP iobuf API.

* gpgkeys_curl.c [FAKE_CURL], Makefile.am: If FAKE_CURL is set, link with
the iobuf code rather than libcurl.
2005-02-11 18:05:13 +00:00
David Shaw
203e4835f6 * gpgkeys_finger.c (main), gpgkeys_hkp.c (main): Fix --version output.
* gpgkeys_curl.c (main): Make sure the curl handle is cleaned up on
failure.
2005-02-05 15:04:59 +00:00
David Shaw
b663f3f8d3 * gpgkeys_hkp.c (get_key), gpgkeys_http.c (get_key): Fix missing
http_close() calls.  Noted by Phil Pennock.
2005-02-01 20:57:08 +00:00
David Shaw
9af66d4634 * ksutil.h: Up the default timeout to two minutes. 2005-02-01 17:08:18 +00:00
David Shaw
5d257ee60e * gpgkeys_ldap.c (print_nocr): New. (get_key): Call it here to
canonicalize line endings.

* gpgkeys_curl.c (writer): Discard everything outside the BEGIN and
END lines when retrieving keys.  Canonicalize line endings.  (main):
Accept FTPS.
2005-01-24 18:23:56 +00:00
David Shaw
2b10681641 * gpgkeys_ldap.c (main): Add "check-cert" option to disable SSL
certificate checking (which is on by default).

* gpgkeys_curl.c (main): Add "debug" option to match the LDAP helper.
Add "check-cert" option to disable SSL certificate checking (which is
on by default).
2005-01-22 03:27:19 +00:00
David Shaw
115ebcfcf8 * gpgkeys_curl.c: Fix typo. 2005-01-18 14:43:14 +00:00
Werner Koch
02a85a958c * gpgkeys_curl.c: s/MAX_PATH/URLMAX_PATH/g to avoid a clash with
the W32 defined macro.  Removed unneeded initialization of static
variables.
* gpgkeys_http.c: Ditto.
* ksutil.h: s/MAX_PATH/URLMAX_PATH/.
2005-01-18 11:16:10 +00:00
David Shaw
8220c9e799 * gpgkeys_curl.c (main): Only allow specified protocols to use the
curl handler.

* Makefile.am: Use LIBCURL_CPPFLAGS instead of LIBCURL_INCLUDES.
2005-01-18 04:24:52 +00:00
David Shaw
996c82ffd6 * ksutil.h, gpgkeys_curl.c, gpgkeys_hkp.c, gpgkeys_ldap.c,
gpgkeys_finger.c, gpgkeys_http.c: Part 2 of the cleanup.  Move all the
various defines to ksutil.h.
2005-01-13 23:37:26 +00:00
David Shaw
0a42f97e43 * gpgkeys_finger.c, gpgkeys_hkp.c, gpgkeys_http.c, gpgkeys_ldap.c: Part 1
of a minor cleanup to use #defines instead of hard-coded sizes.
2005-01-13 23:22:10 +00:00
David Shaw
3fe489d1ac * gpgkeys_finger.c (connect_server): Use INADDR_NONE instead of
SOCKET_ERROR.  Noted by Timo.
2005-01-13 22:08:18 +00:00
David Shaw
1f91ed775c * gpgkeys_curl.c (get_key): Newer versions of libcurl don't define TRUE. 2005-01-10 03:46:12 +00:00
David Shaw
d341143cd7 * gpgkeys_curl.c (main): Use new defines for opting out of certain
transfer protocols.  Allow setting HTTP proxy via "http-proxy=foo" option
(there is natural support in libcurl for the http_proxy environment
variable).

* Makefile.am: Remove the conditional since this is all handled in
autoconf now.
2004-12-24 19:48:36 +00:00
David Shaw
97b8f41b08 * gpgkeys_curl.c (main): New "follow-redirects" option. Takes an optional
numeric value for the maximum number of redirects to allow.  Defaults to
5.

* gpgkeys_curl.c (main), gpgkeys_finger.c (main), gpgkeys_hkp.c (main),
gpgkeys_http.c (main), gpgkeys_ldap.c (main): Make sure that a "timeout"
option passed with no arguments is properly handled.
2004-12-22 19:19:10 +00:00
David Shaw
0361c6f01b * gpgkeys_curl.c (get_key, writer): New function to wrap around fwrite to
avoid DLL access problem on win32.

* gpgkeys_http.c (main, get_key): Properly pass authentication info
through to the http library.
2004-12-22 18:07:21 +00:00