aboutsummaryrefslogtreecommitdiffstats
path: root/dirmngr/ks-engine-hkp.c
diff options
context:
space:
mode:
authorDaniel Kahn Gillmor <[email protected]>2019-06-11 07:25:46 +0000
committerWerner Koch <[email protected]>2019-07-04 14:31:56 +0000
commitefb6e08ea2ca1cf2d39135d94195802cd69b9ea6 (patch)
tree546a5aa3c08c7ea9bbea540766b6b16e400a25da /dirmngr/ks-engine-hkp.c
parentgpg: Add "self-sigs-only" and "import-clean" to the keyserver options. (diff)
downloadgnupg-efb6e08ea2ca1cf2d39135d94195802cd69b9ea6.tar.gz
gnupg-efb6e08ea2ca1cf2d39135d94195802cd69b9ea6.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 <[email protected]> GnuPG-Bug_id: 4566 Signed-off-by: Daniel Kahn Gillmor <[email protected]>
Diffstat (limited to '')
-rw-r--r--dirmngr/ks-engine-hkp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/dirmngr/ks-engine-hkp.c b/dirmngr/ks-engine-hkp.c
index aa885c55a..a8b1ec271 100644
--- a/dirmngr/ks-engine-hkp.c
+++ b/dirmngr/ks-engine-hkp.c
@@ -1179,6 +1179,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),
@@ -1188,7 +1189,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 (&http,
post_cb? HTTP_REQ_POST : HTTP_REQ_GET,
request,
@@ -1268,6 +1268,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;