move tape_encryption_keys.rs to pbs_config workspace

This commit is contained in:
Dietmar Maurer
2021-09-07 10:37:08 +02:00
parent bbdda58b35
commit 5839c469c1
9 changed files with 36 additions and 59 deletions

View File

@ -11,9 +11,22 @@ use proxmox::{
},
};
use pbs_api_types::{Fingerprint, KeyInfo, Kdf};
use pbs_api_types::{
Fingerprint, KeyInfo, Kdf,
TAPE_ENCRYPTION_KEY_FINGERPRINT_SCHEMA,
PROXMOX_CONFIG_DIGEST_SCHEMA, PASSWORD_HINT_SCHEMA,
};
use pbs_config::key_config::KeyConfig;
use pbs_config::open_backup_lockfile;
use pbs_config::tape_encryption_keys::{
TAPE_KEYS_LOCKFILE,
load_keys,
load_key_configs,
save_keys,
save_key_configs,
insert_key,
};
use crate::{
config::{
@ -21,19 +34,6 @@ use crate::{
PRIV_TAPE_AUDIT,
PRIV_TAPE_MODIFY,
},
tape_encryption_keys::{
TAPE_KEYS_LOCKFILE,
load_keys,
load_key_configs,
save_keys,
save_key_configs,
insert_key,
},
},
api2::types::{
TAPE_ENCRYPTION_KEY_FINGERPRINT_SCHEMA,
PROXMOX_CONFIG_DIGEST_SCHEMA,
PASSWORD_HINT_SCHEMA,
},
};

View File

@ -26,7 +26,6 @@ use pbs_datastore::task_log;
use crate::{
config::{
self,
cached_user_info::CachedUserInfo,
acl::{
PRIV_TAPE_AUDIT,
@ -658,7 +657,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, true)?;
pbs_config::tape_encryption_keys::insert_key(key, key_config, true)?;
} else {
bail!("media does not contain any encryption key configuration");
}