summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Indra <martin.indra@mgn.cz>2022-08-11 13:27:04 +0200
committerGitHub <noreply@github.com>2022-08-11 12:27:04 +0100
commit2abac5d8535c8408f8f62d945fec75f24ae71747 (patch)
tree9fd4e1082e76ae70a2a2a2e7c81c3481ce82506e
parent0c5e250800f1b8f50ea832bf414a5a7cdfe944a4 (diff)
Trim whitespace from end of encryption key (#496)
-rw-r--r--atuin-client/src/encryption.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/atuin-client/src/encryption.rs b/atuin-client/src/encryption.rs
index 842fe9f32..46cf1b2e4 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<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 =
+ 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")?;