HA_SPIN_UNLOCK(CKCH_LOCK, &ckch_lock);
}
-/* IO handler of "show ssl cert <filename>" */
+/* IO handler of "show ssl cert <filename>".
+ * It makes use of ctx.ssl.cur_ckchs, ctx.ssl.old_ckchs.
+ */
static int cli_io_handler_show_cert(struct appctx *appctx)
{
struct buffer *trash = alloc_trash_chunk();
}
}
- if (!appctx->ctx.cli.p0) {
+ if (!appctx->ctx.ssl.cur_ckchs) {
chunk_appendf(trash, "# filename\n");
node = ebmb_first(&ckchs_tree);
} else {
- node = &((struct ckch_store *)appctx->ctx.cli.p0)->node;
+ node = &((struct ckch_store *)appctx->ctx.ssl.cur_ckchs)->node;
}
while (node) {
ckchs = ebmb_entry(node, struct ckch_store, node);
}
}
- appctx->ctx.cli.p0 = NULL;
+ appctx->ctx.ssl.cur_ckchs = NULL;
free_trash_chunk(trash);
return 1;
yield:
free_trash_chunk(trash);
- appctx->ctx.cli.p0 = ckchs;
+ appctx->ctx.ssl.cur_ckchs = ckchs;
return 0; /* should come back */
}
}
-/* IO handler of the details "show ssl cert <filename>" */
+/* IO handler of the details "show ssl cert <filename>".
+ * It uses ctx.ssl.cur_ckchs.
+ */
static int cli_io_handler_show_cert_detail(struct appctx *appctx)
{
struct conn_stream *cs = appctx->owner;
- struct ckch_store *ckchs = appctx->ctx.cli.p0;
+ struct ckch_store *ckchs = appctx->ctx.ssl.cur_ckchs;
struct buffer *out = alloc_trash_chunk();
int retval = 0;
}
-/* IO handler of the details "show ssl cert <filename.ocsp>" */
+/* IO handler of the details "show ssl cert <filename.ocsp>".
+ * It uses ctx.ssl.cur_ckchs and ctx.ssl.index.
+ */
static int cli_io_handler_show_cert_ocsp_detail(struct appctx *appctx)
{
#if ((defined SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB && !defined OPENSSL_NO_OCSP) && !defined OPENSSL_IS_BORINGSSL)
struct conn_stream *cs = appctx->owner;
- struct ckch_store *ckchs = appctx->ctx.cli.p0;
+ struct ckch_store *ckchs = appctx->ctx.ssl.cur_ckchs;
struct buffer *out = alloc_trash_chunk();
- int from_transaction = appctx->ctx.cli.i0;
+ int from_transaction = appctx->ctx.ssl.index;
if (!out)
goto end_no_putchk;
}
- appctx->ctx.cli.p0 = ckchs;
+ appctx->ctx.ssl.cur_ckchs = ckchs;
/* use the IO handler that shows details */
if (show_ocsp_detail) {
- appctx->ctx.cli.i0 = from_transaction;
+ appctx->ctx.ssl.index = from_transaction;
appctx->io_handler = cli_io_handler_show_cert_ocsp_detail;
}
else