Skip to content

Commit

Permalink
Revert "feat: don't stop with invalid key (#1612)"
Browse files Browse the repository at this point in the history
This reverts commit d84f5b2.
  • Loading branch information
ellie committed Jan 30, 2024
1 parent 9597080 commit 408f730
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
11 changes: 1 addition & 10 deletions atuin-client/src/history/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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:?}"),
Expand Down
1 change: 0 additions & 1 deletion atuin-client/src/record/encryption.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down

0 comments on commit 408f730

Please sign in to comment.