/* CLI context used by "commit cafile" and "commit crlfile" */
struct commit_cacrlfile_ctx {
- struct cafile_entry *old_cafile_entry;
- struct cafile_entry *new_cafile_entry;
- struct cafile_entry *old_crlfile_entry;
- struct cafile_entry *new_crlfile_entry;
+ struct cafile_entry *old_entry;
+ struct cafile_entry *new_entry;
struct ckch_inst_link *next_ckchi_link;
enum cafile_type cafile_type; /* either CA or CRL, depending on the current command */
char *err;
/* init the appctx structure */
ctx->state = CACRL_ST_INIT;
ctx->next_ckchi_link = NULL;
- ctx->old_cafile_entry = cafile_transaction.old_cafile_entry;
- ctx->new_cafile_entry = cafile_transaction.new_cafile_entry;
+ ctx->old_entry = cafile_transaction.old_cafile_entry;
+ ctx->new_entry = cafile_transaction.new_cafile_entry;
ctx->cafile_type = CAFILE_CERT;
return 0;
struct commit_cacrlfile_ctx *ctx = appctx->svcctx;
struct stconn *sc = appctx_sc(appctx);
int y = 0;
- struct cafile_entry *old_cafile_entry, *new_cafile_entry;
+ struct cafile_entry *old_cafile_entry = ctx->old_entry;
+ struct cafile_entry *new_cafile_entry = ctx->new_entry;
struct ckch_inst_link *ckchi_link;
char *path;
*/
switch (ctx->cafile_type) {
case CAFILE_CERT:
- old_cafile_entry = ctx->old_cafile_entry;
- new_cafile_entry = ctx->new_cafile_entry;
path = cafile_transaction.path;
break;
case CAFILE_CRL:
- old_cafile_entry = ctx->old_crlfile_entry;
- new_cafile_entry = ctx->new_crlfile_entry;
path = crlfile_transaction.path;
break;
}
ebmb_delete(&old_cafile_entry->node);
ssl_store_delete_cafile_entry(old_cafile_entry);
- ctx->old_cafile_entry = ctx->new_cafile_entry = NULL;
- ctx->old_crlfile_entry = ctx->new_crlfile_entry = NULL;
+ ctx->old_entry = ctx->new_entry = NULL;
ctx->state = CACRL_ST_SUCCESS;
/* fallthrough */
case CACRL_ST_SUCCESS:
static void cli_release_commit_cafile(struct appctx *appctx)
{
struct commit_cacrlfile_ctx *ctx = appctx->svcctx;
- struct cafile_entry *new_cafile_entry = ctx->new_cafile_entry;
+ struct cafile_entry *new_cafile_entry = ctx->new_entry;
/* Remove the uncommitted cafile_entry from the tree. */
if (new_cafile_entry) {
/* init the appctx structure */
ctx->state = CACRL_ST_INIT;
ctx->next_ckchi_link = NULL;
- ctx->old_crlfile_entry = crlfile_transaction.old_crlfile_entry;
- ctx->new_crlfile_entry = crlfile_transaction.new_crlfile_entry;
+ ctx->old_entry = crlfile_transaction.old_crlfile_entry;
+ ctx->new_entry = crlfile_transaction.new_crlfile_entry;
ctx->cafile_type = CAFILE_CRL;
return 0;
static void cli_release_commit_crlfile(struct appctx *appctx)
{
struct commit_cacrlfile_ctx *ctx = appctx->svcctx;
- struct cafile_entry *new_crlfile_entry = ctx->new_crlfile_entry;
+ struct cafile_entry *new_crlfile_entry = ctx->new_entry;
/* Remove the uncommitted cafile_entry from the tree. */
if (new_crlfile_entry) {