From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 2AEBC1FF0B7 for ; Fri, 13 Nov 2026 04:34:37 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 0AA6421D53; Fri, 13 Nov 2026 04:22:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wolfssl-com.20260707.gappssmtp.com; s=20260707; t=1794539212; x=1795144012; darn=lists.proxmox.com; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=or5TzyZ3ph502W4wnnAn+b3vTo97VCoOmaXR9jSDKNU=; b=YdWYkWWy2YMd3D7gPJ9J9qP2QKNXa6C5g10Fao6hJgdTjgfbeaxMOkBsgtanU/Yx6J Ma1z/JiNyS74/ICf2x0760s46UuI9PsI7WkN4toflDZKYnfimvnzJjj5V1JUFjhmcL/0 21JPJJXQj2VcYqE/UQcrxm6l1CCPL1XfEz6/TDbf0dkuhA5HQEOvuLTiHjNbS3yALcRX jcIA4PMneHp1QdRnlABr8+GJMl1znmgOKQLXjUNxv9fupr0h6QXDvej7mU1ldHBtWYfc 14QiiOeE7JH1VF8eYc0jttpF9MjP1pJS9ew8wzPJTkFst5XAxGsKON5FJ5oSqA3WjrM3 Cc2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794539212; x=1795144012; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=or5TzyZ3ph502W4wnnAn+b3vTo97VCoOmaXR9jSDKNU=; b=TLZzieI7wR8PGt/LNkomSIo8Lt26xY08lW+jfpC7k8+X+NLe+XO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L4xxoFcL/eNVx7Z/LsXOs1Xs7Ck8KTakZD6/i0IL3 u59DLLqoIfZQAz1IsUPncBTilDwe5l9vkPdnOT4P5kryj/gdGxPh5L405X6rSBQAo3EhQZTQWIb h4pVKO8eP4eLL8lBJDqS0kvWJEmYfgzWGkJg8UzadPKt5CyXJEUmDtbn8K00h0e5jyb9NdRxQYV KmsrFVkdw== X-Received: by 2002:a05:6830:6510:b0:846:6f06:33d9 with SMTP id 46e09a7af769-861527b56f3mr3169290a34.31.1794539212414; Thu, 12 Nov 2026 19:06:52 -0800 (PST) From: Mark Atwood 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 Message-ID: <20261113030646.3533-2-mark@wolfssl.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261113030646.3533-1-mark@wolfssl.com> References: <20261113030646.3533-1-mark@wolfssl.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DMARC_PASS -0.1 DMARC pass policy RCVD_IN_DNSWL_NONE -0.0001 Sender listed at https://www.dnswl.org/, no trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: OEBM2ZZLGETPXM2C7VG3H3YKQK3SFBWO X-Message-ID-Hash: OEBM2ZZLGETPXM2C7VG3H3YKQK3SFBWO X-MailFrom: mark@wolfssl.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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 --- 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();