keyhog-core 0.5.44

keyhog-core: shared data model and detector specifications for the KeyHog secret scanner
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! Migrated from `src/merkle_index.rs` inline tests.
use std::path::Path;
fn sample_hash(s: &[u8]) -> [u8; 32] {
    keyhog_core::testing::CoreTestApi::merkle_hash_content(&keyhog_core::testing::TestApi, s)
}
#[test]
fn unknown_path_is_changed() {
    let idx = keyhog_core::testing::CoreTestApi::merkle_empty(&keyhog_core::testing::TestApi);
    let h = sample_hash(b"x");
    assert!(!keyhog_core::testing::CoreTestApi::merkle_unchanged(
        &keyhog_core::testing::TestApi,
        &idx,
        Path::new("/never/seen"),
        &h
    ));
}