master key: store blob name in constant
since we will use it in more than one place. Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
		
				
					committed by
					
						
						Dietmar Maurer
					
				
			
			
				
	
			
			
			
						parent
						
							fe6c19383b
						
					
				
				
					commit
					9990af3042
				
			@ -10,6 +10,7 @@ use crate::backup::{BackupDir, CryptMode, CryptConfig, Fingerprint};
 | 
				
			|||||||
pub const MANIFEST_BLOB_NAME: &str = "index.json.blob";
 | 
					pub const MANIFEST_BLOB_NAME: &str = "index.json.blob";
 | 
				
			||||||
pub const MANIFEST_LOCK_NAME: &str = ".index.json.lck";
 | 
					pub const MANIFEST_LOCK_NAME: &str = ".index.json.lck";
 | 
				
			||||||
pub const CLIENT_LOG_BLOB_NAME: &str = "client.log.blob";
 | 
					pub const CLIENT_LOG_BLOB_NAME: &str = "client.log.blob";
 | 
				
			||||||
 | 
					pub const ENCRYPTED_KEY_BLOB_NAME: &str = "rsa-encrypted.key.blob";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
mod hex_csum {
 | 
					mod hex_csum {
 | 
				
			||||||
    use serde::{self, Deserialize, Serializer, Deserializer};
 | 
					    use serde::{self, Deserialize, Serializer, Deserializer};
 | 
				
			||||||
 | 
				
			|||||||
@ -54,6 +54,7 @@ use proxmox_backup::backup::{
 | 
				
			|||||||
    CryptConfig,
 | 
					    CryptConfig,
 | 
				
			||||||
    CryptMode,
 | 
					    CryptMode,
 | 
				
			||||||
    DynamicIndexReader,
 | 
					    DynamicIndexReader,
 | 
				
			||||||
 | 
					    ENCRYPTED_KEY_BLOB_NAME,
 | 
				
			||||||
    FixedChunkStream,
 | 
					    FixedChunkStream,
 | 
				
			||||||
    FixedIndexReader,
 | 
					    FixedIndexReader,
 | 
				
			||||||
    IndexFile,
 | 
					    IndexFile,
 | 
				
			||||||
@ -1064,7 +1065,7 @@ async fn create_backup(
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if let Some(rsa_encrypted_key) = rsa_encrypted_key {
 | 
					    if let Some(rsa_encrypted_key) = rsa_encrypted_key {
 | 
				
			||||||
        let target = "rsa-encrypted.key.blob";
 | 
					        let target = ENCRYPTED_KEY_BLOB_NAME;
 | 
				
			||||||
        println!("Upload RSA encoded key to '{:?}' as {}", repo, target);
 | 
					        println!("Upload RSA encoded key to '{:?}' as {}", repo, target);
 | 
				
			||||||
        let stats = client
 | 
					        let stats = client
 | 
				
			||||||
            .upload_blob_from_data(rsa_encrypted_key, target, false, false)
 | 
					            .upload_blob_from_data(rsa_encrypted_key, target, false, false)
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user