Skip to content

Commit 5f5cf65

Browse files
committed
Feature gate boringssl
1 parent cc22199 commit 5f5cf65

File tree

5 files changed

+20
-13
lines changed

5 files changed

+20
-13
lines changed

bindings/rust/standard/integration/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ no-sensitive-tests = []
1818
# can be disabled by turning off this feature.
1919
pq = [ "s2n-tls/pq" ]
2020

21+
boringssl = ["tls-harness/boringssl"]
22+
2123
[dependencies]
2224
s2n-tls = { path = "../../extended/s2n-tls", features = ["unstable-testing", "unstable-crl"]}
2325
s2n-tls-hyper = { path = "../s2n-tls-hyper" }

bindings/rust/standard/integration/src/mtls/mod.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ use std::{
2727

2828
// NOTE: BoringSSL tests are disabled on macOS to avoid symbol collisions with
2929
// OpenSSL; see https://github.com/aws/s2n-tls/pull/5659 for details.
30-
#[cfg(not(target_os = "macos"))]
30+
#[cfg(all(feature = "boringssl", not(target_os = "macos")))]
3131
use boring::ssl::SslVersion;
3232
use rustls::ClientConfig;
3333

@@ -50,7 +50,7 @@ use tls_harness::{
5050
PemType, SigType, TlsConnPair, TlsConnection,
5151
};
5252

53-
#[cfg(not(target_os = "macos"))]
53+
#[cfg(all(feature = "boringssl", not(target_os = "macos")))]
5454
use tls_harness::cohort::{BoringSslConfig, BoringSslConnection};
5555

5656
const APP_DATA_SIZE: usize = 100_000;
@@ -217,7 +217,7 @@ fn rustls_mtls_server(
217217
server.into()
218218
}
219219

220-
#[cfg(not(target_os = "macos"))]
220+
#[cfg(all(feature = "boringssl", not(target_os = "macos")))]
221221
fn boringssl_mtls_client(sig_type: SigType, version: SslVersion) -> BoringSslConfig {
222222
use tls_harness::harness::{Mode, TlsConfigBuilder};
223223

@@ -248,7 +248,7 @@ fn boringssl_mtls_client(sig_type: SigType, version: SslVersion) -> BoringSslCon
248248
}
249249
}
250250

251-
#[cfg(not(target_os = "macos"))]
251+
#[cfg(all(feature = "boringssl", not(target_os = "macos")))]
252252
fn boringssl_mtls_server(sig_type: SigType, version: SslVersion) -> BoringSslConfig {
253253
use tls_harness::harness::{Mode, TlsConfigBuilder};
254254

@@ -335,7 +335,7 @@ fn rustls_client_basic() {
335335
}
336336

337337
// s2n client, boringssl server
338-
#[cfg(not(target_os = "macos"))]
338+
#[cfg(all(feature = "boringssl", not(target_os = "macos")))]
339339
#[test]
340340
fn boringssl_server_basic() {
341341
// TLS 1.2
@@ -361,7 +361,7 @@ fn boringssl_server_basic() {
361361
}
362362

363363
// boringssl client, s2n server
364-
#[cfg(not(target_os = "macos"))]
364+
#[cfg(all(feature = "boringssl", not(target_os = "macos")))]
365365
#[test]
366366
fn boringssl_client_basic() {
367367
// TLS 1.2
@@ -469,7 +469,7 @@ fn rustls_client_sync_callback() {
469469
}
470470

471471
// s2n client with sync callback, boringssl server
472-
#[cfg(not(target_os = "macos"))]
472+
#[cfg(all(feature = "boringssl", not(target_os = "macos")))]
473473
#[test]
474474
fn boringssl_server_sync_callback() {
475475
// TLS 1.2
@@ -501,7 +501,7 @@ fn boringssl_server_sync_callback() {
501501
}
502502

503503
// boringssl client, s2n server with sync callback
504-
#[cfg(not(target_os = "macos"))]
504+
#[cfg(all(feature = "boringssl", not(target_os = "macos")))]
505505
#[test]
506506
fn boringssl_client_sync_callback() {
507507
// TLS 1.2
@@ -669,7 +669,7 @@ fn rustls_client_async_callback() {
669669
}
670670

671671
// s2n client with async callback, boringssl server
672-
#[cfg(not(target_os = "macos"))]
672+
#[cfg(all(feature = "boringssl", not(target_os = "macos")))]
673673
#[test]
674674
fn boringssl_server_async_callback() {
675675
// TLS 1.2
@@ -703,7 +703,7 @@ fn boringssl_server_async_callback() {
703703
}
704704

705705
// boringssl client, s2n server with async callback
706-
#[cfg(not(target_os = "macos"))]
706+
#[cfg(all(feature = "boringssl", not(target_os = "macos")))]
707707
#[test]
708708
fn boringssl_client_async_callback() {
709709
// TLS 1.2

bindings/rust/standard/tls-harness/Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
[features]
2+
default = []
3+
boringssl = ["dep:boring"]
4+
15
[package]
26
name = "tls-harness"
37
version = "0.1.0"
@@ -14,6 +18,7 @@ rustls-pemfile = "2.2.0"
1418
openssl = { version = "0.10.73", features = ["vendored"] }
1519
openssl-sys = "0.9.109"
1620
byteorder = "1.5.0"
21+
boring = { git = "https://github.com/kaukabrizvi/boring.git", branch = "symbol-prefixing", features = ["prefix-symbols"], optional = true }
1722

1823
brass-aphid-wire-decryption = "0.0.1"
1924
brass-aphid-wire-messages = "0.0.1"

bindings/rust/standard/tls-harness/src/cohort/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ pub mod s2n_tls;
1515

1616
// NOTE: BoringSSL is disabled on macOS to avoid symbol collisions with
1717
// OpenSSL; see https://github.com/aws/s2n-tls/pull/5659 for details.
18-
#[cfg(not(target_os = "macos"))]
18+
#[cfg(all(feature = "boringssl", not(target_os = "macos")))]
1919
pub mod boringssl;
2020

2121
pub use openssl::{OpenSslConfig, OpenSslConnection};
2222
pub use rustls::{RustlsConfig, RustlsConnection};
2323
pub use s2n_tls::{S2NConfig, S2NConnection};
2424

25-
#[cfg(not(target_os = "macos"))]
25+
#[cfg(all(feature = "boringssl", not(target_os = "macos")))]
2626
pub use boringssl::{BoringSslConfig, BoringSslConnection};

nix/shell.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,5 +256,5 @@ function rust_test {(set -e
256256
export S2N_TLS_LIB_DIR=$(pwd)/build/lib
257257
export S2N_TLS_INCLUDE_DIR=$(pwd)/api
258258
echo "rust_test: Running Rust integration tests"
259-
cargo test --manifest-path bindings/rust/standard/integration/Cargo.toml
259+
cargo test --manifest-path bindings/rust/standard/integration/Cargo.toml --features boringssl
260260
)}

0 commit comments

Comments
 (0)