tape: restore_key - always update key, even if there is already an entry

This commit is contained in:
Dietmar Maurer
2021-01-21 07:46:21 +01:00
parent 4dafc513cc
commit 18bd6ba13d
3 changed files with 7 additions and 5 deletions

View File

@ -485,7 +485,7 @@ pub async fn restore_key(
if let Some(key_config) = key_config {
let password_fn = || { Ok(password.as_bytes().to_vec()) };
let (key, ..) = key_config.decrypt(&password_fn)?;
config::tape_encryption_keys::insert_key(key, key_config)?;
config::tape_encryption_keys::insert_key(key, key_config, true)?;
} else {
bail!("media does not contain any encryption key configuration");
}