From: Mark Atwood <mark@wolfssl.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH cluster v2 1/1] datacenter config: add ticket-signature-hash option
Date: Fri, 13 Nov 2026 03:06:46 +0000 [thread overview]
Message-ID: <20261113030646.3533-2-mark@wolfssl.com> (raw)
In-Reply-To: <20261113030646.3533-1-mark@wolfssl.com>
Add a cluster-wide option to select the hash algorithm for the RSA
signature of newly created authentication tickets, either 'sha1' or
'sha256'. It defaults to 'sha1', the algorithm used so far, so nothing
changes unless it is set explicitly.
This allows running with crypto providers that refuse SHA-1
signatures, such as FIPS ones, where creating tickets does not work
otherwise. Consumers, i.e. pve-access-control, read the option when
creating tickets. Verification accepts both algorithms independent of
the option, once the nodes have the changes to PVE::Ticket in
pve-common. This affects Proxmox Mail Gateway only through that
module, it does not read this option.
The option applies to the whole cluster, but nodes that do not know
how to verify SHA-256 reject such tickets. So it must only be set to
'sha256' once all nodes have been upgraded, which the description
states. Enforcing this by checking the node versions is left for
later, as it needs to know the release that includes the verification
change.
The tests check that both values and only those are accepted, and that
the option is written back.
Signed-off-by: Mark Atwood <mark@wolfssl.com>
---
src/PVE/DataCenterConfig.pm | 16 +++++++++++
src/test/Makefile | 6 ++++-
src/test/test_ticket_signature_hash.pl | 37 ++++++++++++++++++++++++++
3 files changed, 58 insertions(+), 1 deletion(-)
create mode 100644 src/test/test_ticket_signature_hash.pl
diff --git a/src/PVE/DataCenterConfig.pm b/src/PVE/DataCenterConfig.pm
index 004122e..6c96bbb 100644
--- a/src/PVE/DataCenterConfig.pm
+++ b/src/PVE/DataCenterConfig.pm
@@ -551,6 +551,22 @@ my $datacenter_schema = {
description => "The location of the cluster.",
optional => 1,
},
+ 'ticket-signature-hash' => {
+ optional => 1,
+ type => 'string',
+ enum => ['sha1', 'sha256'],
+ default => 'sha1',
+ description => "Hash algorithm that is used for the RSA signature of newly created"
+ . " authentication tickets. Use 'sha256' if SHA-1 signatures are not acceptable,"
+ . " for example when running in FIPS mode.",
+ verbose_description => "Hash algorithm that is used for the RSA signature of newly"
+ . " created authentication tickets. All nodes accept tickets signed with either"
+ . " algorithm, but only nodes with SHA-256 support do so.\n\nThis setting is"
+ . " cluster-wide, so only switch to 'sha256' once all nodes in the cluster, and"
+ . " all other products that share the ticket format, have been upgraded to a"
+ . " version that supports it. Nodes that do not support it reject tickets"
+ . " signed with SHA-256, which breaks logins and cross-node operations.",
+ },
},
};
diff --git a/src/test/Makefile b/src/test/Makefile
index cdd37d0..0c95290 100644
--- a/src/test/Makefile
+++ b/src/test/Makefile
@@ -4,7 +4,7 @@ cpgtest: cpgtest.c
gcc -Wall cpgtest.c $(shell pkg-config --cflags --libs libcpg libqb) -o cpgtest
.PHONY: check install clean distclean
-check: corosync-parser-test test-mac-prefix
+check: corosync-parser-test test-mac-prefix test-ticket-signature-hash
.PHONY: corosync-parser-test
corosync-parser-test:
@@ -14,5 +14,9 @@ corosync-parser-test:
test-mac-prefix:
perl test_mac_prefix.pl
+.PHONY: test-ticket-signature-hash
+test-ticket-signature-hash:
+ perl test_ticket_signature_hash.pl
+
distclean: clean
clean:
diff --git a/src/test/test_ticket_signature_hash.pl b/src/test/test_ticket_signature_hash.pl
new file mode 100644
index 0000000..a0d47a6
--- /dev/null
+++ b/src/test/test_ticket_signature_hash.pl
@@ -0,0 +1,37 @@
+use strict;
+use warnings;
+
+use Test::More;
+
+use lib ('.', '..');
+
+use PVE::DataCenterConfig;
+
+my $parse = sub {
+ my ($raw) = @_;
+ return PVE::DataCenterConfig::parse_datacenter_config('datacenter.cfg', $raw);
+};
+
+is($parse->("keyboard: de\n")->{'ticket-signature-hash'}, undef, "unset by default");
+
+for my $hash ('sha1', 'sha256') {
+ my $conf = $parse->("ticket-signature-hash: $hash\n");
+ is($conf->{'ticket-signature-hash'}, $hash, "'$hash' is accepted");
+
+ my $written = PVE::DataCenterConfig::write_datacenter_config('datacenter.cfg', $conf);
+ like($written, qr/^ticket-signature-hash: \Q$hash\E$/m, "'$hash' is written");
+}
+
+for my $hash ('md5', 'SHA256', 'sha-256', '') {
+ # the parser warns about and drops invalid values instead of dying
+ my @warnings;
+ local $SIG{__WARN__} = sub { push @warnings, @_ };
+ my $conf = $parse->("ticket-signature-hash: $hash\n");
+ is($conf->{'ticket-signature-hash'}, undef, "'$hash' is not accepted");
+ ok(scalar(@warnings), "'$hash' is warned about");
+}
+
+my $schema = PVE::DataCenterConfig::get_datacenter_schema();
+is($schema->{properties}->{'ticket-signature-hash'}->{default}, 'sha1', "default stays SHA-1");
+
+done_testing();
next prev parent reply other threads:[~2026-11-13 3:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-13 3:06 [PATCH cluster v2 0/1] datacenter config: add ticket-signature-hash option Mark Atwood
2026-11-13 3:06 ` Mark Atwood [this message]
2026-11-17 16:05 ` [PATCH cluster v2 1/1] " Shannon Sterz
2026-11-18 4:14 ` Thomas Lamprecht
2026-11-18 9:40 ` Shannon Sterz
2026-11-19 12:38 ` Thomas Lamprecht
2026-11-19 13:37 ` Shannon Sterz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261113030646.3533-2-mark@wolfssl.com \
--to=mark@wolfssl.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.