From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 7591E1FF13A for ; Wed, 29 Apr 2026 13:52:28 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 3C223375B; Wed, 29 Apr 2026 13:52:28 +0200 (CEST) Message-ID: <2ad4142e-6562-429e-8bd3-346a23161227@proxmox.com> Date: Wed, 29 Apr 2026 13:52:22 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH proxmox-backup 1/2] client: allow skipping signature check on previous manifest fetching To: =?UTF-8?Q?Fabian_Gr=C3=BCnbichler?= , pbs-devel@lists.proxmox.com References: <20260429092847.381438-1-c.ebner@proxmox.com> <20260429092847.381438-2-c.ebner@proxmox.com> <1777461594.ctjrr353d8.astroid@yuna.none> Content-Language: en-US, de-DE From: Christian Ebner In-Reply-To: <1777461594.ctjrr353d8.astroid@yuna.none> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1777463445308 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.071 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment 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: P7NUTZOLLWZ7GQ2GDPW3TWBAPU3XRUIV X-Message-ID-Hash: P7NUTZOLLWZ7GQ2GDPW3TWBAPU3XRUIV X-MailFrom: c.ebner@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 4/29/26 1:41 PM, Fabian Grünbichler wrote: > On April 29, 2026 11:28 am, Christian Ebner wrote: >> Extends the BackupWriter implementation by a method which allows to >> download the previous manifest from a PBS instance, but skipping the >> signature check even if the backup writer has a crypt_config set. >> >> This will be used to silence misleading logs during encrypting push >> sync jobs, by performing the signature check on the call site >> instead. >> >> Signed-off-by: Christian Ebner >> --- >> pbs-client/src/backup_writer.rs | 22 +++++++++++++++++++--- >> 1 file changed, 19 insertions(+), 3 deletions(-) >> >> diff --git a/pbs-client/src/backup_writer.rs b/pbs-client/src/backup_writer.rs >> index 49aff3fdd..ea990dbde 100644 >> --- a/pbs-client/src/backup_writer.rs >> +++ b/pbs-client/src/backup_writer.rs >> @@ -735,8 +735,25 @@ impl BackupWriter { >> }) >> } >> >> - /// Download backup manifest (index.json) of last backup >> + /// Download backup manifest (index.json) of last backup, checking the signature >> + /// using the backup writer's crypt config. >> pub async fn download_previous_manifest(&self) -> Result { > > since we only have two callsites for this (one for each variant ;)), couldn't we just switch to > > download_previous_manifest(&self, check_signature: bool) > > ? would make the writer interface a little less bloated.. Okay, will move it to a boolean flag instead. > >> + let manifest = self >> + .download_previous_manifest_without_signature_check() >> + .await?; >> + >> + if let Some(crypt_config) = &self.crypt_config { >> + manifest.check_signature(crypt_config)?; >> + } >> + >> + Ok(manifest) >> + } >> + >> + /// Download backup manifest (index.json) of last backup, but skips the signature >> + /// check by not providing the crypt config when parsing the manifest from the data blob. >> + pub async fn download_previous_manifest_without_signature_check( >> + &self, >> + ) -> Result { >> let mut raw_data = Vec::with_capacity(64 * 1024); >> >> let param = json!({ "archive-name": MANIFEST_BLOB_NAME.to_string() }); >> @@ -748,8 +765,7 @@ impl BackupWriter { >> // no expected digest available >> let data = blob.decode(self.crypt_config.as_ref().map(Arc::as_ref), None)?; > > pre-existing, but this makes no sense - manifests are never encrypted, > so passing the key here is just misleading? The DataBlob::decode() does however fallback to use the crypt config's compute_digest implementation instead of the fallback sha256sum. Not sure about the implementation details, must have a closer look if it is actually fine to drop this. > >> >> - let manifest = >> - BackupManifest::from_data(&data[..], self.crypt_config.as_ref().map(Arc::as_ref))?; >> + let manifest = BackupManifest::from_data(&data[..], None)?; >> >> Ok(manifest) >> } >> -- >> 2.47.3 >> >> >> >> >> >>