diff options
author | Stefan Eissing <icing@apache.org> | 2018-12-18 14:45:25 +0100 |
---|---|---|
committer | Stefan Eissing <icing@apache.org> | 2018-12-18 14:45:25 +0100 |
commit | 0fd7ff752093c960110b06d1e0133736488ab2f4 (patch) | |
tree | bbf2ed7e027d3f93e89878a0dea5c1fe15852f1e /modules/md/md_acme_drive.c | |
parent | core: Fix incorrect substitution of env vars in directives containing multipl... (diff) | |
download | apache2-0fd7ff752093c960110b06d1e0133736488ab2f4.tar.xz apache2-0fd7ff752093c960110b06d1e0133736488ab2f4.zip |
*) mod_md: incorrect behaviour when synchronizing ongoing ACME challenges
have been fixed. [Michael Kaufmann, Stefan Eissing]
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1849174 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/md/md_acme_drive.c')
-rw-r--r-- | modules/md/md_acme_drive.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/modules/md/md_acme_drive.c b/modules/md/md_acme_drive.c index b5592e69b8..34fd37e091 100644 --- a/modules/md/md_acme_drive.c +++ b/modules/md/md_acme_drive.c @@ -162,7 +162,8 @@ static apr_status_t ad_setup_authz(md_proto_driver_t *d) apr_status_t rv; md_t *md = ad->md; md_acme_authz_t *authz; - int i, changed; + int i; + int changed = 0; assert(ad->md); assert(ad->acme); @@ -186,18 +187,20 @@ static apr_status_t ad_setup_authz(md_proto_driver_t *d) } /* Remove anything we no longer need */ - for (i = 0; i < ad->authz_set->authzs->nelts; ++i) { + for (i = 0; i < ad->authz_set->authzs->nelts;) { authz = APR_ARRAY_IDX(ad->authz_set->authzs, i, md_acme_authz_t*); if (!md_contains(md, authz->domain, 0)) { md_acme_authz_set_remove(ad->authz_set, authz->domain); changed = 1; } + else { + ++i; + } } /* Add anything we do not already have */ for (i = 0; i < md->domains->nelts && APR_SUCCESS == rv; ++i) { const char *domain = APR_ARRAY_IDX(md->domains, i, const char *); - changed = 0; authz = md_acme_authz_set_get(ad->authz_set, domain); if (authz) { /* check valid */ @@ -615,6 +618,7 @@ static apr_status_t acme_driver_init(md_proto_driver_t *d) { md_acme_driver_t *ad; apr_status_t rv = APR_SUCCESS; + int challenges_configured = 0; ad = apr_pcalloc(d->p, sizeof(*ad)); @@ -631,10 +635,12 @@ static apr_status_t acme_driver_init(md_proto_driver_t *d) if (d->challenge) { /* we have been told to use this type */ APR_ARRAY_PUSH(ad->ca_challenges, const char*) = apr_pstrdup(d->p, d->challenge); + challenges_configured = 1; } else if (d->md->ca_challenges && d->md->ca_challenges->nelts > 0) { /* pre-configured set for this managed domain */ apr_array_cat(ad->ca_challenges, d->md->ca_challenges); + challenges_configured = 1; } else { /* free to chose. Add all we support and see what we get offered */ |