From af3a0ae7b1f547d35262655365262c0a05a53cbc Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Wed, 8 Jul 2020 09:18:13 +0200 Subject: [PATCH] remove CryptMode::sign_only special method Signed-off-by: Wolfgang Bumiller --- src/backup/crypt_config.rs | 10 ---------- src/bin/proxmox-backup-client.rs | 7 ++++++- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/backup/crypt_config.rs b/src/backup/crypt_config.rs index 90d99b4f..bdf93680 100644 --- a/src/backup/crypt_config.rs +++ b/src/backup/crypt_config.rs @@ -31,16 +31,6 @@ pub enum CryptMode { SignOnly, } -impl CryptMode { - /// Maps values other than `None` to `SignOnly`. - pub fn sign_only(self) -> Self { - match self { - CryptMode::None => CryptMode::None, - _ => CryptMode::SignOnly, - } - } -} - /// Encryption Configuration with secret key /// /// This structure stores the secret key and provides helpers for diff --git a/src/bin/proxmox-backup-client.rs b/src/bin/proxmox-backup-client.rs index cc254f24..487a3cdc 100644 --- a/src/bin/proxmox-backup-client.rs +++ b/src/bin/proxmox-backup-client.rs @@ -1040,8 +1040,13 @@ async fn create_backup( println!("Upload index.json to '{:?}'", repo); let manifest = serde_json::to_string_pretty(&manifest)?.into(); + // manifests are never encrypted + let manifest_crypt_mode = match crypt_mode { + CryptMode::None => CryptMode::None, + _ => CryptMode::SignOnly, + }; client - .upload_blob_from_data(manifest, MANIFEST_BLOB_NAME, true, crypt_mode.sign_only()) + .upload_blob_from_data(manifest, MANIFEST_BLOB_NAME, true, manifest_crypt_mode) .await?; client.finish().await?;