mirror of
https://github.com/atuinsh/atuin.git
synced 2024-12-25 16:39:18 +01:00
feat: failure to decrypt history = failure to sync
Now that the user can purge their store and _do something_ about invalid records, we should not tolerate mixed key records in store.
This commit is contained in:
parent
754f17ddb4
commit
3c420f85f6
@ -164,15 +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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user