| 236 | } |
| 237 | |
| 238 | static apr_status_t ocsp_status_refresh(md_ocsp_status_t *ostat, apr_pool_t *ptemp) |
| 239 | { |
| 240 | md_store_t *store = ostat->reg->store; |
| 241 | md_json_t *jprops; |
| 242 | apr_time_t mtime; |
| 243 | apr_status_t rv = APR_EAGAIN; |
| 244 | md_data_t resp_der; |
| 245 | md_timeperiod_t resp_valid; |
| 246 | md_ocsp_cert_stat_t resp_stat; |
| 247 | /* Check if the store holds a newer response than the one we have */ |
| 248 | mtime = md_store_get_modified(store, MD_SG_OCSP, ostat->md_name, ostat->file_name, ptemp); |
| 249 | if (mtime <= ostat->resp_mtime) goto cleanup; |
| 250 | rv = md_store_load_json(store, MD_SG_OCSP, ostat->md_name, ostat->file_name, &jprops, ptemp); |
| 251 | if (APR_SUCCESS != rv) goto cleanup; |
| 252 | rv = ostat_from_json(&resp_stat, &resp_der, &resp_valid, jprops, ptemp); |
| 253 | if (APR_SUCCESS != rv) goto cleanup; |
| 254 | rv = ostat_set(ostat, resp_stat, &resp_der, &resp_valid, mtime); |
| 255 | if (APR_SUCCESS != rv) goto cleanup; |
| 256 | cleanup: |
| 257 | return rv; |
| 258 | } |
| 259 | |
| 260 | |
| 261 | static apr_status_t ocsp_status_save(md_ocsp_cert_stat_t stat, const md_data_t *resp_der, |
no test coverage detected