diff --git a/vach/src/global/reg_entry.rs b/vach/src/global/reg_entry.rs index 60e32aaf..f5d7f644 100644 --- a/vach/src/global/reg_entry.rs +++ b/vach/src/global/reg_entry.rs @@ -30,7 +30,7 @@ impl RegistryEntry { #[inline(always)] pub(crate) fn empty() -> RegistryEntry { RegistryEntry { - id: Arc::from(""), + id: Arc::from(""), flags: Flags::empty(), content_version: 0, location: 0, diff --git a/vach/src/tests/mod.rs b/vach/src/tests/mod.rs index 9c609382..869118da 100644 --- a/vach/src/tests/mod.rs +++ b/vach/src/tests/mod.rs @@ -163,7 +163,6 @@ fn fetch_with_signature() -> InternalResult { config.load_public_key(keypair)?; let mut archive = Archive::with_config(target, &config)?; - dbg!(archive.entries()); let resource = archive.fetch_mut("test_data/song.txt")?; let song = str::from_utf8(&resource.data).unwrap(); @@ -178,17 +177,9 @@ fn fetch_with_signature() -> InternalResult { assert!(!not_signed_resource.authenticated); // Check authenticity of retrieved data + let song = song.trim(); println!("{}", song); - - // Windows bullshit - #[cfg(target_os = "windows")] - { - assert_eq!(song.len(), 2041); - } - #[cfg(not(any(target_os = "windows", target_os = "ios")))] - { - assert_eq!(song.len(), 1977); - } + assert_eq!(song.len(), 1977); assert!(resource.authenticated); assert!(resource.flags.contains(Flags::SIGNED_FLAG)); @@ -198,7 +189,7 @@ fn fetch_with_signature() -> InternalResult { #[test] #[cfg(feature = "crypto")] -fn edcryptor_test() -> InternalResult { +fn decryptor_test() -> InternalResult { use crate::crypto_utils::gen_keypair; let vk = gen_keypair().verifying_key(); diff --git a/vach/src/writer/mod.rs b/vach/src/writer/mod.rs index 4375b81a..64ac431f 100644 --- a/vach/src/writer/mod.rs +++ b/vach/src/writer/mod.rs @@ -335,6 +335,10 @@ impl<'a> Builder<'a> { .map(|l| Builder::process_leaf(l, encryptor.as_ref())) .try_for_each(write)?; + // write out Registry + target.seek(SeekFrom::Start(Header::BASE_SIZE as _))?; + target.write_all(®istry)?; + // // Define all arc-mutexes // let leaf_offset_arc = Arc::new(AtomicU64::new(leaf_offset)); // let total_arc = Arc::new(AtomicUsize::new(Header::BASE_SIZE)); diff --git a/vach/test_data/encrypted/target.vach b/vach/test_data/encrypted/target.vach index 5b74ff83..c41c3b06 100644 Binary files a/vach/test_data/encrypted/target.vach and b/vach/test_data/encrypted/target.vach differ diff --git a/vach/test_data/signed/target.vach b/vach/test_data/signed/target.vach index 231acadf..1c5eb603 100644 Binary files a/vach/test_data/signed/target.vach and b/vach/test_data/signed/target.vach differ diff --git a/vach/test_data/simple/target.vach b/vach/test_data/simple/target.vach index 12617da5..09b3e202 100644 Binary files a/vach/test_data/simple/target.vach and b/vach/test_data/simple/target.vach differ