mirror of
https://github.com/atuinsh/atuin.git
synced 2024-11-25 01:34:13 +01:00
Revert "feat: don't stop with invalid key (#1612)"
This reverts commit d84f5b2d33
.
This commit is contained in:
parent
9597080825
commit
408f7305b4
@ -164,16 +164,7 @@ impl HistoryStore {
|
|||||||
for record in records.into_iter() {
|
for record in records.into_iter() {
|
||||||
let hist = match record.version.as_str() {
|
let hist = match record.version.as_str() {
|
||||||
HISTORY_VERSION => {
|
HISTORY_VERSION => {
|
||||||
let decrypted = record.decrypt::<PASETO_V4>(&self.encryption_key);
|
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;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
HistoryRecord::deserialize(&decrypted.data, HISTORY_VERSION)
|
HistoryRecord::deserialize(&decrypted.data, HISTORY_VERSION)
|
||||||
}
|
}
|
||||||
version => bail!("unknown history version {version:?}"),
|
version => bail!("unknown history version {version:?}"),
|
||||||
|
@ -128,7 +128,6 @@ impl PASETO_V4 {
|
|||||||
// For now though we will only support the one key and key rotation will
|
// For now though we will only support the one key and key rotation will
|
||||||
// have to be a hard reset
|
// have to be a hard reset
|
||||||
let current_kid = wrapping_key.to_id();
|
let current_kid = wrapping_key.to_id();
|
||||||
|
|
||||||
ensure!(
|
ensure!(
|
||||||
current_kid == kid,
|
current_kid == kid,
|
||||||
"attempting to decrypt with incorrect key. currently using {current_kid}, expecting {kid}"
|
"attempting to decrypt with incorrect key. currently using {current_kid}, expecting {kid}"
|
||||||
|
Loading…
Reference in New Issue
Block a user