summaryrefslogtreecommitdiffstats
path: root/dirmngr/crlfetch.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2018-04-25 12:37:34 +0200
committerWerner Koch <wk@gnupg.org>2018-04-25 12:38:04 +0200
commit1de4462974113ac18cf98f903e97cd1127fa842f (patch)
tree4a6bb39fa00a2dcee2dc9bfe635821bd3f8832a8 /dirmngr/crlfetch.c
parentdirmngr: Implement CRL fetching via https. (diff)
downloadgnupg2-1de4462974113ac18cf98f903e97cd1127fa842f.tar.xz
gnupg2-1de4462974113ac18cf98f903e97cd1127fa842f.zip
dirmngr: Allow redirection from https to http for CRLs
* dirmngr/ks-engine.h (KS_HTTP_FETCH_NOCACHE): New flag. (KS_HTTP_FETCH_TRUST_CFG): Ditto. (KS_HTTP_FETCH_NO_CRL): Ditto. (KS_HTTP_FETCH_ALLOW_DOWNGRADE): Ditto. * dirmngr/ks-engine-http.c (ks_http_fetch): Replace args send_no_cache and extra_http_trust_flags by a new flags arg. Allow redirectiong from https to http it KS_HTTP_FETCH_ALLOW_DOWNGRADE is set. * dirmngr/loadswdb.c (fetch_file): Call with KS_HTTP_FETCH_NOCACHE. * dirmngr/ks-action.c (ks_action_get): Ditto. (ks_action_fetch): Ditto. * dirmngr/crlfetch.c (crl_fetch): Call with the appropriate flags. -- Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'dirmngr/crlfetch.c')
-rw-r--r--dirmngr/crlfetch.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/dirmngr/crlfetch.c b/dirmngr/crlfetch.c
index 0d27aa0f1..57ac51b93 100644
--- a/dirmngr/crlfetch.c
+++ b/dirmngr/crlfetch.c
@@ -175,11 +175,14 @@ crl_fetch (ctrl_t ctrl, const char *url, ksba_reader_t *reader)
else
{
/* Note that we also allow root certificates loaded from
- * "/etc/gnupg/trusted-certs/". We also do not consult
- * the CRL for the TLS connection - that may lwad to a
- * loop. */
- err = ks_http_fetch (ctrl, url, 0,
- (HTTP_FLAG_TRUST_CFG | HTTP_FLAG_NO_CRL),
+ * "/etc/gnupg/trusted-certs/". We also do not consult the
+ * CRL for the TLS connection - that may lead to a loop.
+ * Due to cacert.org redirecting their https URL to http we
+ * also allow such a downgrade. */
+ err = ks_http_fetch (ctrl, url,
+ (KS_HTTP_FETCH_TRUST_CFG
+ | KS_HTTP_FETCH_NO_CRL
+ | KS_HTTP_FETCH_ALLOW_DOWNGRADE ),
&httpfp);
}