| 618 | /* ACME staging */ |
| 619 | |
| 620 | static apr_status_t load_missing_creds(md_proto_driver_t *d) |
| 621 | { |
| 622 | md_acme_driver_t *ad = d->baton; |
| 623 | md_credentials_t *cred; |
| 624 | apr_array_header_t *chain; |
| 625 | int i, complete; |
| 626 | apr_status_t rv; |
| 627 | |
| 628 | complete = 1; |
| 629 | for (i = 0; i < ad->creds->nelts; ++i) { |
| 630 | rv = APR_SUCCESS; |
| 631 | cred = APR_ARRAY_IDX(ad->creds, i, md_credentials_t*); |
| 632 | if (!cred->pkey) { |
| 633 | rv = md_pkey_load(d->store, MD_SG_STAGING, d->md->name, cred->spec, &cred->pkey, d->p); |
| 634 | } |
| 635 | if (APR_SUCCESS == rv && md_array_is_empty(cred->chain)) { |
| 636 | rv = md_pubcert_load(d->store, MD_SG_STAGING, d->md->name, cred->spec, &chain, d->p); |
| 637 | if (APR_SUCCESS == rv) { |
| 638 | apr_array_cat(cred->chain, chain); |
| 639 | } |
| 640 | } |
| 641 | if (APR_SUCCESS == rv) { |
| 642 | md_log_perror(MD_LOG_MARK, MD_LOG_TRACE1, 0, d->p, "%s: credentials staged for %s certificate", |
| 643 | d->md->name, md_pkey_spec_name(cred->spec)); |
| 644 | } |
| 645 | else { |
| 646 | complete = 0; |
| 647 | } |
| 648 | } |
| 649 | return complete? APR_SUCCESS : APR_EAGAIN; |
| 650 | } |
| 651 | |
| 652 | static apr_status_t acme_renew(md_proto_driver_t *d, md_result_t *result) |
| 653 | { |
no test coverage detected