diff --git a/.github/workflows/ci_rust.yml b/.github/workflows/ci_rust.yml index 26340529efc..4ab5916337f 100644 --- a/.github/workflows/ci_rust.yml +++ b/.github/workflows/ci_rust.yml @@ -12,7 +12,10 @@ env: # Pin the nightly toolchain to prevent breakage. # This should be occasionally updated. RUST_NIGHTLY_TOOLCHAIN: nightly-2024-12-01 - ROOT_PATH: bindings/rust + # Extended support MSRV + ROOT_PATH: bindings/rust/extended + # Standard support MSRV + STANDARD_PATH: bindings/rust/standard EXAMPLE_WORKSPACE: bindings/rust-examples PCAP_TEST_PATH: tests/pcap @@ -49,6 +52,11 @@ jobs: working-directory: ${{env.ROOT_PATH}} run: cargo test + # Test the standard workspace + - name: Standard Workspace Tests + working-directory: ${{env.STANDARD_PATH}} + run: cargo test + - name: "Feature Tests: Fingerprint, kTLS, QUIC, and PQ" working-directory: ${{env.ROOT_PATH}} # Test all features except for FIPS, which is tested separately. @@ -59,7 +67,7 @@ jobs: run: cargo test --features unstable-renegotiate - name: Network-enabled integration tests - working-directory: ${{env.ROOT_PATH}}/integration + working-directory: ${{env.STANDARD_PATH}}/integration # no-default-features is used because network tests are hidden behind a # default "negative" feature. This is because we don't want network tests # invoked on the `cargo test --all-features` pattern. @@ -83,7 +91,9 @@ jobs: cd ${{env.ROOT_PATH}} ./generate.sh - ldd target/debug/integration | grep libs2n.so + # Relative paths + cd ../../.. + ldd ${{env.STANDARD_PATH}}/target/debug/integration | grep libs2n.so # our benchmark testing includes interop tests between s2n-tls, rustls, and # openssl @@ -102,7 +112,7 @@ jobs: run: ${{env.ROOT_PATH}}/generate.sh --skip-tests - name: bench tests - working-directory: ${{env.ROOT_PATH}}/bench + working-directory: ${{env.STANDARD_PATH}}/bench run: cargo test s2n-tls-binding-examples: diff --git a/.github/workflows/dependencies.yml b/.github/workflows/dependencies.yml index cc5fd9d2e05..58c54b11bd6 100644 --- a/.github/workflows/dependencies.yml +++ b/.github/workflows/dependencies.yml @@ -18,7 +18,7 @@ on: - cron: "0 18 * * *" env: - ROOT_PATH: bindings/rust + ROOT_PATH: bindings/rust/extended jobs: audit: diff --git a/.github/workflows/regression_ci.yml b/.github/workflows/regression_ci.yml index 0ba35de94c8..6ffd29392af 100644 --- a/.github/workflows/regression_ci.yml +++ b/.github/workflows/regression_ci.yml @@ -14,6 +14,9 @@ on: types: [checks_requested] branches: [main] +env: + ROOT_PATH: bindings/rust/extended + jobs: regression-test: runs-on: ubuntu-latest @@ -54,7 +57,7 @@ jobs: # Generate bindings for main branch - name: Generate bindings (mainline) - run: ${{env.ROOT_PATH}}bindings/rust/generate.sh --skip-tests + run: ${{env.ROOT_PATH}}/generate.sh --skip-tests # Run performance tests using Valgrind for main branch - name: Run scalar performance test (mainline) @@ -68,7 +71,7 @@ jobs: # Generate bindings for PR branch - name: Generate bindings (PR branch) - run: ${{env.ROOT_PATH}}bindings/rust/generate.sh --skip-tests + run: ${{env.ROOT_PATH}}/generate.sh --skip-tests # Run performance tests using Valgrind for PR branch - name: Run scalar performance test (PR branch) diff --git a/bindings/README.md b/bindings/README.md new file mode 100644 index 00000000000..599b5378999 --- /dev/null +++ b/bindings/README.md @@ -0,0 +1,13 @@ +# s2n-tls rust workspaces + +### Rust + +Contains the bindings and other integrations, in two workspaces based on MSRV. + +### Rust Examples + +The current MSRV for the Rust Examples workspace is [stable](https://releases.rs/). + + + + diff --git a/bindings/rust-examples/client-hello-config-resolution/Cargo.toml b/bindings/rust-examples/client-hello-config-resolution/Cargo.toml index 96f59aa1249..94caf6849db 100644 --- a/bindings/rust-examples/client-hello-config-resolution/Cargo.toml +++ b/bindings/rust-examples/client-hello-config-resolution/Cargo.toml @@ -8,6 +8,6 @@ edition.workspace = true [dependencies] clap = { version = "4", features = ["derive"] } -s2n-tls = { path = "../../rust/s2n-tls" } -s2n-tls-tokio = { path = "../../rust/s2n-tls-tokio" } +s2n-tls = { path = "../../rust/extended/s2n-tls" } +s2n-tls-tokio = { path = "../../rust/extended/s2n-tls-tokio" } tokio = { version = "1", features = ["full"] } diff --git a/bindings/rust-examples/tokio-server-client/Cargo.toml b/bindings/rust-examples/tokio-server-client/Cargo.toml index b2fc2d0f397..f573de1768a 100644 --- a/bindings/rust-examples/tokio-server-client/Cargo.toml +++ b/bindings/rust-examples/tokio-server-client/Cargo.toml @@ -7,7 +7,7 @@ license.workspace = true edition.workspace = true [dependencies] -s2n-tls = { path = "../../rust/s2n-tls" } -s2n-tls-tokio = { path = "../../rust/s2n-tls-tokio" } +s2n-tls = { path = "../../rust/extended/s2n-tls" } +s2n-tls-tokio = { path = "../../rust/extended/s2n-tls-tokio" } tokio = { version = "1", features = ["full"] } clap = { version = "4", features = ["derive"] } diff --git a/bindings/rust/README.md b/bindings/rust/README.md index 37ff3ff51ed..d4c223b5175 100644 --- a/bindings/rust/README.md +++ b/bindings/rust/README.md @@ -1,4 +1,4 @@ -# s2n-tls rust bindings +# s2n-tls Rust Bindings **NOTICE: These bindings are currently subject to change and should not be used without the expectation of future breakage.** @@ -17,7 +17,7 @@ In order to generate rust bindings for s2n-tls, you need to have the following i Generating rust bindings can be accomplished by running the `generate.sh` script: ``` -$ ./bindings/rust/generate.sh +$ ./bindings/rust/extended/generate.sh ``` This script generates the low-level bindings in the crate `s2n-tls-sys`, which is used by the `s2n-tls` crate to provide higher-level bindings. @@ -25,7 +25,13 @@ See [s2n-tls-sys](https://github.com/aws/s2n-tls/blob/main/bindings/rust/s2n-tls ## Minimum Supported Rust Version (MSRV) -`s2n-tls` will maintain a rolling MSRV (minimum supported rust version) policy of at least 6 months. The current s2n-quic version is not guaranteed to build on Rust versions earlier than the MSRV. +There are two rust bindings workspaces that have different MSRV policies. Crates in `standard` maintain a rolling MSRV policy of at least 6 months. Crates in `extended` maintain an older MSRV for increased support. -The current MSRV is [1.63.0][msrv-url]. +### Extended + +Crates in the `extended` workspace currently support an "extended" MSRV of [1.63.0](https://releases.rs/docs/1.63.0/). This is a temporary state. Customers must not rely on `s2n-tls` crates maintaining this level of stability. We expect to revert back to the mentioned standard policy shortly. + +### Standard + +We will maintain a rolling MSRV (minimum supported rust version) policy of at least 6 months. The current s2n-tls version is not guaranteed to build on Rust versions earlier than the MSRV. diff --git a/bindings/rust/bench/certs/ecdsa256 b/bindings/rust/bench/certs/ecdsa256 deleted file mode 120000 index 51083f89227..00000000000 --- a/bindings/rust/bench/certs/ecdsa256 +++ /dev/null @@ -1 +0,0 @@ -../../../../tests/pems/permutations/ec_ecdsa_p256_sha256 \ No newline at end of file diff --git a/bindings/rust/bench/certs/ecdsa384 b/bindings/rust/bench/certs/ecdsa384 deleted file mode 120000 index 46bafdb4033..00000000000 --- a/bindings/rust/bench/certs/ecdsa384 +++ /dev/null @@ -1 +0,0 @@ -../../../../tests/pems/permutations/ec_ecdsa_p384_sha384 \ No newline at end of file diff --git a/bindings/rust/bench/certs/readme.md b/bindings/rust/bench/certs/readme.md deleted file mode 100644 index 1f154c74b6f..00000000000 --- a/bindings/rust/bench/certs/readme.md +++ /dev/null @@ -1,9 +0,0 @@ -This folder actually just contains symlinks to the files in s2n-tls/test/pems/permutations - -``` -ln -s ../../../../tests/pems/permutations/ec_ecdsa_p256_sha256 ecdsa256 -ln -s ../../../../tests/pems/permutations/ec_ecdsa_p384_sha384 ecdsa384 -ln -s ../../../../tests/pems/permutations/rsae_pkcs_2048_sha256 rsa2048 -ln -s ../../../../tests/pems/permutations/rsae_pkcs_3072_sha384 rsa3072 -ln -s ../../../../tests/pems/permutations/rsae_pkcs_4096_sha384 rsa4096 -``` diff --git a/bindings/rust/bench/certs/rsa2048 b/bindings/rust/bench/certs/rsa2048 deleted file mode 120000 index b87fbc80028..00000000000 --- a/bindings/rust/bench/certs/rsa2048 +++ /dev/null @@ -1 +0,0 @@ -../../../../tests/pems/permutations/rsae_pkcs_2048_sha256 \ No newline at end of file diff --git a/bindings/rust/bench/certs/rsa3072 b/bindings/rust/bench/certs/rsa3072 deleted file mode 120000 index a168bb3f8a5..00000000000 --- a/bindings/rust/bench/certs/rsa3072 +++ /dev/null @@ -1 +0,0 @@ -../../../../tests/pems/permutations/rsae_pkcs_3072_sha384 \ No newline at end of file diff --git a/bindings/rust/bench/certs/rsa4096 b/bindings/rust/bench/certs/rsa4096 deleted file mode 120000 index 7086e5a73f2..00000000000 --- a/bindings/rust/bench/certs/rsa4096 +++ /dev/null @@ -1 +0,0 @@ -../../../../tests/pems/permutations/rsae_pkcs_4096_sha384 \ No newline at end of file diff --git a/bindings/rust/.clippy.toml b/bindings/rust/extended/.clippy.toml similarity index 100% rename from bindings/rust/.clippy.toml rename to bindings/rust/extended/.clippy.toml diff --git a/bindings/rust/.gitignore b/bindings/rust/extended/.gitignore similarity index 100% rename from bindings/rust/.gitignore rename to bindings/rust/extended/.gitignore diff --git a/bindings/rust/Cargo.toml b/bindings/rust/extended/Cargo.toml similarity index 86% rename from bindings/rust/Cargo.toml rename to bindings/rust/extended/Cargo.toml index 15b00cc7009..9b7a87673a9 100644 --- a/bindings/rust/Cargo.toml +++ b/bindings/rust/extended/Cargo.toml @@ -1,10 +1,8 @@ [workspace] members = [ - "integration", "s2n-tls", "s2n-tls-sys", - "s2n-tls-tokio", - "s2n-tls-hyper", + "s2n-tls-tokio" ] # generate can't be included in the workspace because of a bootstrapping problem # s2n-tls-sys/Cargo.toml (part of the workspace) is generated by diff --git a/bindings/rust/Makefile b/bindings/rust/extended/Makefile similarity index 100% rename from bindings/rust/Makefile rename to bindings/rust/extended/Makefile diff --git a/bindings/rust/extended/certs b/bindings/rust/extended/certs new file mode 120000 index 00000000000..36343b9bb72 --- /dev/null +++ b/bindings/rust/extended/certs @@ -0,0 +1 @@ +../certs \ No newline at end of file diff --git a/bindings/rust/generate.sh b/bindings/rust/extended/generate.sh similarity index 82% rename from bindings/rust/generate.sh rename to bindings/rust/extended/generate.sh index 9949928f1ce..db4201d95e8 100755 --- a/bindings/rust/generate.sh +++ b/bindings/rust/extended/generate.sh @@ -16,21 +16,21 @@ mkdir -p s2n-tls-sys/src/features # we copy the C sources into the `lib` directory so they get published in the # actual crate artifact. cp -r \ - ../../api \ - ../../crypto \ - ../../error \ - ../../stuffer \ - ../../tls \ - ../../utils \ + ../../../api \ + ../../../crypto \ + ../../../error \ + ../../../stuffer \ + ../../../tls \ + ../../../utils \ s2n-tls-sys/lib/ cp -r \ - ../../tests/features \ + ../../../tests/features \ s2n-tls-sys/lib/tests/ cp -r \ - ../../CMakeLists.txt \ - ../../cmake \ + ../../../CMakeLists.txt \ + ../../../cmake \ s2n-tls-sys/lib/ # generate the bindings modules from the copied sources @@ -52,7 +52,7 @@ cargo publish --dry-run --allow-dirty cargo publish --dry-run --allow-dirty --all-features popd -pushd integration +pushd ../standard/integration cargo run popd diff --git a/bindings/rust/generate/Cargo.toml b/bindings/rust/extended/generate/Cargo.toml similarity index 100% rename from bindings/rust/generate/Cargo.toml rename to bindings/rust/extended/generate/Cargo.toml diff --git a/bindings/rust/generate/src/main.rs b/bindings/rust/extended/generate/src/main.rs similarity index 100% rename from bindings/rust/generate/src/main.rs rename to bindings/rust/extended/generate/src/main.rs diff --git a/bindings/rust/rust-toolchain b/bindings/rust/extended/rust-toolchain similarity index 100% rename from bindings/rust/rust-toolchain rename to bindings/rust/extended/rust-toolchain diff --git a/bindings/rust/s2n-tls-sys/README.md b/bindings/rust/extended/s2n-tls-sys/README.md similarity index 100% rename from bindings/rust/s2n-tls-sys/README.md rename to bindings/rust/extended/s2n-tls-sys/README.md diff --git a/bindings/rust/s2n-tls-sys/build.rs b/bindings/rust/extended/s2n-tls-sys/build.rs similarity index 100% rename from bindings/rust/s2n-tls-sys/build.rs rename to bindings/rust/extended/s2n-tls-sys/build.rs diff --git a/bindings/rust/s2n-tls-sys/src/lib.rs b/bindings/rust/extended/s2n-tls-sys/src/lib.rs similarity index 100% rename from bindings/rust/s2n-tls-sys/src/lib.rs rename to bindings/rust/extended/s2n-tls-sys/src/lib.rs diff --git a/bindings/rust/s2n-tls-sys/templates/Cargo.template b/bindings/rust/extended/s2n-tls-sys/templates/Cargo.template similarity index 100% rename from bindings/rust/s2n-tls-sys/templates/Cargo.template rename to bindings/rust/extended/s2n-tls-sys/templates/Cargo.template diff --git a/bindings/rust/s2n-tls-sys/templates/features.template b/bindings/rust/extended/s2n-tls-sys/templates/features.template similarity index 100% rename from bindings/rust/s2n-tls-sys/templates/features.template rename to bindings/rust/extended/s2n-tls-sys/templates/features.template diff --git a/bindings/rust/s2n-tls-sys/tests/s2n_init.rs b/bindings/rust/extended/s2n-tls-sys/tests/s2n_init.rs similarity index 100% rename from bindings/rust/s2n-tls-sys/tests/s2n_init.rs rename to bindings/rust/extended/s2n-tls-sys/tests/s2n_init.rs diff --git a/bindings/rust/s2n-tls-tokio/Cargo.toml b/bindings/rust/extended/s2n-tls-tokio/Cargo.toml similarity index 100% rename from bindings/rust/s2n-tls-tokio/Cargo.toml rename to bindings/rust/extended/s2n-tls-tokio/Cargo.toml diff --git a/bindings/rust/s2n-tls-tokio/README.md b/bindings/rust/extended/s2n-tls-tokio/README.md similarity index 100% rename from bindings/rust/s2n-tls-tokio/README.md rename to bindings/rust/extended/s2n-tls-tokio/README.md diff --git a/bindings/rust/s2n-tls-tokio/src/lib.rs b/bindings/rust/extended/s2n-tls-tokio/src/lib.rs similarity index 100% rename from bindings/rust/s2n-tls-tokio/src/lib.rs rename to bindings/rust/extended/s2n-tls-tokio/src/lib.rs diff --git a/bindings/rust/s2n-tls-tokio/src/task/mod.rs b/bindings/rust/extended/s2n-tls-tokio/src/task/mod.rs similarity index 100% rename from bindings/rust/s2n-tls-tokio/src/task/mod.rs rename to bindings/rust/extended/s2n-tls-tokio/src/task/mod.rs diff --git a/bindings/rust/s2n-tls-tokio/src/task/waker.rs b/bindings/rust/extended/s2n-tls-tokio/src/task/waker.rs similarity index 100% rename from bindings/rust/s2n-tls-tokio/src/task/waker.rs rename to bindings/rust/extended/s2n-tls-tokio/src/task/waker.rs diff --git a/bindings/rust/s2n-tls-tokio/src/task/waker/contract.rs b/bindings/rust/extended/s2n-tls-tokio/src/task/waker/contract.rs similarity index 100% rename from bindings/rust/s2n-tls-tokio/src/task/waker/contract.rs rename to bindings/rust/extended/s2n-tls-tokio/src/task/waker/contract.rs diff --git a/bindings/rust/s2n-tls-tokio/tests/common/mod.rs b/bindings/rust/extended/s2n-tls-tokio/tests/common/mod.rs similarity index 100% rename from bindings/rust/s2n-tls-tokio/tests/common/mod.rs rename to bindings/rust/extended/s2n-tls-tokio/tests/common/mod.rs diff --git a/bindings/rust/s2n-tls-tokio/tests/common/stream.rs b/bindings/rust/extended/s2n-tls-tokio/tests/common/stream.rs similarity index 100% rename from bindings/rust/s2n-tls-tokio/tests/common/stream.rs rename to bindings/rust/extended/s2n-tls-tokio/tests/common/stream.rs diff --git a/bindings/rust/s2n-tls-tokio/tests/common/time.rs b/bindings/rust/extended/s2n-tls-tokio/tests/common/time.rs similarity index 100% rename from bindings/rust/s2n-tls-tokio/tests/common/time.rs rename to bindings/rust/extended/s2n-tls-tokio/tests/common/time.rs diff --git a/bindings/rust/s2n-tls-tokio/tests/handshake.rs b/bindings/rust/extended/s2n-tls-tokio/tests/handshake.rs similarity index 100% rename from bindings/rust/s2n-tls-tokio/tests/handshake.rs rename to bindings/rust/extended/s2n-tls-tokio/tests/handshake.rs diff --git a/bindings/rust/s2n-tls-tokio/tests/send_and_recv.rs b/bindings/rust/extended/s2n-tls-tokio/tests/send_and_recv.rs similarity index 100% rename from bindings/rust/s2n-tls-tokio/tests/send_and_recv.rs rename to bindings/rust/extended/s2n-tls-tokio/tests/send_and_recv.rs diff --git a/bindings/rust/s2n-tls-tokio/tests/shutdown.rs b/bindings/rust/extended/s2n-tls-tokio/tests/shutdown.rs similarity index 100% rename from bindings/rust/s2n-tls-tokio/tests/shutdown.rs rename to bindings/rust/extended/s2n-tls-tokio/tests/shutdown.rs diff --git a/bindings/rust/s2n-tls-tokio/tests/tcp.rs b/bindings/rust/extended/s2n-tls-tokio/tests/tcp.rs similarity index 100% rename from bindings/rust/s2n-tls-tokio/tests/tcp.rs rename to bindings/rust/extended/s2n-tls-tokio/tests/tcp.rs diff --git a/bindings/rust/s2n-tls/Cargo.toml b/bindings/rust/extended/s2n-tls/Cargo.toml similarity index 100% rename from bindings/rust/s2n-tls/Cargo.toml rename to bindings/rust/extended/s2n-tls/Cargo.toml diff --git a/bindings/rust/s2n-tls/README.md b/bindings/rust/extended/s2n-tls/README.md similarity index 100% rename from bindings/rust/s2n-tls/README.md rename to bindings/rust/extended/s2n-tls/README.md diff --git a/bindings/rust/s2n-tls/src/callbacks.rs b/bindings/rust/extended/s2n-tls/src/callbacks.rs similarity index 100% rename from bindings/rust/s2n-tls/src/callbacks.rs rename to bindings/rust/extended/s2n-tls/src/callbacks.rs diff --git a/bindings/rust/s2n-tls/src/callbacks/async_cb.rs b/bindings/rust/extended/s2n-tls/src/callbacks/async_cb.rs similarity index 100% rename from bindings/rust/s2n-tls/src/callbacks/async_cb.rs rename to bindings/rust/extended/s2n-tls/src/callbacks/async_cb.rs diff --git a/bindings/rust/s2n-tls/src/callbacks/client_hello.rs b/bindings/rust/extended/s2n-tls/src/callbacks/client_hello.rs similarity index 100% rename from bindings/rust/s2n-tls/src/callbacks/client_hello.rs rename to bindings/rust/extended/s2n-tls/src/callbacks/client_hello.rs diff --git a/bindings/rust/s2n-tls/src/callbacks/pkey.rs b/bindings/rust/extended/s2n-tls/src/callbacks/pkey.rs similarity index 100% rename from bindings/rust/s2n-tls/src/callbacks/pkey.rs rename to bindings/rust/extended/s2n-tls/src/callbacks/pkey.rs diff --git a/bindings/rust/s2n-tls/src/callbacks/session_ticket.rs b/bindings/rust/extended/s2n-tls/src/callbacks/session_ticket.rs similarity index 100% rename from bindings/rust/s2n-tls/src/callbacks/session_ticket.rs rename to bindings/rust/extended/s2n-tls/src/callbacks/session_ticket.rs diff --git a/bindings/rust/s2n-tls/src/cert_chain.rs b/bindings/rust/extended/s2n-tls/src/cert_chain.rs similarity index 100% rename from bindings/rust/s2n-tls/src/cert_chain.rs rename to bindings/rust/extended/s2n-tls/src/cert_chain.rs diff --git a/bindings/rust/s2n-tls/src/client_hello.rs b/bindings/rust/extended/s2n-tls/src/client_hello.rs similarity index 100% rename from bindings/rust/s2n-tls/src/client_hello.rs rename to bindings/rust/extended/s2n-tls/src/client_hello.rs diff --git a/bindings/rust/s2n-tls/src/config.rs b/bindings/rust/extended/s2n-tls/src/config.rs similarity index 100% rename from bindings/rust/s2n-tls/src/config.rs rename to bindings/rust/extended/s2n-tls/src/config.rs diff --git a/bindings/rust/s2n-tls/src/connection.rs b/bindings/rust/extended/s2n-tls/src/connection.rs similarity index 100% rename from bindings/rust/s2n-tls/src/connection.rs rename to bindings/rust/extended/s2n-tls/src/connection.rs diff --git a/bindings/rust/s2n-tls/src/connection/builder.rs b/bindings/rust/extended/s2n-tls/src/connection/builder.rs similarity index 100% rename from bindings/rust/s2n-tls/src/connection/builder.rs rename to bindings/rust/extended/s2n-tls/src/connection/builder.rs diff --git a/bindings/rust/s2n-tls/src/enums.rs b/bindings/rust/extended/s2n-tls/src/enums.rs similarity index 100% rename from bindings/rust/s2n-tls/src/enums.rs rename to bindings/rust/extended/s2n-tls/src/enums.rs diff --git a/bindings/rust/s2n-tls/src/error.rs b/bindings/rust/extended/s2n-tls/src/error.rs similarity index 100% rename from bindings/rust/s2n-tls/src/error.rs rename to bindings/rust/extended/s2n-tls/src/error.rs diff --git a/bindings/rust/s2n-tls/src/fingerprint.rs b/bindings/rust/extended/s2n-tls/src/fingerprint.rs similarity index 100% rename from bindings/rust/s2n-tls/src/fingerprint.rs rename to bindings/rust/extended/s2n-tls/src/fingerprint.rs diff --git a/bindings/rust/s2n-tls/src/init.rs b/bindings/rust/extended/s2n-tls/src/init.rs similarity index 100% rename from bindings/rust/s2n-tls/src/init.rs rename to bindings/rust/extended/s2n-tls/src/init.rs diff --git a/bindings/rust/s2n-tls/src/lib.rs b/bindings/rust/extended/s2n-tls/src/lib.rs similarity index 100% rename from bindings/rust/s2n-tls/src/lib.rs rename to bindings/rust/extended/s2n-tls/src/lib.rs diff --git a/bindings/rust/s2n-tls/src/pool.rs b/bindings/rust/extended/s2n-tls/src/pool.rs similarity index 100% rename from bindings/rust/s2n-tls/src/pool.rs rename to bindings/rust/extended/s2n-tls/src/pool.rs diff --git a/bindings/rust/s2n-tls/src/renegotiate.rs b/bindings/rust/extended/s2n-tls/src/renegotiate.rs similarity index 100% rename from bindings/rust/s2n-tls/src/renegotiate.rs rename to bindings/rust/extended/s2n-tls/src/renegotiate.rs diff --git a/bindings/rust/s2n-tls/src/security.rs b/bindings/rust/extended/s2n-tls/src/security.rs similarity index 100% rename from bindings/rust/s2n-tls/src/security.rs rename to bindings/rust/extended/s2n-tls/src/security.rs diff --git a/bindings/rust/s2n-tls/src/testing.rs b/bindings/rust/extended/s2n-tls/src/testing.rs similarity index 99% rename from bindings/rust/s2n-tls/src/testing.rs rename to bindings/rust/extended/s2n-tls/src/testing.rs index 4eb74fa396b..cc5da441b4b 100644 --- a/bindings/rust/s2n-tls/src/testing.rs +++ b/bindings/rust/extended/s2n-tls/src/testing.rs @@ -97,7 +97,7 @@ impl Default for CertKeyPair { impl CertKeyPair { /// This is the directory holding all of the pems used for s2n-tls unit tests const TEST_PEMS_PATH: &'static str = - concat!(env!("CARGO_MANIFEST_DIR"), "/../../../tests/pems/"); + concat!(env!("CARGO_MANIFEST_DIR"), "/../../../../tests/pems/"); /// Create a test CertKeyPair /// * `prefix`: The *relative* prefix from the s2n-tls/tests/pems/ folder. diff --git a/bindings/rust/s2n-tls/src/testing/client_hello.rs b/bindings/rust/extended/s2n-tls/src/testing/client_hello.rs similarity index 100% rename from bindings/rust/s2n-tls/src/testing/client_hello.rs rename to bindings/rust/extended/s2n-tls/src/testing/client_hello.rs diff --git a/bindings/rust/s2n-tls/src/testing/resumption.rs b/bindings/rust/extended/s2n-tls/src/testing/resumption.rs similarity index 100% rename from bindings/rust/s2n-tls/src/testing/resumption.rs rename to bindings/rust/extended/s2n-tls/src/testing/resumption.rs diff --git a/bindings/rust/s2n-tls/src/testing/s2n_tls.rs b/bindings/rust/extended/s2n-tls/src/testing/s2n_tls.rs similarity index 100% rename from bindings/rust/s2n-tls/src/testing/s2n_tls.rs rename to bindings/rust/extended/s2n-tls/src/testing/s2n_tls.rs diff --git a/bindings/rust/standard/.gitignore b/bindings/rust/standard/.gitignore new file mode 100644 index 00000000000..2c96eb1b651 --- /dev/null +++ b/bindings/rust/standard/.gitignore @@ -0,0 +1,2 @@ +target/ +Cargo.lock diff --git a/bindings/rust/standard/Cargo.toml b/bindings/rust/standard/Cargo.toml new file mode 100644 index 00000000000..43c1a15aa27 --- /dev/null +++ b/bindings/rust/standard/Cargo.toml @@ -0,0 +1,6 @@ +[workspace] +members = [ + "bench", + "integration", + "s2n-tls-hyper" +] diff --git a/bindings/rust/bench/.gitignore b/bindings/rust/standard/bench/.gitignore similarity index 100% rename from bindings/rust/bench/.gitignore rename to bindings/rust/standard/bench/.gitignore diff --git a/bindings/rust/bench/Cargo.toml b/bindings/rust/standard/bench/Cargo.toml similarity index 85% rename from bindings/rust/bench/Cargo.toml rename to bindings/rust/standard/bench/Cargo.toml index ab4da6cb9d4..bb4d66bb102 100644 --- a/bindings/rust/bench/Cargo.toml +++ b/bindings/rust/standard/bench/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" edition = "2021" [dependencies] -s2n-tls = { path = "../s2n-tls" } +s2n-tls = { path = "../../extended/s2n-tls" } errno = "0.3" libc = "0.2" strum = { version = "0.25", features = ["derive"] } @@ -14,7 +14,7 @@ openssl = { version = "0.10", features = ["vendored"] } [dev-dependencies] criterion = "0.5" -pprof = { version = "0.12", features = ["criterion", "flamegraph"] } +pprof = { version = "0.14", features = ["criterion", "flamegraph"] } # env_logger and log are used to enable logging for rustls, which can help with # debugging interop failures env_logger = "0.10" diff --git a/bindings/rust/bench/README.md b/bindings/rust/standard/bench/README.md similarity index 100% rename from bindings/rust/bench/README.md rename to bindings/rust/standard/bench/README.md diff --git a/bindings/rust/bench/benches/connection_creation.rs b/bindings/rust/standard/bench/benches/connection_creation.rs similarity index 100% rename from bindings/rust/bench/benches/connection_creation.rs rename to bindings/rust/standard/bench/benches/connection_creation.rs diff --git a/bindings/rust/bench/benches/handshake.rs b/bindings/rust/standard/bench/benches/handshake.rs similarity index 100% rename from bindings/rust/bench/benches/handshake.rs rename to bindings/rust/standard/bench/benches/handshake.rs diff --git a/bindings/rust/bench/benches/resumption.rs b/bindings/rust/standard/bench/benches/resumption.rs similarity index 100% rename from bindings/rust/bench/benches/resumption.rs rename to bindings/rust/standard/bench/benches/resumption.rs diff --git a/bindings/rust/bench/benches/throughput.rs b/bindings/rust/standard/bench/benches/throughput.rs similarity index 100% rename from bindings/rust/bench/benches/throughput.rs rename to bindings/rust/standard/bench/benches/throughput.rs diff --git a/bindings/rust/standard/bench/certs/ecdsa256 b/bindings/rust/standard/bench/certs/ecdsa256 new file mode 120000 index 00000000000..49362b6581f --- /dev/null +++ b/bindings/rust/standard/bench/certs/ecdsa256 @@ -0,0 +1 @@ +../../../../../tests/pems/permutations/ec_ecdsa_p256_sha256 \ No newline at end of file diff --git a/bindings/rust/standard/bench/certs/ecdsa384 b/bindings/rust/standard/bench/certs/ecdsa384 new file mode 120000 index 00000000000..e381686215b --- /dev/null +++ b/bindings/rust/standard/bench/certs/ecdsa384 @@ -0,0 +1 @@ +../../../../../tests/pems/permutations/ec_ecdsa_p384_sha384 \ No newline at end of file diff --git a/bindings/rust/standard/bench/certs/readme.md b/bindings/rust/standard/bench/certs/readme.md new file mode 100644 index 00000000000..0cc008d7ca3 --- /dev/null +++ b/bindings/rust/standard/bench/certs/readme.md @@ -0,0 +1,9 @@ +This folder actually just contains symlinks to the files in s2n-tls/test/pems/permutations + +``` +ln -s ../../../../../tests/pems/permutations/ec_ecdsa_p256_sha256 ecdsa256 +ln -s ../../../../../tests/pems/permutations/ec_ecdsa_p384_sha384 ecdsa384 +ln -s ../../../../../tests/pems/permutations/rsae_pkcs_2048_sha256 rsa2048 +ln -s ../../../../../tests/pems/permutations/rsae_pkcs_3072_sha384 rsa3072 +ln -s ../../../../../tests/pems/permutations/rsae_pkcs_4096_sha384 rsa4096 +``` diff --git a/bindings/rust/standard/bench/certs/rsa2048 b/bindings/rust/standard/bench/certs/rsa2048 new file mode 120000 index 00000000000..c1ca5cdf76d --- /dev/null +++ b/bindings/rust/standard/bench/certs/rsa2048 @@ -0,0 +1 @@ +../../../../../tests/pems/permutations/rsae_pkcs_2048_sha256 \ No newline at end of file diff --git a/bindings/rust/standard/bench/certs/rsa3072 b/bindings/rust/standard/bench/certs/rsa3072 new file mode 120000 index 00000000000..09c414fd448 --- /dev/null +++ b/bindings/rust/standard/bench/certs/rsa3072 @@ -0,0 +1 @@ +../../../../../tests/pems/permutations/rsae_pkcs_3072_sha384 \ No newline at end of file diff --git a/bindings/rust/standard/bench/certs/rsa4096 b/bindings/rust/standard/bench/certs/rsa4096 new file mode 120000 index 00000000000..391d9e91841 --- /dev/null +++ b/bindings/rust/standard/bench/certs/rsa4096 @@ -0,0 +1 @@ +../../../../../tests/pems/permutations/rsae_pkcs_4096_sha384 \ No newline at end of file diff --git a/bindings/rust/bench/rust-toolchain b/bindings/rust/standard/bench/rust-toolchain similarity index 100% rename from bindings/rust/bench/rust-toolchain rename to bindings/rust/standard/bench/rust-toolchain diff --git a/bindings/rust/bench/src/harness/io.rs b/bindings/rust/standard/bench/src/harness/io.rs similarity index 100% rename from bindings/rust/bench/src/harness/io.rs rename to bindings/rust/standard/bench/src/harness/io.rs diff --git a/bindings/rust/bench/src/harness/mod.rs b/bindings/rust/standard/bench/src/harness/mod.rs similarity index 100% rename from bindings/rust/bench/src/harness/mod.rs rename to bindings/rust/standard/bench/src/harness/mod.rs diff --git a/bindings/rust/bench/src/lib.rs b/bindings/rust/standard/bench/src/lib.rs similarity index 100% rename from bindings/rust/bench/src/lib.rs rename to bindings/rust/standard/bench/src/lib.rs diff --git a/bindings/rust/bench/src/openssl.rs b/bindings/rust/standard/bench/src/openssl.rs similarity index 100% rename from bindings/rust/bench/src/openssl.rs rename to bindings/rust/standard/bench/src/openssl.rs diff --git a/bindings/rust/bench/src/rustls.rs b/bindings/rust/standard/bench/src/rustls.rs similarity index 100% rename from bindings/rust/bench/src/rustls.rs rename to bindings/rust/standard/bench/src/rustls.rs diff --git a/bindings/rust/bench/src/s2n_tls.rs b/bindings/rust/standard/bench/src/s2n_tls.rs similarity index 100% rename from bindings/rust/bench/src/s2n_tls.rs rename to bindings/rust/standard/bench/src/s2n_tls.rs diff --git a/bindings/rust/standard/certs b/bindings/rust/standard/certs new file mode 120000 index 00000000000..36343b9bb72 --- /dev/null +++ b/bindings/rust/standard/certs @@ -0,0 +1 @@ +../certs \ No newline at end of file diff --git a/bindings/rust/integration/Cargo.toml b/bindings/rust/standard/integration/Cargo.toml similarity index 84% rename from bindings/rust/integration/Cargo.toml rename to bindings/rust/standard/integration/Cargo.toml index 1b61246f104..ae2f19ded2f 100644 --- a/bindings/rust/integration/Cargo.toml +++ b/bindings/rust/standard/integration/Cargo.toml @@ -19,10 +19,10 @@ no-network-tests = [] pq = [] [dependencies] -s2n-tls = { path = "../s2n-tls", features = ["unstable-testing"]} +s2n-tls = { path = "../../extended/s2n-tls", features = ["unstable-testing"]} s2n-tls-hyper = { path = "../s2n-tls-hyper" } -s2n-tls-tokio = { path = "../s2n-tls-tokio" } -s2n-tls-sys = { path = "../s2n-tls-sys" } +s2n-tls-tokio = { path = "../../extended/s2n-tls-tokio" } +s2n-tls-sys = { path = "../../extended/s2n-tls-sys" } [dev-dependencies] tokio = { version = "1", features = ["macros", "test-util"] } diff --git a/bindings/rust/integration/build.rs b/bindings/rust/standard/integration/build.rs similarity index 100% rename from bindings/rust/integration/build.rs rename to bindings/rust/standard/integration/build.rs diff --git a/bindings/rust/integration/src/lib.rs b/bindings/rust/standard/integration/src/lib.rs similarity index 100% rename from bindings/rust/integration/src/lib.rs rename to bindings/rust/standard/integration/src/lib.rs diff --git a/bindings/rust/integration/src/main.rs b/bindings/rust/standard/integration/src/main.rs similarity index 100% rename from bindings/rust/integration/src/main.rs rename to bindings/rust/standard/integration/src/main.rs diff --git a/bindings/rust/integration/src/network/https_client.rs b/bindings/rust/standard/integration/src/network/https_client.rs similarity index 100% rename from bindings/rust/integration/src/network/https_client.rs rename to bindings/rust/standard/integration/src/network/https_client.rs diff --git a/bindings/rust/integration/src/network/mod.rs b/bindings/rust/standard/integration/src/network/mod.rs similarity index 100% rename from bindings/rust/integration/src/network/mod.rs rename to bindings/rust/standard/integration/src/network/mod.rs diff --git a/bindings/rust/integration/src/network/tls_client.rs b/bindings/rust/standard/integration/src/network/tls_client.rs similarity index 100% rename from bindings/rust/integration/src/network/tls_client.rs rename to bindings/rust/standard/integration/src/network/tls_client.rs diff --git a/bindings/rust/standard/rust-toolchain b/bindings/rust/standard/rust-toolchain new file mode 100644 index 00000000000..dc87e8af82f --- /dev/null +++ b/bindings/rust/standard/rust-toolchain @@ -0,0 +1 @@ +1.74.0 diff --git a/bindings/rust/s2n-tls-hyper/Cargo.toml b/bindings/rust/standard/s2n-tls-hyper/Cargo.toml similarity index 63% rename from bindings/rust/s2n-tls-hyper/Cargo.toml rename to bindings/rust/standard/s2n-tls-hyper/Cargo.toml index e14eba69a80..75a95007129 100644 --- a/bindings/rust/s2n-tls-hyper/Cargo.toml +++ b/bindings/rust/standard/s2n-tls-hyper/Cargo.toml @@ -4,7 +4,7 @@ description = "A compatbility crate allowing s2n-tls to be used with the hyper H version = "0.0.1" authors = ["AWS s2n"] edition = "2021" -rust-version = "1.63.0" +rust-version = "1.74.0" repository = "https://github.com/aws/s2n-tls" license = "Apache-2.0" publish = false @@ -13,8 +13,8 @@ publish = false default = [] [dependencies] -s2n-tls = { version = "=0.3.9", path = "../s2n-tls" } -s2n-tls-tokio = { version = "=0.3.9", path = "../s2n-tls-tokio" } +s2n-tls = { version = "=0.3.9", path = "../../extended/s2n-tls" } +s2n-tls-tokio = { version = "=0.3.9", path = "../../extended/s2n-tls-tokio" } hyper = { version = "1" } hyper-util = { version = "0.1", features = ["client-legacy", "tokio", "http1", "http2"] } tower-service = { version = "0.3" } @@ -26,7 +26,3 @@ http-body-util = "0.1" hyper-util = { version = "0.1", features = ["server"] } bytes = "1" -# Newer versions require Rust 1.65, see https://github.com/aws/s2n-tls/issues/4242. -hashbrown = { version = "=0.15.0" } -# Newer versions require Rust 1.70, see https://github.com/aws/s2n-tls/issues/4395. -tokio-util = { version = "=0.7.11" } diff --git a/bindings/rust/s2n-tls-hyper/README.md b/bindings/rust/standard/s2n-tls-hyper/README.md similarity index 100% rename from bindings/rust/s2n-tls-hyper/README.md rename to bindings/rust/standard/s2n-tls-hyper/README.md diff --git a/bindings/rust/s2n-tls-hyper/src/connector.rs b/bindings/rust/standard/s2n-tls-hyper/src/connector.rs similarity index 100% rename from bindings/rust/s2n-tls-hyper/src/connector.rs rename to bindings/rust/standard/s2n-tls-hyper/src/connector.rs diff --git a/bindings/rust/s2n-tls-hyper/src/error.rs b/bindings/rust/standard/s2n-tls-hyper/src/error.rs similarity index 100% rename from bindings/rust/s2n-tls-hyper/src/error.rs rename to bindings/rust/standard/s2n-tls-hyper/src/error.rs diff --git a/bindings/rust/s2n-tls-hyper/src/lib.rs b/bindings/rust/standard/s2n-tls-hyper/src/lib.rs similarity index 100% rename from bindings/rust/s2n-tls-hyper/src/lib.rs rename to bindings/rust/standard/s2n-tls-hyper/src/lib.rs diff --git a/bindings/rust/s2n-tls-hyper/src/stream.rs b/bindings/rust/standard/s2n-tls-hyper/src/stream.rs similarity index 100% rename from bindings/rust/s2n-tls-hyper/src/stream.rs rename to bindings/rust/standard/s2n-tls-hyper/src/stream.rs diff --git a/bindings/rust/s2n-tls-hyper/tests/common/echo.rs b/bindings/rust/standard/s2n-tls-hyper/tests/common/echo.rs similarity index 100% rename from bindings/rust/s2n-tls-hyper/tests/common/echo.rs rename to bindings/rust/standard/s2n-tls-hyper/tests/common/echo.rs diff --git a/bindings/rust/s2n-tls-hyper/tests/common/mod.rs b/bindings/rust/standard/s2n-tls-hyper/tests/common/mod.rs similarity index 100% rename from bindings/rust/s2n-tls-hyper/tests/common/mod.rs rename to bindings/rust/standard/s2n-tls-hyper/tests/common/mod.rs diff --git a/bindings/rust/s2n-tls-hyper/tests/http.rs b/bindings/rust/standard/s2n-tls-hyper/tests/http.rs similarity index 100% rename from bindings/rust/s2n-tls-hyper/tests/http.rs rename to bindings/rust/standard/s2n-tls-hyper/tests/http.rs diff --git a/tests/pcap/Cargo.toml b/tests/pcap/Cargo.toml index bb8f5fce414..04f87f0928b 100644 --- a/tests/pcap/Cargo.toml +++ b/tests/pcap/Cargo.toml @@ -23,5 +23,5 @@ rtshark = "2.9.0" [dev-dependencies] # We want to test against the latest, local version of s2n -s2n-tls-sys = { path = "../../bindings/rust/s2n-tls-sys" } -s2n-tls = { path = "../../bindings/rust/s2n-tls", features = ["unstable-fingerprint"] } +s2n-tls-sys = { path = "../../bindings/rust/extended/s2n-tls-sys" } +s2n-tls = { path = "../../bindings/rust/extended/s2n-tls", features = ["unstable-fingerprint"] }