From 1680dd6aacd6bb81a35da73f03797ac0c8fa8306 Mon Sep 17 00:00:00 2001 From: Lindsay Stewart Date: Mon, 19 Aug 2024 20:37:22 -0700 Subject: [PATCH] Don't enable JA4 tests by default --- .github/workflows/ci_rust.yml | 8 +++++--- tests/pcap/Cargo.toml | 4 ++++ tests/pcap/tests/s2n_client_hellos.rs | 4 +++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci_rust.yml b/.github/workflows/ci_rust.yml index 48e93cd8aa8..3c49b90c9cb 100644 --- a/.github/workflows/ci_rust.yml +++ b/.github/workflows/ci_rust.yml @@ -272,7 +272,7 @@ jobs: run: grep "rust-version = \"$(cat ${{env.ROOT_PATH}}/rust-toolchain)\"" ${{env.ROOT_PATH}}/s2n-tls-tokio/Cargo.toml pcaps: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v3 with: @@ -285,7 +285,9 @@ jobs: rustup override set stable - name: Install tshark - run: sudo apt-get install -y tshark + run: | + sudo apt-get install -y tshark + tshark --version - name: Generate bindings working-directory: ${{env.ROOT_PATH}} @@ -299,4 +301,4 @@ jobs: - name: Run tests working-directory: ${{env.PCAP_TEST_PATH}} - run: cargo test + run: cargo test --all-features diff --git a/tests/pcap/Cargo.toml b/tests/pcap/Cargo.toml index bc5aa1bbc2a..5623b854d1e 100644 --- a/tests/pcap/Cargo.toml +++ b/tests/pcap/Cargo.toml @@ -4,6 +4,10 @@ version = "0.1.0" edition = "2021" publish = false +[features] +default = [] +ja4 = [] # Older versions of tshark do not support JA4 + [dependencies] anyhow = "1.0.86" hex = "0.4.3" diff --git a/tests/pcap/tests/s2n_client_hellos.rs b/tests/pcap/tests/s2n_client_hellos.rs index 8e96c575c6b..0ef8cfe1cad 100644 --- a/tests/pcap/tests/s2n_client_hellos.rs +++ b/tests/pcap/tests/s2n_client_hellos.rs @@ -6,7 +6,6 @@ use pcap::all_pcaps; use pcap::client_hello::ClientHello as PcapHello; use pcap::handshake_message::Builder; use s2n_tls::client_hello::{ClientHello as S2NHello, FingerprintType}; -use s2n_tls::fingerprint; fn get_s2n_hello(pcap_hello: &PcapHello) -> Result> { let bytes = pcap_hello.message().bytes(); @@ -64,8 +63,11 @@ fn ja3_fingerprints() -> Result<()> { }) } +#[cfg(feature = "ja4")] #[test] fn ja4_fingerprints() -> Result<()> { + use s2n_tls::fingerprint; + let mut builder = fingerprint::Builder::new(FingerprintType::JA4)?; test_all_client_hellos(|pcap_hello, s2n_hello| {