diff options
author | Daniel Kahn Gillmor <dkg@fifthhorseman.net> | 2019-06-11 09:25:46 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2019-07-04 16:36:18 +0200 |
commit | 064aeb14c9b869e114e9ec789526fad8da657230 (patch) | |
tree | 804c01b1ce15b951ecb949adbd4686c62394847e /dirmngr/ks-engine-hkp.c | |
parent | gpg: Add "self-sigs-only" and "import-clean" to the keyserver options. (diff) | |
download | gnupg2-064aeb14c9b869e114e9ec789526fad8da657230.tar.xz gnupg2-064aeb14c9b869e114e9ec789526fad8da657230.zip |
dirmngr: fix handling of HTTPS redirections during HKP
* dirmngr/ks-engine-hkp.c (send_request): Reinitialize HTTP session when
following a HTTP redirection.
--
inspired by patch from Damien Goutte-Gattat <dgouttegattat@incenp.org>
GnuPG-Bug_id: 4566
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Originally applied to 2.2. Here a minor conflict fix was needed.
Diffstat (limited to '')
-rw-r--r-- | dirmngr/ks-engine-hkp.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/dirmngr/ks-engine-hkp.c b/dirmngr/ks-engine-hkp.c index ef33db229..f8814ecd0 100644 --- a/dirmngr/ks-engine-hkp.c +++ b/dirmngr/ks-engine-hkp.c @@ -1221,6 +1221,7 @@ send_request (ctrl_t ctrl, const char *request, const char *hostportstr, /* FIXME: I am not sure whey we allow a downgrade for hkp requests. * Needs at least an explanation here.. */ + once_more: err = http_session_new (&session, httphost, ((ctrl->http_no_crl? HTTP_FLAG_NO_CRL : 0) | HTTP_FLAG_TRUST_DEF), @@ -1230,7 +1231,6 @@ send_request (ctrl_t ctrl, const char *request, const char *hostportstr, http_session_set_log_cb (session, cert_log_cb); http_session_set_timeout (session, ctrl->timeout); - once_more: err = http_open (ctrl, &http, post_cb? HTTP_REQ_POST : HTTP_REQ_GET, request, @@ -1310,6 +1310,8 @@ send_request (ctrl_t ctrl, const char *request, const char *hostportstr, request = request_buffer; http_close (http, 0); http = NULL; + http_session_release (session); + session = NULL; } goto once_more; |