mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-18 14:17:03 +01:00
dirmngr: fix handling of HTTP redirections
* dirmngr/ks-engine-http.c (ks_http_fetch): Reinitialize HTTP session when following a HTTP redirection. Signed-off-by: Damien Goutte-Gattat <dgouttegattat@incenp.org>
This commit is contained in:
parent
1e9bc66a9a
commit
60428c24fb
@ -73,6 +73,7 @@ ks_http_fetch (ctrl_t ctrl, const char *url, estream_t *r_fp)
|
|||||||
estream_t fp = NULL;
|
estream_t fp = NULL;
|
||||||
char *request_buffer = NULL;
|
char *request_buffer = NULL;
|
||||||
|
|
||||||
|
once_more:
|
||||||
/* Note that we only use the system provided certificates with the
|
/* Note that we only use the system provided certificates with the
|
||||||
* fetch command. */
|
* fetch command. */
|
||||||
err = http_session_new (&session, NULL, NULL, HTTP_FLAG_TRUST_SYS);
|
err = http_session_new (&session, NULL, NULL, HTTP_FLAG_TRUST_SYS);
|
||||||
@ -81,7 +82,6 @@ ks_http_fetch (ctrl_t ctrl, const char *url, estream_t *r_fp)
|
|||||||
http_session_set_log_cb (session, cert_log_cb);
|
http_session_set_log_cb (session, cert_log_cb);
|
||||||
|
|
||||||
*r_fp = NULL;
|
*r_fp = NULL;
|
||||||
once_more:
|
|
||||||
err = http_open (&http,
|
err = http_open (&http,
|
||||||
HTTP_REQ_GET,
|
HTTP_REQ_GET,
|
||||||
url,
|
url,
|
||||||
@ -146,6 +146,7 @@ ks_http_fetch (ctrl_t ctrl, const char *url, estream_t *r_fp)
|
|||||||
url = request_buffer;
|
url = request_buffer;
|
||||||
http_close (http, 0);
|
http_close (http, 0);
|
||||||
http = NULL;
|
http = NULL;
|
||||||
|
http_session_release (session);
|
||||||
goto once_more;
|
goto once_more;
|
||||||
}
|
}
|
||||||
err = gpg_error_from_syserror ();
|
err = gpg_error_from_syserror ();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user