]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: ssl/cli: add a 'Uncommitted' status for 'show ssl' commands
authorWilliam Lallemand <wlallemand@haproxy.com>
Mon, 16 Dec 2024 16:39:20 +0000 (17:39 +0100)
committerWilliam Lallemand <wlallemand@haproxy.com>
Wed, 18 Dec 2024 09:32:26 +0000 (10:32 +0100)
Add a 'Uncommitted' status for 'show ssl' commands on the 'Status' line
when accessing a non-empty and uncommitted SSL transaction.

Available with:
- show ssl cert
- show ssl ca-file
- show ssl crl-file

src/ssl_ckch.c

index c2d3640dd40e74b777864b4323c44dd20a76d531..75b04db88eeea2f27f75b5c691b4a283a5b04442 100644 (file)
@@ -2130,6 +2130,8 @@ static int cli_io_handler_show_cert_detail(struct appctx *appctx)
        chunk_appendf(out, "Status: ");
        if (ckchs->data->cert == NULL)
                chunk_appendf(out, "Empty\n");
+       else if (ckchs == ckchs_transaction.new_ckchs)
+               chunk_appendf(out, "Uncommitted\n");
        else if (LIST_ISEMPTY(&ckchs->ckch_inst))
                chunk_appendf(out, "Unused\n");
        else
@@ -3539,6 +3541,8 @@ static int cli_io_handler_show_cafile_detail(struct appctx *appctx)
        chunk_appendf(out, "Status: ");
        if (!cafile_entry->ca_store)
                chunk_appendf(out, "Empty\n");
+       else if (cafile_entry == cafile_transaction.new_cafile_entry)
+               chunk_appendf(out, "Uncommitted\n");
        else if (LIST_ISEMPTY(&cafile_entry->ckch_inst_link))
                chunk_appendf(out, "Unused\n");
        else
@@ -4226,6 +4230,8 @@ static int cli_io_handler_show_crlfile_detail(struct appctx *appctx)
        chunk_appendf(out, "Status: ");
        if (!cafile_entry->ca_store)
                chunk_appendf(out, "Empty\n");
+       else if (cafile_entry == crlfile_transaction.new_crlfile_entry)
+               chunk_appendf(out, "Uncommitted\n");
        else if (LIST_ISEMPTY(&cafile_entry->ckch_inst_link))
                chunk_appendf(out, "Unused\n");
        else