Copy the original ckch_store instead of creating a new one. This allows
to inherit the ckch_conf from the previous structure when doing a
ckchs_dup(). The ckch_conf contains the SAN for ACME.
Free the previous PKEY since it a new one is generated.
goto err;
}
- newstore = ckch_store_new(store->path);
+ newstore = ckchs_dup(store);
if (!newstore) {
memprintf(&err, "Out of memory.\n");
goto err;
EVP_PKEY_CTX_free(pkey_ctx);
+ EVP_PKEY_free(newstore->data->key);
newstore->data->key = pkey;
ctx->req = acme_x509_req(pkey, store->conf.acme.domains);
goto err;
}
- /* XXX: must implement a real copy */
- newstore->conf = store->conf;
ctx->store = newstore;
ctx->cfg = cfg;