summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEllie Huxtable <ellie@elliehuxtable.com>2024-01-30 13:42:55 +0000
committerEllie Huxtable <ellie@elliehuxtable.com>2024-01-30 13:42:55 +0000
commit408f7305b45649be5509d34a7d60e82936d9e4d8 (patch)
treeeafb64e35fabd3ad489492f69c3a58de5379596f
parent9597080825565b2ba8ea202b7027e91b02aaac7f (diff)
Revert "feat: don't stop with invalid key (#1612)"ellie/wrong-key-is-error
-rw-r--r--atuin-client/src/history/store.rs11
-rw-r--r--atuin-client/src/record/encryption.rs1
2 files changed, 1 insertions, 11 deletions
diff --git a/atuin-client/src/history/store.rs b/atuin-client/src/history/store.rs
index 0a2a2312..ea1cf47d 100644
--- a/atuin-client/src/history/store.rs
+++ b/atuin-client/src/history/store.rs
@@ -164,16 +164,7 @@ impl HistoryStore {
for record in records.into_iter() {
let hist = match record.version.as_str() {
HISTORY_VERSION => {
- let decrypted = record.decrypt::<PASETO_V4>(&self.encryption_key);
-
- let decrypted = match decrypted {
- Ok(d) => d,
- Err(e) => {
- println!("failed to decrypt history: {e}");
- continue;
- }
- };
-
+ let decrypted = record.decrypt::<PASETO_V4>(&self.encryption_key)?;
HistoryRecord::deserialize(&decrypted.data, HISTORY_VERSION)
}
version => bail!("unknown history version {version:?}"),
diff --git a/atuin-client/src/record/encryption.rs b/atuin-client/src/record/encryption.rs
index ca49660c..c2cdaa6a 100644
--- a/atuin-client/src/record/encryption.rs
+++ b/atuin-client/src/record/encryption.rs
@@ -128,7 +128,6 @@ impl PASETO_V4 {
// For now though we will only support the one key and key rotation will
// have to be a hard reset
let current_kid = wrapping_key.to_id();
-
ensure!(
current_kid == kid,
"attempting to decrypt with incorrect key. currently using {current_kid}, expecting {kid}"