aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Kahn Gillmor <[email protected]>2019-06-11 07:25:46 +0000
committerDaniel Kahn Gillmor <[email protected]>2019-06-11 07:25:46 +0000
commitd4dc1ee403c5fd09ebcf5de213b940d35b8337f2 (patch)
treedbaab86771d5fba2cd5dfe1e6376976c08d93ce3
parentReturn better error code for some getinfo IPC commands. (diff)
downloadgnupg-dkg-fix-T4566.tar.gz
gnupg-dkg-fix-T4566.zip
dirmngr: fix handling of HTTPS redirections during HKPdkg-fix-T4566
* 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]>
-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 e3c09c26e..36e3a25de 100644
--- a/dirmngr/ks-engine-hkp.c
+++ b/dirmngr/ks-engine-hkp.c
@@ -1175,6 +1175,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),
@@ -1184,7 +1185,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,
@@ -1264,6 +1264,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;