diff --git a/.github/workflows/macos-build.yml b/.github/workflows/macos-build.yml index e4dbb88..09f15ee 100644 --- a/.github/workflows/macos-build.yml +++ b/.github/workflows/macos-build.yml @@ -2,9 +2,9 @@ name: macOS Build and Test on: push: - branches: [ '*' ] + branches: [ 'main' ] pull_request: - branches: [ '*' ] + branches: [ 'main' ] jobs: macos-build: diff --git a/.github/workflows/ubuntu-build.yml b/.github/workflows/ubuntu-build.yml index f9656bc..6b379fc 100644 --- a/.github/workflows/ubuntu-build.yml +++ b/.github/workflows/ubuntu-build.yml @@ -2,9 +2,9 @@ name: Ubuntu Build and Test on: push: - branches: [ '*' ] + branches: [ 'main' ] pull_request: - branches: [ '*' ] + branches: [ 'main' ] jobs: ubuntu-build: diff --git a/.gitignore b/.gitignore index 22e9f9a..970dd0a 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,4 @@ /rustls-wolfcrypt-provider/Cargo.lock /wolfcrypt-rs/target /wolfcrypt-rs/Cargo.lock -/wolfcrypt-rs/wolfssl-5.7.4-stable/ +/wolfcrypt-rs/wolfssl-*/ diff --git a/README.md b/README.md index 5f349c9..f826852 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,8 @@ provider itself operates independently of `std`. ## Status -This is in an alpha stage, particularly because the Rustls API is not yet stable. -This code currently works with Rustls = 0.23.16. +This is in an alpha stage, particularly because the Rustls API is not yet stable. +This code currently works with Rustls = 0.23.22. ## Repo Structure diff --git a/rustls-wolfcrypt-provider/Cargo.toml b/rustls-wolfcrypt-provider/Cargo.toml index 9c2063d..0216dff 100644 --- a/rustls-wolfcrypt-provider/Cargo.toml +++ b/rustls-wolfcrypt-provider/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" edition = "2021" [dependencies] -rustls = { version = "0.23.18", default-features = false, features = ["tls12"] } +rustls = { version = "0.23.22", default-features = false, features = ["tls12"] } chacha20poly1305 = { version = "0.10", default-features = false, features = ["alloc"] } der = { version = "0.7", default-features = false } ecdsa = { version = "0.16.9", default-features = false, features = ["alloc"] } @@ -16,9 +16,9 @@ sha2 = { version = "0.10", default-features = false } signature = { version = "2", default-features = false } webpki = { package = "rustls-webpki", version = "0.102", features = ["alloc"], default-features = false } foreign-types = { version = "0.5.0", default-features = false } -rustls-pki-types = { version = "1.10.0", default-features = false } -log = { version = "0.4.22", default-features = false } -env_logger = { version = "0.11.5", default-features = false } +rustls-pki-types = { version = "1.11.0", default-features = false } +log = { version = "0.4.25", default-features = false } +env_logger = { version = "0.11.6", default-features = false } wolfcrypt-rs = { path = "../wolfcrypt-rs" } rustls-pemfile = { version = "2.2.0", default-features = false } hex = { version = "0.4.3", default-features = false, features = ["alloc"]} @@ -33,9 +33,9 @@ hex-literal = "0.4.1" [dev-dependencies] rcgen = { version = "0.13" } serial_test = { version = "3.2.0", default-features = false } -tokio = { version = "1.41", features = ["macros", "rt", "net", "io-util", "io-std"], default-features = false } +tokio = { version = "1.43", features = ["macros", "rt", "net", "io-util", "io-std"], default-features = false } webpki-roots = { version = "0.26", default-features = false } -rustls = { version = "0.23.18", features = ["std", "tls12"] } +rustls = { version = "0.23.22", features = ["std", "tls12"] } rustls-pemfile = { version = "2.2.0", default-features = false, features = ["std"]} [features] diff --git a/rustls-wolfcrypt-provider/tests/e2e.rs b/rustls-wolfcrypt-provider/tests/e2e.rs index 9996508..19b3c38 100644 --- a/rustls-wolfcrypt-provider/tests/e2e.rs +++ b/rustls-wolfcrypt-provider/tests/e2e.rs @@ -59,10 +59,10 @@ fn init_thread_pool() { * Starts background job for wolfssl server (localhost:4443). * */ fn start_wolfssl_server(current_dir_string: String, tls_version: &str) -> Child { - if let Err(e) = env::set_current_dir("../wolfcrypt-rs/wolfssl-5.7.4-stable/") { + if let Err(e) = env::set_current_dir("../wolfcrypt-rs/wolfssl-5.7.6-stable/") { panic!("Error changing directory: {}", e); } else { - println!("Changed directory to wolfssl-5.7.4-stable."); + println!("Changed directory to wolfssl-5.7.6-stable."); Command::new("./examples/server/server") .arg("-d") diff --git a/wolfcrypt-rs/Cargo.toml b/wolfcrypt-rs/Cargo.toml index 940b02a..3d1e6df 100644 --- a/wolfcrypt-rs/Cargo.toml +++ b/wolfcrypt-rs/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" std = [] [build-dependencies] -bindgen = "0.70.1" +bindgen = "0.71.1" [profile.release] strip = true diff --git a/wolfcrypt-rs/build.rs b/wolfcrypt-rs/build.rs index e806df9..cbb7a65 100644 --- a/wolfcrypt-rs/build.rs +++ b/wolfcrypt-rs/build.rs @@ -9,7 +9,7 @@ use std::process::Command; fn main() { // We check if the release was already fetched, if not, // we fetch it and setup it. - if fs::metadata("wolfssl-5.7.4-stable").is_err() { + if fs::metadata("wolfssl-5.7.6-stable").is_err() { setup_wolfssl(); } @@ -40,8 +40,8 @@ fn setup_wolfssl() { let output = Command::new("curl") .arg("-L") .arg("-o") - .arg("wolfssl-5.7.4-stable.zip") - .arg("https://github.com/wolfSSL/wolfssl/archive/refs/tags/v5.7.4-stable.zip") + .arg("wolfssl-5.7.6-stable.zip") + .arg("https://github.com/wolfSSL/wolfssl/archive/refs/tags/v5.7.6-stable.zip") .output() .expect("Failed to execute curl command"); @@ -50,7 +50,7 @@ fn setup_wolfssl() { // Step 2: Unzip the downloaded file let output = Command::new("unzip") - .arg("wolfssl-5.7.4-stable.zip") + .arg("wolfssl-5.7.6-stable.zip") .output() .expect("Failed to execute unzip command"); @@ -58,17 +58,17 @@ fn setup_wolfssl() { println!("Unzipping completed successfully."); // Step 3: Remove the ZIP file - if let Err(e) = fs::remove_file("wolfssl-5.7.4-stable.zip") { + if let Err(e) = fs::remove_file("wolfssl-5.7.6-stable.zip") { eprintln!("Error removing ZIP file: {}", e); } else { println!("Removed ZIP file successfully."); } // Step 4: Change the current working directory to the unzipped folder - if let Err(e) = env::set_current_dir("wolfssl-5.7.4-stable") { + if let Err(e) = env::set_current_dir("wolfssl-5.7.6-stable") { eprintln!("Error changing directory: {}", e); } else { - println!("Changed directory to wolfssl-5.7.4-stable."); + println!("Changed directory to wolfssl-5.7.6-stable."); // Step 5: Execute ./autogen.sh let output = Command::new("./autogen.sh") @@ -151,6 +151,6 @@ fn setup_wolfssl() { if let Err(e) = env::set_current_dir("../") { eprintln!("Error changing directory: {}", e); } else { - println!("Changed directory to wolfssl-5.7.4-stable."); + println!("Changed directory to wolfssl-5.7.6-stable."); } } diff --git a/wolfcrypt-rs/src/bindings.rs b/wolfcrypt-rs/src/bindings.rs index f4ba0df..df30230 100644 --- a/wolfcrypt-rs/src/bindings.rs +++ b/wolfcrypt-rs/src/bindings.rs @@ -1,8 +1,13 @@ /* - * These are used to suppress all the errors that rust complains - * about our symbols and/or macro (since they don't follow rust's style - * convention). - * */ + * Allow attributes to suppress warnings in bindgen-generated code. + * These warnings arise from: + * - Naming conventions that don't match Rust style (e.g. from C symbols) + * - Auto-generated unsafe code patterns + * - Type/casting patterns common in C FFI but discouraged in pure Rust + * + * Since this code is auto-generated, these warnings cannot be fixed manually + * and must be suppressed. + */ #![allow(dead_code)] #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] @@ -11,4 +16,6 @@ #![allow(clippy::upper_case_acronyms)] #![allow(clippy::too_many_arguments)] #![allow(improper_ctypes)] +#![allow(clippy::missing_safety_doc)] +#![allow(clippy::ptr_offset_with_cast)] include!(concat!(env!("OUT_DIR"), "/bindings.rs"));