When an ACME server returns a newOrder response with an empty
authorizations array (certificate already validated), ctx->auths
remains NULL. The state machine then transitions to ACME_AUTH which
immediately dereferences ctx->next_auth, causing a segfault.
Return an error from acme_res_neworder() so the caller retries.
This needs to be backported to 3.2.
auth->auth = istdup(ist2(trash.area, trash.data));
if (!isttest(auth->auth)) {
+ free(auth);
memprintf(errmsg, "out of memory");
goto error;
}
ctx->next_auth = auth;
}
+ if (!ctx->auths) {
+ memprintf(errmsg, "no authorizations found in newOrder response");
+ goto error;
+ }
+
if ((ret = mjson_get_string(hc->res.buf.area, hc->res.buf.data, "$.finalize", trash.area, trash.size)) <= 0) {
memprintf(errmsg, "couldn't find the finalize URL");
goto error;