goto error;
}
+ /* if the order already has a certificate URL, the validation was
+ * already done: skip the auth/challenge steps entirely */
+ ret = mjson_get_string(hc->res.buf.area, hc->res.buf.data, "$.certificate", trash.area, trash.size);
+ if (ret != -1) {
+ trash.data = ret;
+ istfree(&ctx->certificate);
+ ctx->certificate = istdup(ist2(trash.area, trash.data));
+ if (!isttest(ctx->certificate)) {
+ memprintf(errmsg, "out of memory");
+ goto error;
+ }
+ goto end;
+ }
+
if (!isttest(ctx->order)) {
memprintf(errmsg, "couldn't get an order Location during newOrder");
goto error;
}
+
/* get the multiple authorizations URL and tokens */
for (i = 0; ; i++) {
struct acme_auth *auth;
memprintf(errmsg, "out of memory");
goto error;
}
-
+end:
ret = 0;
error:
if (acme_res_neworder(task, ctx, &errmsg) != 0) {
goto retry;
}
- st = ACME_AUTH;
+ st = isttest(ctx->certificate) ? ACME_CERTIFICATE : ACME_AUTH;
goto nextreq;
}
break;