From a75e516986ab2ba8b0997dd93271b58fa1986637 Mon Sep 17 00:00:00 2001 From: Conrad Ludgate Date: Wed, 21 Jun 2023 08:45:23 +0100 Subject: remove decryption from api-client (#1063) --- atuin-client/src/encryption.rs | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'atuin-client/src/encryption.rs') diff --git a/atuin-client/src/encryption.rs b/atuin-client/src/encryption.rs index a7aec0e7..86125159 100644 --- a/atuin-client/src/encryption.rs +++ b/atuin-client/src/encryption.rs @@ -56,23 +56,6 @@ pub fn load_key(settings: &Settings) -> Result { Ok(key) } -pub fn load_encoded_key(settings: &Settings) -> Result { - let path = settings.key_path.as_str(); - - if PathBuf::from(path).exists() { - let key = fs::read_to_string(path)?; - Ok(key) - } else { - let key = XSalsa20Poly1305::generate_key(&mut OsRng); - let encoded = encode_key(&key)?; - - let mut file = fs::File::create(path)?; - file.write_all(encoded.as_bytes())?; - - Ok(encoded) - } -} - pub fn encode_key(key: &Key) -> Result { let mut buf = vec![]; rmp::encode::write_bin(&mut buf, key.as_slice()) -- cgit v1.3.1