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 E2D621FF0B3 for ; Wed, 11 Nov 2026 23:02:52 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 1EF2D2167A; Wed, 11 Nov 2026 23:02:50 +0100 (CET) From: Thomas Lamprecht To: pbs-devel@lists.proxmox.com, Christian Ebner Subject: applied: [PATCH proxmox 0/3] s3-client: fix request signing and update request time on retry Date: Wed, 11 Nov 2026 23:00:46 +0100 Message-ID: <179443424650.1210260.2843796365713327912.b4-ty@b4> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261007123406.429342-1-c.ebner@proxmox.com> References: <20261007123406.429342-1-c.ebner@proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1794434564678 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.265 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium 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: WRB4MOGUOKDIX2HKAII4U6BUVGKCZWFW X-Message-ID-Hash: WRB4MOGUOKDIX2HKAII4U6BUVGKCZWFW X-MailFrom: t.lamprecht@proxmox.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 Backup Server development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Wed, 07 Oct 2026 14:34:03 +0200, Christian Ebner wrote: > This patch series fixes 2 issues with the current s3-client > implementation. > > In particular: > - Patch 1 fixes an issue with s3-client request signing, encountered > during development. The canonical request headers and query > parameters were incorrectly sorted by key+value strings instead > of key only, which could lead to sorting mismatches with the API > server, resulting in signature mismatches and therefore rejected > requests. In particular, this might be encountered if one header > name is a prefix to another header name. > Fixed by sorting headers and queries via their respective key only. > - Patches 2+3 fix a not updated request time for requests being > retried. This could potentially lead to `RequestTimeTooSkewed` > errors when the time in-between retried requests is very large and > might explain such errors observed as reported in the community > forum [0]. > Fixed by setting the current request time and updating the request > signature each time before sending the request via the client. > > [...] Applied, thanks! For the first patch I adapted the query parameter handling a bit: the parameters are now URI-encoded first and only then sorted, with the encoded value ordering duplicate names, as that is the order the SigV4 docs specify for the canonical request [0]. Sorting the raw pairs could still produce a different order than the server computes, e.g., for names where the encoded form sorts differently or for repeated parameters. [0]: https://docs.aws.amazon.com/IAM/latest/UserGuide/create-signed-request.html [1/3] s3-client: fix header and query parameter sorting during aws sign v4 commit: 91e7f7e8a135d3bc3826ab50e05d3126c039df11 [2/3] s3-client: factor out request signing and related header updates commit: 97960079e9c715559ac7d94421a5eb40d1052740 [3/3] s3-client: update request time and signature on retries commit: 07a4feb646fdeaf4651da81490bb921b646d80e4