diff --git a/Cargo.lock b/Cargo.lock index d381043..c535f8d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -30,6 +30,12 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f1f227452a390804cdb637b74a86990f2a7d7ba4b7d5693aac9b4dd6defd8d6" +[[package]] +name = "forensic-testgate" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88996536dec2f0de4cd137f4ad0e0c0009f65df58e54e27c11f741b0887ff10c" + [[package]] name = "forensic-vfs" version = "0.3.0" @@ -192,6 +198,7 @@ checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" name = "vhd-core" version = "0.1.3" dependencies = [ + "forensic-testgate", "forensic-vfs", "tempfile", "thiserror", diff --git a/core/Cargo.toml b/core/Cargo.toml index 6cb0bb9..4b8fe09 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -30,6 +30,7 @@ thiserror = { workspace = true } forensic-vfs = { version = "0.3", optional = true } [dev-dependencies] +forensic-testgate = "0.1" tempfile = { workspace = true } [lints] diff --git a/core/tests/corpus.rs b/core/tests/corpus.rs index f06bf7c..2442b27 100644 --- a/core/tests/corpus.rs +++ b/core/tests/corpus.rs @@ -1,19 +1,13 @@ #![allow(clippy::unwrap_used, clippy::expect_used)] +use forensic_testgate::gated_file; use std::io::{Read, Seek, SeekFrom}; -use std::path::PathBuf; use vhd::VhdReader; -fn corpus_dir() -> Option { - std::env::var("CORPUS_DIR").ok().map(PathBuf::from) -} - #[test] fn corpus_dynamic_vhd_opens_and_has_nonzero_size() { - let Some(dir) = corpus_dir() else { return }; - let path = dir.join("dynamic.vhd"); - if !path.exists() { + let Some(path) = gated_file("CORPUS_DIR", "dynamic.vhd") else { return; - } + }; let reader = VhdReader::open(&path).expect("open dynamic.vhd"); assert!( reader.virtual_disk_size() > 0, @@ -23,11 +17,9 @@ fn corpus_dynamic_vhd_opens_and_has_nonzero_size() { #[test] fn corpus_dynamic_vhd_read_is_stable() { - let Some(dir) = corpus_dir() else { return }; - let path = dir.join("dynamic.vhd"); - if !path.exists() { + let Some(path) = gated_file("CORPUS_DIR", "dynamic.vhd") else { return; - } + }; let mut reader = VhdReader::open(&path).expect("open"); let mut buf = [0u8; 512]; reader.seek(SeekFrom::Start(0)).expect("seek"); @@ -40,11 +32,9 @@ fn corpus_dynamic_vhd_read_is_stable() { #[test] fn corpus_fixed_vhd_opens_and_has_nonzero_size() { - let Some(dir) = corpus_dir() else { return }; - let path = dir.join("fixed.vhd"); - if !path.exists() { + let Some(path) = gated_file("CORPUS_DIR", "fixed.vhd") else { return; - } + }; let reader = VhdReader::open(&path).expect("open fixed.vhd"); assert!( reader.virtual_disk_size() > 0, diff --git a/supply-chain/audits.toml b/supply-chain/audits.toml index 168e1c7..3faa4d0 100644 --- a/supply-chain/audits.toml +++ b/supply-chain/audits.toml @@ -3,6 +3,12 @@ [audits] +[[trusted.forensic-testgate]] +criteria = "safe-to-deploy" +user-id = 347968 # Albert Hui (h4x0r) +start = "2026-08-02" +end = "2027-08-05" + [[trusted.forensic-vfs]] criteria = "safe-to-deploy" user-id = 347968 # Albert Hui (h4x0r) diff --git a/supply-chain/imports.lock b/supply-chain/imports.lock index c6f0231..f5299fa 100644 --- a/supply-chain/imports.lock +++ b/supply-chain/imports.lock @@ -1,6 +1,13 @@ # cargo-vet imports lock +[[publisher.forensic-testgate]] +version = "0.1.0" +when = "2026-08-02" +user-id = 347968 +user-login = "h4x0r" +user-name = "Albert Hui" + [[publisher.forensic-vfs]] version = "0.3.0" when = "2026-07-16"