From 0b45d8210c4b173fa9a8a147f77b9a03641e94c4 Mon Sep 17 00:00:00 2001 From: Martin Indra Date: Wed, 10 Aug 2022 18:26:05 +0200 Subject: [PATCH] Trim whitespace from end of encryption key --- atuin-client/src/encryption.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/atuin-client/src/encryption.rs b/atuin-client/src/encryption.rs index 842fe9f3203..46cf1b2e42b 100644 --- a/atuin-client/src/encryption.rs +++ b/atuin-client/src/encryption.rs @@ -74,7 +74,8 @@ pub fn encode_key(key: secretbox::Key) -> Result { } pub fn decode_key(key: String) -> Result { - let buf = base64::decode(key).wrap_err("encryption key is not a valid base64 encoding")?; + let buf = + base64::decode(key.trim_end()).wrap_err("encryption key is not a valid base64 encoding")?; let buf: secretbox::Key = rmp_serde::from_slice(&buf) .wrap_err("encryption key is not a valid message pack encoding")?;