Skip to content

Commit

Permalink
Update RRR
Browse files Browse the repository at this point in the history
  • Loading branch information
Limeth committed Jul 14, 2024
1 parent 43a1fc8 commit d32d447
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 21 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ color-eyre = "0.6.3"
ed25519-dalek = { version = "2.1.1", features = ["rand_core", "pem"] }
futures = "0.3.30"
include_dir = { version = "0.7.4", features = ["nightly"] }
rrr = { git = "https://github.com/recursive-record-registry/rrr.git", rev = "5f11db585aabb6a6feaeb9fcd8ec79b93b9854f9" }
rrr = { git = "https://github.com/recursive-record-registry/rrr.git", rev = "782db4752ee74fc56199151e5b261f33b32cfbfa" }
serde = { version = "1.0.203", features = ["derive"] }
serde_bytes = "0.11.14"
serde_with = "3.8.1"
Expand Down
3 changes: 2 additions & 1 deletion src/cmd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ impl Command {
let root_predecessor_nonce = output_registry
.config
.kdf
.get_root_record_predecessor_nonce();
.get_root_record_predecessor_nonce()
.clone();

// TODO: Verify target registry keys

Expand Down
8 changes: 4 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ pub fn make_recursive<'a>(
&input_registry.signing_keys,
&hashed_key,
&output_record,
0.into(), // TODO
0, // TODO
&[], // TODO
Some(&EncryptionAlgorithm::A256GCM), // TODO
0.into(), // TODO
0, // TODO
&[], // TODO
Some(&EncryptionAlgorithm::Aes256Gcm), // TODO
force,
)
.await?;
Expand Down
22 changes: 8 additions & 14 deletions src/owned/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ use rrr::crypto::kdf::KdfAlgorithm;
use rrr::crypto::password_hash::{argon2::Argon2Params, PasswordHashAlgorithm};
use rrr::crypto::signature::{SigningKey, SigningKeyEd25519};
use rrr::registry::{
ConfigParam, OutputLengthInBytes, RegistryConfig, RegistryConfigHash, RegistryConfigKdf,
SuccessionNonceLengthInBytes,
RegistryConfig, RegistryConfigHash, RegistryConfigKdf,
};
use rrr::utils::serde::Secret;
use rrr::{crypto::encryption::EncryptionAlgorithm, record::RecordKey};
Expand Down Expand Up @@ -45,7 +44,7 @@ impl OwnedRegistryConfig {
pub fn get_root_record_key(&self) -> RecordKey {
RecordKey {
record_name: Default::default(),
predecessor_nonce: self.kdf.get_root_record_predecessor_nonce(),
predecessor_nonce: self.kdf.get_root_record_predecessor_nonce().clone(),
}
}
}
Expand Down Expand Up @@ -160,18 +159,13 @@ impl OwnedRegistry {

let config = OwnedRegistryConfig {
hash: RegistryConfigHash {
algorithm: PasswordHashAlgorithm::Argon2(
Argon2Params::default_with_random_pepper_of_recommended_length(&mut csprng),
),
output_length_in_bytes: ConfigParam::<OutputLengthInBytes>::try_from(32).unwrap(),
algorithm: PasswordHashAlgorithm::Argon2(Argon2Params::default()),
output_length_in_bytes: Default::default(),
},
kdf: RegistryConfigKdf {
algorithm: KdfAlgorithm::Hkdf(HkdfParams::default()),
succession_nonce_length_in_bytes:
ConfigParam::<SuccessionNonceLengthInBytes>::try_from(32).unwrap(),
file_name_length_in_bytes: ConfigParam::try_from(8).unwrap(),
},
encryption_algorithm: EncryptionAlgorithm::A256GCM,
kdf: RegistryConfigKdf::builder()
.with_algorithm(KdfAlgorithm::Hkdf(HkdfParams::default()))
.build_with_random_root_predecessor_nonce(csprng)?,
encryption_algorithm: EncryptionAlgorithm::Aes256Gcm,
root_record_path: PathBuf::from("root"),
signing_key_paths,
};
Expand Down

0 comments on commit d32d447

Please sign in to comment.