public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH common v2 0/2] ticket: sign RSA tickets with SHA-256, opt-in
@ 2026-11-13  3:06 Mark Atwood
  2026-11-13  3:06 ` [PATCH common v2 1/2] ticket: accept RSA tickets signed with SHA-256 Mark Atwood
  2026-11-13  3:06 ` [PATCH common v2 2/2] ticket: allow signing RSA tickets " Mark Atwood
  0 siblings, 2 replies; 5+ messages in thread
From: Mark Atwood @ 2026-11-13  3:06 UTC (permalink / raw)
  To: pve-devel

Let PVE::Ticket verify RSA tickets signed with SHA-256, and optionally sign
with it, so that PVE and PMG work with crypto providers that refuse SHA-1
signatures, e.g. FIPS ones. Signing with SHA-256 stays opt-in: callers pass a
new, optional hash parameter, and the default is still SHA-1.

This also affects Proxmox Mail Gateway, which uses PVE::Ticket for its
tickets. The pve-common patches state it in their commit messages. SHA-256
signing stays off there unless PMG passes the new parameter.

Apply order across the repositories, all three are part of this series:
1. pve-common (2 patches)
2. pve-cluster (adds the datacenter.cfg option)
3. pve-access-control (reads the option and signs with it)
pve-common and pve-cluster are independent of each other. pve-access-control
needs both, but is harmless without them: it then keeps signing with SHA-1.

Mixed clusters: nodes without pve-common 1/2 reject SHA-256 tickets, so the
option must only be set to 'sha256' once every node has that patch. The option
description says so. I did not add an automatic check against the node
versions (the new helpers in pve-cluster, 679cf2c, would allow one), as it
needs the release number that will contain 1/2. Happy to add one in
pve-manager's datacenter options update once that number is known.

Tested on a PVE 9.2 node with wolfProvider (FIPS) set up for pvedaemon: with the
option unset, logins fail as before, and with 'sha256', API and web logins work
and the tickets verify with SHA-256 only.

Changes since v1:
- rebased onto current master, which has the new ticket tests (0163eaf,
  0f928d5, 0b3129a); the v1 patches did not apply any more
- tests are now part of the existing test/ticket_test.pl instead of a new
  test file
- 1/2: added the TODO to remove the SHA-1 fallback once SHA-256 signed tickets
  are the default across PMG and PVE for at least one major release
- 1/2: $rsa_pub is now reset unconditionally to the library default (SHA-1)
  after verifying, instead of keeping whichever hash matched; the commit
  message explains why this was preferred over documenting it
- 1/2: the eval no longer swallows all errors; it only ignores the refusal of
  SHA-1 (wolfProvider's "RSA.xs:1007: OpenSSL error: (null)", seen when
  signing) and warns about anything else
- 1/2: added a test that verification succeeds without $noerr; the tests use
  tickets signed with the openssl command line as the reference
- 1/2, 2/2: the commit messages mention PMG
- 2/2: SHA-256 signing is opt-in through an optional parameter of
  assemble_rsa_ticket() with unchanged default, instead of switching to
  SHA-256 and using the PVE_TICKET_SIGN_SHA1 environment variable; the option
  itself is in the pve-cluster and pve-access-control patches

v1: <CALkZksWBSdQa5AsvhmANGAJigcZ7FHPtgRgdu3JsRt9NX6vwSg@mail.gmail.com>
This is sent as a new thread, as is usual for a new version of a series.

Thanks to Shannon Sterz for the review of v1.

Mark Atwood (2):
  ticket: accept RSA tickets signed with SHA-256
  ticket: allow signing RSA tickets with SHA-256

 src/PVE/Ticket.pm   |  49 +++++++++++++++++-
 test/ticket_test.pl | 123 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 170 insertions(+), 2 deletions(-)


base-commit: 7193a0019937de6da53a3078e67f524fabcbf91a



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-11-17 16:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-13  3:06 [PATCH common v2 0/2] ticket: sign RSA tickets with SHA-256, opt-in Mark Atwood
2026-11-13  3:06 ` [PATCH common v2 1/2] ticket: accept RSA tickets signed with SHA-256 Mark Atwood
2026-11-17 16:05   ` Shannon Sterz
2026-11-13  3:06 ` [PATCH common v2 2/2] ticket: allow signing RSA tickets " Mark Atwood
2026-11-17 16:05   ` Shannon Sterz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal