5 Commits

Author SHA1 Message Date
NikitolProject
4077847caa feat(12-02): wire salt into pack/unpack, update main.rs, add password tests
- Pack signature accepts optional salt, writes 16-byte salt between header and TOC
- Set flags bit 4 and adjust toc_offset to 56 when salt present
- read_archive_metadata returns salt alongside header and TOC entries
- Add read_archive_salt() public helper for pre-unpack salt reading
- main.rs uses resolve_key_for_pack/resolve_key_for_unpack for two-phase password flow
- Add 5 new integration tests: password roundtrip, wrong password rejection,
  salt flag presence, no-salt flag for key archives, directory password roundtrip
- All 52 tests pass (25 unit + 7 golden + 20 integration)
2026-02-27 00:01:23 +03:00
NikitolProject
551e49994d test(12-01): update all tests for explicit key args, add key input tests
- Replace KEY import in golden.rs with local constant
- Replace KEY import in crypto.rs tests with local TEST_KEY constant
- Add --key to all CLI round-trip tests via cmd_with_key() helper
- Add test_key_file_roundtrip: pack/unpack with --key-file
- Add test_rejects_wrong_key: wrong key causes decryption failure
- Add test_rejects_bad_hex: too-short hex produces clear error
- Add test_rejects_missing_key: pack without key arg fails
- Add test_inspect_without_key: shows header only, not TOC
- Add test_inspect_with_key: shows full entry listing
- All 47 tests pass (25 unit + 7 golden + 15 integration)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 23:53:24 +03:00
NikitolProject
8760981717 test(08-01): add directory round-trip integration tests
- test_roundtrip_directory: full directory tree with permissions verification
- test_roundtrip_mixed_files_and_dirs: mixed file + directory pack/unpack
- test_inspect_shows_directory_info: inspect output contains dir/file types and permissions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 21:48:20 +03:00
NikitolProject
91ee354db6 test(03-02): add CLI round-trip integration tests
- 6 integration tests via assert_cmd: single file, multiple files, empty, Cyrillic filename, 11MB large, APK no-compress
- All tests verify byte-identical extraction (pack -> unpack -> assert_eq)
- Uses tempdir() for isolation and parallel safety
- Uses cargo_bin! macro (non-deprecated assert_cmd API)
- Covers Phase 3 edge cases: 0-byte PKCS7, >10MB file, UTF-8 non-ASCII names

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 00:39:33 +03:00
NikitolProject
329bed6f2b test(03-02): add golden test vectors for crypto primitives
- 7 deterministic tests: AES-256-CBC encrypt/decrypt, empty, HMAC-SHA256, HMAC verify, SHA-256 x2
- Fixed IV vectors for reproducible results (no randomness)
- HMAC golden value cross-verified with openssl (file input) and Python hmac module
- SHA-256 values match FORMAT.md Section 12.3 known vectors

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 00:37:10 +03:00