Skip to content

Commit 484afea

Browse files
committed
Make SslCredential optional
1 parent a40cba6 commit 484afea

3 files changed

Lines changed: 11 additions & 1 deletion

File tree

boring/Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,15 @@ pq-experimental = []
3232
# Interface for ML-KEM (FIPS 203) post-quantum key encapsulation. Does not affect ciphers used in TLS.
3333
mlkem = []
3434

35+
# SslCredential API
36+
credential = []
37+
3538
# Enables Raw public key API (https://datatracker.ietf.org/doc/html/rfc7250)
3639
# This feature is necessary in order to compile the bindings for the
3740
# default branch of boringSSL. Alternatively, a version of boringSSL that
3841
# implements the same feature set can be provided by setting
3942
# `BORING_BSSL{,_FIPS}_SOURCE_PATH` and `BORING_BSSL{,_FIPS}_ASSUME_PATCHED`.
40-
rpk = ["boring-sys/rpk"]
43+
rpk = ["credential", "boring-sys/rpk"]
4144

4245
# Applies a patch to enable `ffi::X509_CHECK_FLAG_UNDERSCORE_WILDCARDS`. This
4346
# 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
@@ -109,6 +109,7 @@ pub use self::async_callbacks::{
109109
pub use self::connector::{
110110
ConnectConfiguration, SslAcceptor, SslAcceptorBuilder, SslConnector, SslConnectorBuilder,
111111
};
112+
#[cfg(feature = "credential")]
112113
pub use self::credential::{SslCredential, SslCredentialBuilder, SslCredentialRef};
113114
pub use self::ech::{SslEchKeys, SslEchKeysRef};
114115
pub use self::error::{Error, ErrorCode, HandshakeError};
@@ -117,6 +118,7 @@ mod async_callbacks;
117118
mod bio;
118119
mod callbacks;
119120
mod connector;
121+
#[cfg(feature = "credential")]
120122
mod credential;
121123
mod ech;
122124
mod error;
@@ -2029,6 +2031,7 @@ impl SslContextBuilder {
20292031

20302032
/// Adds a credential.
20312033
#[corresponds(SSL_CTX_add1_credential)]
2034+
#[cfg(feature = "credential")]
20322035
pub fn add_credential(&mut self, credential: &SslCredentialRef) -> Result<(), ErrorStack> {
20332036
unsafe {
20342037
cvt_0i(ffi::SSL_CTX_add1_credential(
@@ -3816,6 +3819,7 @@ impl SslRef {
38163819

38173820
/// Adds a credential.
38183821
#[corresponds(SSL_add1_credential)]
3822+
#[cfg(feature = "credential")]
38193823
pub fn add_credential(&mut self, credential: &SslCredentialRef) -> Result<(), ErrorStack> {
38203824
unsafe { cvt_0i(ffi::SSL_add1_credential(self.as_ptr(), credential.as_ptr())).map(|_| ()) }
38213825
}

0 commit comments

Comments
 (0)