Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix QUIC compilation and FIPS features #10

Merged
merged 1 commit into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions boring-rustls-provider/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ default = ["tls12"]
# Use a FIPS-validated version of boringssl.
fips = ["boring/fips", "boring-sys/fips"]
logging = ["log"]
fips-only = []
fips-only = ["boring/fips", "boring-sys/fips"]
tls12 = ["rustls/tls12"]


[dependencies]
aead = {version = "0.5", default_features = false, features = ["alloc"] }
boring = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion boring-rustls-provider/src/aead.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pub(crate) trait BoringCipher {
fn extract_keys(key: cipher::AeadKey, iv: cipher::Iv) -> ConnectionTrafficSecrets;
}

pub(crate) trait QuicCipher {
pub(crate) trait QuicCipher: Send + Sync {
/// The key size in bytes
const KEY_SIZE: usize;

Expand Down
2 changes: 1 addition & 1 deletion boring-rustls-provider/src/helper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ pub(crate) fn log_and_map<E: core::fmt::Display, T>(func: &'static str, e: E, ma
}

#[cfg(not(feature = "log"))]
pub(crate) fn log_and_map<E: core::fmt::Display, T>(func: &'static str, e: E, mapped: T) -> T {
pub(crate) fn log_and_map<E: core::fmt::Display, T>(_func: &'static str, _e: E, mapped: T) -> T {
mapped
}
12 changes: 12 additions & 0 deletions boring-rustls-provider/tests/e2e.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,18 @@ async fn test_tls13_crypto() {
}
}

#[test]
#[cfg(any(feature = "fips", feature = "fips-only"))]
fn is_fips_enabled() {
assert!(boring::fips::enabled());
}

#[test]
#[cfg(not(any(feature = "fips", feature = "fips-only")))]
fn is_fips_disabled() {
assert!(!boring::fips::enabled());
}

#[tokio::test]
async fn test_tls12_ec_crypto() {
let pki = TestPki::new(&rcgen::PKCS_ECDSA_P256_SHA256);
Expand Down
Loading