Harness the power of signify(1) to sign arbitrary git objects
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

drop key data as soon as we parse a sk

+8 -6
+8 -6
src/main.rs
··· 83 83 } 84 84 85 85 fn get_secret_key(path: PathBuf) -> Result<PrivateKey> { 86 - let key_data = std::fs::read_to_string(path) 87 - .map(Zeroizing::new) 88 - .context("Failed to read secret key")?; 86 + let (mut secret_key, _) = { 87 + let key_data = std::fs::read_to_string(path) 88 + .map(Zeroizing::new) 89 + .context("Failed to read secret key")?; 89 90 90 - let (mut secret_key, _) = PrivateKey::from_base64(&key_data[..]) 91 - .map_err(Error::new) 92 - .context("Failed to decode secret key")?; 91 + PrivateKey::from_base64(&key_data[..]) 92 + .map_err(Error::new) 93 + .context("Failed to decode secret key")? 94 + }; 93 95 94 96 if secret_key.is_encrypted() { 95 97 let passphrase = rpassword::read_password()