mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-03 12:11:33 +01:00
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>
This commit is contained in:
parent
f325102375
commit
d4dc1ee403
@ -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.
|
/* FIXME: I am not sure whey we allow a downgrade for hkp requests.
|
||||||
* Needs at least an explanation here.. */
|
* Needs at least an explanation here.. */
|
||||||
|
|
||||||
|
once_more:
|
||||||
err = http_session_new (&session, httphost,
|
err = http_session_new (&session, httphost,
|
||||||
((ctrl->http_no_crl? HTTP_FLAG_NO_CRL : 0)
|
((ctrl->http_no_crl? HTTP_FLAG_NO_CRL : 0)
|
||||||
| HTTP_FLAG_TRUST_DEF),
|
| 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_log_cb (session, cert_log_cb);
|
||||||
http_session_set_timeout (session, ctrl->timeout);
|
http_session_set_timeout (session, ctrl->timeout);
|
||||||
|
|
||||||
once_more:
|
|
||||||
err = http_open (&http,
|
err = http_open (&http,
|
||||||
post_cb? HTTP_REQ_POST : HTTP_REQ_GET,
|
post_cb? HTTP_REQ_POST : HTTP_REQ_GET,
|
||||||
request,
|
request,
|
||||||
@ -1264,6 +1264,8 @@ send_request (ctrl_t ctrl, const char *request, const char *hostportstr,
|
|||||||
request = request_buffer;
|
request = request_buffer;
|
||||||
http_close (http, 0);
|
http_close (http, 0);
|
||||||
http = NULL;
|
http = NULL;
|
||||||
|
http_session_release (session);
|
||||||
|
session = NULL;
|
||||||
}
|
}
|
||||||
goto once_more;
|
goto once_more;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user