diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index d67ac11..03ead71 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -10,10 +10,10 @@ env: CARGO_TERM_COLOR: always jobs: - build: + build: + name: Build and test runs-on: ubuntu-latest - steps: - uses: actions/checkout@v3 - id: rustcache @@ -31,3 +31,10 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} args: --all-features + + semver: + name: Check semantic version compatibility + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: obi1kenobi/cargo-semver-checks-action@v2 \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml index c0b6053..717e195 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rust_jarm" -version = "0.3.2" +version = "0.3.3" authors = ["Hugo-C"] edition = "2021" license = "MIT" @@ -14,10 +14,10 @@ exclude = [ # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -pnet = "^0.33" +pnet = "^0.34" hex = "^0.4" rand = "^0.8" sha2 = "^0.10" [dev-dependencies] -rstest = "~0.16.0" \ No newline at end of file +rstest = "~0.18.1" \ No newline at end of file diff --git a/src/lib.rs b/src/lib.rs index aded56a..c6f8505 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -316,7 +316,6 @@ pub fn pack_as_unsigned_short(n: usize) -> Vec { } pub fn get_ciphers(jarm_details: &PacketSpecification, rng: &dyn JarmRng) -> Vec { - // TODO implement all let mut selected_ciphers = Vec::new(); let mut list = match jarm_details.cipher_list { diff --git a/tests/test_jarm.rs b/tests/test_jarm.rs index 60bc8b5..129158d 100644 --- a/tests/test_jarm.rs +++ b/tests/test_jarm.rs @@ -368,6 +368,24 @@ mod tests { assert_eq!(packet, expected_alpns); } + #[test] + fn test_cipher_mung_forward() { + let mut input_ciphers = vec![ + b"\x08http/0.9".to_vec(), + b"\x08http/1.0".to_vec(), + b"\x08http/1.1".to_vec(), + b"\x06spdy/1".to_vec(), + b"\x06spdy/2".to_vec(), + b"\x06spdy/3\x02h2".to_vec(), + b"\x03h2c".to_vec(), + b"\x02hq".to_vec(), + ]; + let original = input_ciphers.clone(); + + rust_jarm::cipher_mung(&mut input_ciphers, &CipherOrder::FORWARD); + assert_eq!(input_ciphers, original); // Nothing changed for Forward order + } + #[test] fn test_cipher_mung_reverse() { let mut input_ciphers = vec![