aboutsummaryrefslogtreecommitdiffstats
path: root/atuin-client/src/encryption.rs
diff options
context:
space:
mode:
authorConrad Ludgate <conrad.ludgate@truelayer.com>2022-04-22 21:14:23 +0100
committerGitHub <noreply@github.com>2022-04-22 20:14:23 +0000
commit7436e4ff651b64d4019a59d04c30c414ae220403 (patch)
tree3d5e35df1bce075ae04be63d76f9edc8cc17c6cb /atuin-client/src/encryption.rs
parentHistory filter (#329) (diff)
downloadatuin-7436e4ff651b64d4019a59d04c30c414ae220403.zip
feature-flags (#328)
* use feature flags * fmt * fix features * update ci * fmt Co-authored-by: Ellie Huxtable <ellie@elliehuxtable.com>
Diffstat (limited to 'atuin-client/src/encryption.rs')
-rw-r--r--atuin-client/src/encryption.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/atuin-client/src/encryption.rs b/atuin-client/src/encryption.rs
index 4746c23e..f805cbd5 100644
--- a/atuin-client/src/encryption.rs
+++ b/atuin-client/src/encryption.rs
@@ -77,7 +77,7 @@ pub fn encode_key(key: secretbox::Key) -> Result<String> {
pub fn decode_key(key: String) -> Result<secretbox::Key> {
let buf = base64::decode(key).wrap_err("encryption key is not a valid base64 encoding")?;
- let buf: secretbox::Key = rmp_serde::from_read_ref(&buf)
+ let buf: secretbox::Key = rmp_serde::from_slice(&buf)
.wrap_err("encryption key is not a valid message pack encoding")?;
Ok(buf)
@@ -98,7 +98,7 @@ pub fn decrypt(encrypted_history: &EncryptedHistory, key: &secretbox::Key) -> Re
let plaintext = secretbox::open(&encrypted_history.ciphertext, &encrypted_history.nonce, key)
.map_err(|_| eyre!("failed to open secretbox - invalid key?"))?;
- let history = rmp_serde::from_read_ref(&plaintext)?;
+ let history = rmp_serde::from_slice(&plaintext)?;
Ok(history)
}