| 98 | } |
| 99 | |
| 100 | static int md_job_json_seems_valid(md_json_t *json, md_store_t *store, |
| 101 | md_store_group_t group, const char *name, |
| 102 | apr_pool_t *p) |
| 103 | { |
| 104 | |
| 105 | if (!json) return FALSE; |
| 106 | if ((group == MD_SG_STAGING) && |
| 107 | md_json_getb(json, MD_KEY_FINISHED, NULL) && |
| 108 | md_json_getb(json, MD_KEY_NOTIFIED_RENEWED, NULL)) { |
| 109 | md_t *md; |
| 110 | /* A finished job in the staging area needs to have produced results */ |
| 111 | if(!md_exists(store, group, name, p)) return FALSE; |
| 112 | |
| 113 | if (APR_SUCCESS == md_load(store, MD_SG_DOMAINS, name, &md, p)) { |
| 114 | int i; |
| 115 | for (i = 0; i < md_cert_count(md); ++i) { |
| 116 | md_pkey_spec_t *spec = md_pkeys_spec_get(md->pks, i); |
| 117 | if(md_pubcert_load(store, group, name, spec, NULL, p) != APR_SUCCESS) |
| 118 | return FALSE; |
| 119 | } |
| 120 | } |
| 121 | } |
| 122 | return TRUE; |
| 123 | } |
| 124 | |
| 125 | static apr_status_t job_loadj(md_json_t **pjson, md_store_group_t group, const char *name, |
| 126 | struct md_reg_t *reg, int with_log, apr_pool_t *p) |
no test coverage detected