From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 924EB6953B for ; Thu, 6 Aug 2020 09:14:20 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 84D8619F72 for ; Thu, 6 Aug 2020 09:13:50 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id ED6AA19F69 for ; Thu, 6 Aug 2020 09:13:49 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id B94FD4348C for ; Thu, 6 Aug 2020 09:13:49 +0200 (CEST) From: Dylan Whyte To: pbs-devel@lists.proxmox.com Date: Thu, 6 Aug 2020 09:13:40 +0200 Message-Id: <20200806071340.7379-1-d.whyte@proxmox.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment 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 Subject: [pbs-devel] [PATCH proxmox-backup-client] fix: master-key: upload RSA encoded key with backup X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Aug 2020 07:14:20 -0000 When uploading an RSA encoded key alongside the backup, the backup would fail with the error message: "wrong blob file extension". Adding the '.blob' extension to rsa-encrypted.key before the the call to upload_blob_from_data(), rather than after, fixes the issue. Signed-off-by: Dylan Whyte --- src/bin/proxmox-backup-client.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/bin/proxmox-backup-client.rs b/src/bin/proxmox-backup-client.rs index 16c6ec66..a7056685 100644 --- a/src/bin/proxmox-backup-client.rs +++ b/src/bin/proxmox-backup-client.rs @@ -1120,12 +1120,12 @@ async fn create_backup( } if let Some(rsa_encrypted_key) = rsa_encrypted_key { - let target = "rsa-encrypted.key"; + let target = "rsa-encrypted.key.blob"; println!("Upload RSA encoded key to '{:?}' as {}", repo, target); let stats = client .upload_blob_from_data(rsa_encrypted_key, target, false, false) .await?; - manifest.add_file(format!("{}.blob", target), stats.size, stats.csum, crypt_mode)?; + manifest.add_file(target.to_string(), stats.size, stats.csum, crypt_mode)?; // openssl rsautl -decrypt -inkey master-private.pem -in rsa-encrypted.key -out t /* @@ -1136,7 +1136,6 @@ async fn create_backup( println!("TEST {} {:?}", len, buffer2); */ } - // create manifest (index.json) // manifests are never encrypted, but include a signature let manifest = manifest.to_string(crypt_config.as_ref().map(Arc::as_ref)) -- 2.20.1