diff --git a/src/backup/key_derivation.rs b/src/backup/key_derivation.rs index 1a5bc250..046a8c8f 100644 --- a/src/backup/key_derivation.rs +++ b/src/backup/key_derivation.rs @@ -187,16 +187,9 @@ pub fn encrypt_key_with_passphrase( pub fn load_and_decrypt_key( path: &std::path::Path, passphrase: &dyn Fn() -> Result, Error>, -) -> Result<([u8;32], i64, Fingerprint), Error> { - do_load_and_decrypt_key(path, passphrase) - .with_context(|| format!("failed to load decryption key from {:?}", path)) -} - -fn do_load_and_decrypt_key( - path: &std::path::Path, - passphrase: &dyn Fn() -> Result, Error>, ) -> Result<([u8;32], i64, Fingerprint), Error> { decrypt_key(&file_get_contents(&path)?, passphrase) + .with_context(|| format!("failed to load decryption key from {:?}", path)) } pub fn decrypt_key(