Skip to content

Commit 903fe70

Browse files
committed
Allow boring-sys v4
1 parent 5082f79 commit 903fe70

4 files changed

Lines changed: 15 additions & 5 deletions

File tree

Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ members = [
88
resolver = "2"
99

1010
[workspace.package]
11-
version = "5.0.0-alpha.2"
11+
version = "5.0.0"
1212
repository = "https://github.com/cloudflare/boring"
1313
edition = "2021"
1414

@@ -19,9 +19,9 @@ tag-prefix = ""
1919
publish = false
2020

2121
[workspace.dependencies]
22-
boring-sys = { version = "5.0.0-alpha.2", path = "./boring-sys" }
23-
boring = { version = "5.0.0-alpha.2", path = "./boring" }
24-
tokio-boring = { version = "5.0.0-alpha.2", path = "./tokio-boring" }
22+
boring-sys = { version = ">=4.21.1, <6.0.0", path = "./boring-sys" } # Cargo doesn't like prerelease ranges. ok as of "5.0.0"
23+
boring = { version = "5.0.0", path = "./boring" }
24+
tokio-boring = { version = "5.0.0", path = "./tokio-boring" }
2525

2626
bindgen = { version = "0.72.0", default-features = false, features = ["runtime"] }
2727
bitflags = "2.9"

boring/Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ features = ["rpk", "underscore-wildcards"]
1717
rustdoc-args = ["--cfg", "docsrs"]
1818

1919
[features]
20+
# Enable SslCredential (requires boring-sys v5)
21+
credential = []
22+
2023
# Controlling the build
2124

2225
# Use a FIPS-validated version of BoringSSL.
@@ -30,7 +33,7 @@ legacy-compat-deprecated = []
3033
# default branch of boringSSL. Alternatively, a version of boringSSL that
3134
# implements the same feature set can be provided by setting
3235
# `BORING_BSSL{,_FIPS}_SOURCE_PATH` and `BORING_BSSL{,_FIPS}_ASSUME_PATCHED`.
33-
rpk = ["boring-sys/rpk"]
36+
rpk = ["credential", "boring-sys/rpk"]
3437

3538
# Applies a patch to enable `ffi::X509_CHECK_FLAG_UNDERSCORE_WILDCARDS`. This
3639
# feature is necessary in order to compile the bindings for the default branch

boring/src/ssl/async_callbacks.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ use super::{
44
Ssl, SslAlert, SslContextBuilder, SslRef, SslSession, SslSignatureAlgorithm, SslVerifyError,
55
SslVerifyMode,
66
};
7+
#[cfg(feature = "credential")]
78
use crate::error::ErrorStack;
89
use crate::ex_data::Index;
10+
#[cfg(feature = "credential")]
911
use crate::ssl::SslCredentialBuilder;
1012
use std::convert::identity;
1113
use std::future::Future;
@@ -173,6 +175,7 @@ impl SslContextBuilder {
173175
}
174176
}
175177

178+
#[cfg(feature = "credential")]
176179
impl SslCredentialBuilder {
177180
/// Configures a custom private key method on the context.
178181
///

boring/src/ssl/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ pub use self::async_callbacks::{
108108
pub use self::connector::{
109109
ConnectConfiguration, SslAcceptor, SslAcceptorBuilder, SslConnector, SslConnectorBuilder,
110110
};
111+
#[cfg(feature = "credential")]
111112
pub use self::credential::{SslCredential, SslCredentialBuilder, SslCredentialRef};
112113
pub use self::ech::{SslEchKeys, SslEchKeysRef};
113114
pub use self::error::{Error, ErrorCode, HandshakeError};
@@ -116,6 +117,7 @@ mod async_callbacks;
116117
mod bio;
117118
mod callbacks;
118119
mod connector;
120+
#[cfg(feature = "credential")]
119121
mod credential;
120122
mod ech;
121123
mod error;
@@ -2025,6 +2027,7 @@ impl SslContextBuilder {
20252027

20262028
/// Adds a credential.
20272029
#[corresponds(SSL_CTX_add1_credential)]
2030+
#[cfg(feature = "credential")]
20282031
pub fn add_credential(&mut self, credential: &SslCredentialRef) -> Result<(), ErrorStack> {
20292032
unsafe {
20302033
cvt_0i(ffi::SSL_CTX_add1_credential(
@@ -3844,6 +3847,7 @@ impl SslRef {
38443847

38453848
/// Adds a credential.
38463849
#[corresponds(SSL_add1_credential)]
3850+
#[cfg(feature = "credential")]
38473851
pub fn add_credential(&mut self, credential: &SslCredentialRef) -> Result<(), ErrorStack> {
38483852
unsafe { cvt_0i(ffi::SSL_add1_credential(self.as_ptr(), credential.as_ptr())).map(|_| ()) }
38493853
}

0 commit comments

Comments
 (0)