From a83767f9fbd51df654901b52bdba7838f6a10bf9 Mon Sep 17 00:00:00 2001 From: Igor Tolmachev Date: Tue, 16 Jul 2024 01:59:53 +0900 Subject: Add traditional PKWARE decryption. - Compression and encryption may not work together - Password check is not yet implemented - Unoptimized crc32 function --- tests/zip.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests/zip.rs') diff --git a/tests/zip.rs b/tests/zip.rs index 11435aa..4f0c985 100644 --- a/tests/zip.rs +++ b/tests/zip.rs @@ -2,6 +2,17 @@ use archivator::{Archive, Zip}; use std::io::{Read, Seek, SeekFrom}; #[test] +fn test_zip_passwd() { + let mut archive = Archive::::read_from_file("tests/files/archive_passwd.zip").unwrap(); + let mut f = archive + .get_file_reader_by_index_with_password(0, "passwd") + .unwrap(); + let mut data = String::new(); + f.read_to_string(&mut data).unwrap(); + assert_eq!(data, "test file data"); +} + +// #[test] fn test_zip() { let mut archive = Archive::::read_from_file("tests/files/archive.zip").unwrap(); -- cgit v1.2.3