MCPcopy Create free account
hub / github.com/apache/httpd / status_get_certs_json

Function status_get_certs_json

modules/md/md_status.c:197–227  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

195}
196
197static apr_status_t status_get_certs_json(md_json_t **pjson, apr_array_header_t *certs,
198 int from_staging,
199 const md_t *md, md_reg_t *reg,
200 md_ocsp_reg_t *ocsp, int with_logs,
201 apr_pool_t *p)
202{
203 md_json_t *json, *certj;
204 md_timeperiod_t certs_valid = {0, 0}, valid;
205 md_cert_t *cert;
206 int i;
207 apr_status_t rv = APR_SUCCESS;
208
209 json = md_json_create(p);
210 for (i = 0; i < get_cert_count(md, from_staging); ++i) {
211 cert = APR_ARRAY_IDX(certs, i, md_cert_t*);
212 if (!cert) continue;
213
214 rv = status_get_cert_json_ex(&certj, cert, md, reg, ocsp, with_logs, p);
215 if (APR_SUCCESS != rv) goto leave;
216 valid = md_cert_get_valid(cert);
217 certs_valid = i? md_timeperiod_common(&certs_valid, &valid) : valid;
218 md_json_setj(certj, json, get_cert_name(md, i, from_staging, p), NULL);
219 }
220
221 if (certs_valid.start) {
222 md_json_set_timeperiod(&certs_valid, json, MD_KEY_VALID, NULL);
223 }
224leave:
225 *pjson = (APR_SUCCESS == rv)? json : NULL;
226 return rv;
227}
228
229static apr_status_t get_staging_certs_json(md_json_t **pjson, const md_t *md,
230 md_reg_t *reg, apr_pool_t *p)

Callers 2

get_staging_certs_jsonFunction · 0.85
status_get_md_jsonFunction · 0.85

Calls 8

md_json_createFunction · 0.85
status_get_cert_json_exFunction · 0.85
md_cert_get_validFunction · 0.85
md_timeperiod_commonFunction · 0.85
md_json_setjFunction · 0.85
get_cert_nameFunction · 0.85
md_json_set_timeperiodFunction · 0.85
get_cert_countFunction · 0.70

Tested by

no test coverage detected