moved key_derivation.rs from pbs_datastore to pbs-config/src/key_config.rs
Also moved pbs-datastore/src/crypt_config.rs to pbs-tools/src/crypt_config.rs. We do not want to depend on pbs-api-types there, so I use [u8;32] instead of Fingerprint.
This commit is contained in:
@ -26,6 +26,7 @@ proxmox = { version = "0.13.0", features = [ "sortable-macro", "api-macro", "cli
|
||||
|
||||
pbs-api-types = { path = "../pbs-api-types" }
|
||||
pbs-buildcfg = { path = "../pbs-buildcfg" }
|
||||
pbs-config = { path = "../pbs-config" }
|
||||
pbs-client = { path = "../pbs-client" }
|
||||
pbs-datastore = { path = "../pbs-datastore" }
|
||||
pbs-fuse-loop = { path = "../pbs-fuse-loop" }
|
||||
|
@ -19,9 +19,10 @@ use proxmox::api::{
|
||||
schema::ApiType,
|
||||
};
|
||||
|
||||
use pbs_tools::crypt_config::CryptConfig;
|
||||
use pbs_config::key_config::{KeyDerivationConfig, load_and_decrypt_key};
|
||||
use pbs_client::tools::key_source::get_encryption_key_password;
|
||||
use pbs_client::{BackupRepository, BackupWriter};
|
||||
use pbs_datastore::{CryptConfig, KeyDerivationConfig, load_and_decrypt_key};
|
||||
use pbs_datastore::data_blob::{DataBlob, DataChunkBuilder};
|
||||
|
||||
use crate::{
|
||||
|
@ -10,6 +10,7 @@ use proxmox::api::{api, cli::*};
|
||||
use pbs_client::tools::key_source::get_encryption_key_password;
|
||||
use pbs_client::{BackupReader, RemoteChunkReader};
|
||||
use pbs_tools::json::required_string_param;
|
||||
use pbs_tools::crypt_config::CryptConfig;
|
||||
|
||||
use crate::{
|
||||
REPO_URL_SCHEMA,
|
||||
@ -31,7 +32,6 @@ use crate::{
|
||||
BufferedDynamicReadAt,
|
||||
CatalogReader,
|
||||
CATALOG_NAME,
|
||||
CryptConfig,
|
||||
DynamicIndexReader,
|
||||
IndexFile,
|
||||
Shell,
|
||||
|
@ -15,7 +15,7 @@ use proxmox::sys::linux::tty;
|
||||
use proxmox::tools::fs::{file_get_contents, replace_file, CreateOptions};
|
||||
|
||||
use pbs_api_types::{RsaPubKeyInfo, PASSWORD_HINT_SCHEMA, Kdf, KeyInfo};
|
||||
use pbs_datastore::{KeyConfig, rsa_decrypt_key_config};
|
||||
use pbs_config::key_config::{KeyConfig, rsa_decrypt_key_config};
|
||||
use pbs_datastore::paperkey::{generate_paper_key, PaperkeyFormat};
|
||||
use pbs_client::tools::key_source::{
|
||||
find_default_encryption_key, find_default_master_pubkey, get_encryption_key_password,
|
||||
|
@ -29,7 +29,7 @@ use pxar::accessor::{MaybeReady, ReadAt, ReadAtOperation};
|
||||
|
||||
use pbs_api_types::{
|
||||
BACKUP_ID_SCHEMA, BACKUP_TIME_SCHEMA, BACKUP_TYPE_SCHEMA, Authid, CryptMode, GroupListItem,
|
||||
PruneListItem, SnapshotListItem, StorageStatus,
|
||||
PruneListItem, SnapshotListItem, StorageStatus, Fingerprint,
|
||||
};
|
||||
use pbs_client::{
|
||||
BACKUP_SOURCE_SCHEMA,
|
||||
@ -60,7 +60,8 @@ use pbs_client::tools::{
|
||||
},
|
||||
CHUNK_SIZE_SCHEMA, REPO_URL_SCHEMA,
|
||||
};
|
||||
use pbs_datastore::{CATALOG_NAME, CryptConfig, KeyConfig, decrypt_key, rsa_encrypt_key_config};
|
||||
use pbs_config::key_config::{KeyConfig, decrypt_key, rsa_encrypt_key_config};
|
||||
use pbs_datastore::CATALOG_NAME;
|
||||
use pbs_datastore::backup_info::{BackupDir, BackupGroup};
|
||||
use pbs_datastore::catalog::{BackupCatalogWriter, CatalogReader, CatalogWriter};
|
||||
use pbs_datastore::chunk_store::verify_chunk_size;
|
||||
@ -75,6 +76,7 @@ use pbs_datastore::prune::PruneOptions;
|
||||
use pbs_tools::sync::StdChannelWriter;
|
||||
use pbs_tools::tokio::TokioWriterAdapter;
|
||||
use pbs_tools::json;
|
||||
use pbs_tools::crypt_config::CryptConfig;
|
||||
|
||||
mod benchmark;
|
||||
pub use benchmark::*;
|
||||
@ -1131,7 +1133,7 @@ async fn restore(param: Value) -> Result<Value, Error> {
|
||||
eprintln!("{}", format_key_source(&key.source, "encryption"));
|
||||
}
|
||||
if let Some(config) = &crypt_config {
|
||||
eprintln!("Fingerprint: {}", config.fingerprint());
|
||||
eprintln!("Fingerprint: {}", Fingerprint::new(config.fingerprint()));
|
||||
}
|
||||
}
|
||||
manifest.check_fingerprint(crypt_config.as_ref().map(Arc::as_ref))?;
|
||||
|
@ -17,7 +17,9 @@ use proxmox::{sortable, identity};
|
||||
use proxmox::api::{ApiHandler, ApiMethod, RpcEnvironment, schema::*, cli::*};
|
||||
use proxmox::tools::fd::Fd;
|
||||
|
||||
use pbs_datastore::{BackupDir, BackupGroup, CryptConfig, load_and_decrypt_key};
|
||||
use pbs_tools::crypt_config::CryptConfig;
|
||||
use pbs_config::key_config::load_and_decrypt_key;
|
||||
use pbs_datastore::{BackupDir, BackupGroup, };
|
||||
use pbs_datastore::index::IndexFile;
|
||||
use pbs_datastore::dynamic_index::BufferedDynamicReader;
|
||||
use pbs_datastore::cached_chunk_reader::CachedChunkReader;
|
||||
|
@ -8,10 +8,11 @@ use proxmox::{
|
||||
tools::fs::file_get_contents,
|
||||
};
|
||||
|
||||
use pbs_api_types::SnapshotListItem;
|
||||
use pbs_tools::crypt_config::CryptConfig;
|
||||
use pbs_config::key_config::decrypt_key;
|
||||
use pbs_api_types::{SnapshotListItem, CryptMode};
|
||||
use pbs_client::tools::key_source::get_encryption_key_password;
|
||||
use pbs_datastore::{BackupGroup, CryptMode, CryptConfig, decrypt_key};
|
||||
use pbs_datastore::data_blob::DataBlob;
|
||||
use pbs_datastore::{DataBlob, BackupGroup};
|
||||
use pbs_tools::json::required_string_param;
|
||||
|
||||
use crate::{
|
||||
|
Reference in New Issue
Block a user