struct ckch_inst_link *next_ckchi_link;
struct ckch_inst *next_ckchi;
int cafile_type; /* either CA or CRL, depending on the current command */
+ enum {
+ CACRL_ST_INIT = 0,
+ CACRL_ST_GEN,
+ CACRL_ST_INSERT,
+ CACRL_ST_FIN,
+ } state;
};
goto error;
}
/* init the appctx structure */
- appctx->st2 = SETCERT_ST_INIT;
+ 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;
goto error;
while (1) {
- switch (appctx->st2) {
- case SETCERT_ST_INIT:
+ switch (ctx->state) {
+ case CACRL_ST_INIT:
/* This state just print the update message */
switch (ctx->cafile_type) {
case CAFILE_CERT:
cs_rx_room_blk(cs);
goto yield;
}
- appctx->st2 = SETCERT_ST_GEN;
+ ctx->state = CACRL_ST_GEN;
/* fallthrough */
- case SETCERT_ST_GEN:
+ case CACRL_ST_GEN:
/*
* This state generates the ckch instances with their
* sni_ctxs and SSL_CTX.
}
}
- appctx->st2 = SETCERT_ST_INSERT;
+ ctx->state = CACRL_ST_INSERT;
/* fallthrough */
- case SETCERT_ST_INSERT:
+ case CACRL_ST_INSERT:
/* The generation is finished, we can insert everything */
switch (ctx->cafile_type) {
case CAFILE_CERT:
ebmb_delete(&old_cafile_entry->node);
ssl_store_delete_cafile_entry(old_cafile_entry);
- appctx->st2 = SETCERT_ST_FIN;
+ ctx->state = CACRL_ST_FIN;
/* fallthrough */
- case SETCERT_ST_FIN:
+ case CACRL_ST_FIN:
/* we achieved the transaction, we can set everything to NULL */
switch (ctx->cafile_type) {
case CAFILE_CERT:
{
struct commit_cacrlfile_ctx *ctx = appctx->svcctx;
- if (appctx->st2 != SETCERT_ST_FIN) {
+ if (ctx->state != CACRL_ST_FIN) {
struct cafile_entry *new_cafile_entry = ctx->new_cafile_entry;
/* Remove the uncommitted cafile_entry from the tree. */
goto error;
}
/* init the appctx structure */
- appctx->st2 = SETCERT_ST_INIT;
+ ctx->state = CACRL_ST_INIT;
ctx->next_ckchi = NULL;
ctx->old_crlfile_entry = crlfile_transaction.old_crlfile_entry;
ctx->new_crlfile_entry = crlfile_transaction.new_crlfile_entry;
{
struct commit_cacrlfile_ctx *ctx = appctx->svcctx;
- if (appctx->st2 != SETCERT_ST_FIN) {
+ if (ctx->state != CACRL_ST_FIN) {
struct cafile_entry *new_crlfile_entry = ctx->new_crlfile_entry;
/* Remove the uncommitted cafile_entry from the tree. */