Skip to content

Commit

Permalink
Don't enable JA4 tests by default
Browse files Browse the repository at this point in the history
  • Loading branch information
lrstewart committed Aug 20, 2024
1 parent 21d5018 commit 1680dd6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/ci_rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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}}
Expand All @@ -299,4 +301,4 @@ jobs:
- name: Run tests
working-directory: ${{env.PCAP_TEST_PATH}}
run: cargo test
run: cargo test --all-features
4 changes: 4 additions & 0 deletions tests/pcap/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 3 additions & 1 deletion tests/pcap/tests/s2n_client_hellos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Box<S2NHello>> {
let bytes = pcap_hello.message().bytes();
Expand Down Expand Up @@ -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| {
Expand Down

0 comments on commit 1680dd6

Please sign in to comment.