| 173 | /* response to a challenge */ |
| 174 | |
| 175 | static md_acme_authz_cha_t *cha_from_json(apr_pool_t *p, size_t index, md_json_t *json) |
| 176 | { |
| 177 | md_acme_authz_cha_t * cha; |
| 178 | |
| 179 | cha = apr_pcalloc(p, sizeof(*cha)); |
| 180 | cha->index = index; |
| 181 | cha->type = md_json_dups(p, json, MD_KEY_TYPE, NULL); |
| 182 | if (md_json_has_key(json, MD_KEY_URL, NULL)) { /* ACMEv2 */ |
| 183 | cha->uri = md_json_dups(p, json, MD_KEY_URL, NULL); |
| 184 | } |
| 185 | else { /* ACMEv1 */ |
| 186 | cha->uri = md_json_dups(p, json, MD_KEY_URI, NULL); |
| 187 | } |
| 188 | cha->token = md_json_dups(p, json, MD_KEY_TOKEN, NULL); |
| 189 | cha->key_authz = md_json_dups(p, json, MD_KEY_KEYAUTHZ, NULL); |
| 190 | |
| 191 | return cha; |
| 192 | } |
| 193 | |
| 194 | static apr_status_t on_init_authz_resp(md_acme_req_t *req, void *baton) |
| 195 | { |
no test coverage detected