Skip to content

Commit ed56d2c

Browse files
committed
feat: Removal of rpk support
1 parent 5d33987 commit ed56d2c

File tree

8 files changed

+5
-412
lines changed

8 files changed

+5
-412
lines changed

boring-sys/Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,6 @@ fips = []
6161
# Link with precompiled FIPS-validated `bcm.o` module.
6262
fips-link-precompiled = []
6363

64-
# Enables Raw public key API (https://datatracker.ietf.org/doc/html/rfc7250)
65-
rpk = []
66-
6764
# Applies a patch (`patches/boring-pq.patch`) to the boringSSL source code that
6865
# enables support for PQ key exchange. This feature is necessary in order to
6966
# compile the bindings for the default branch of boringSSL (`deps/boringssl`).

boring/Cargo.toml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,6 @@ fips-compat = []
3030
# Link with precompiled FIPS-validated `bcm.o` module.
3131
fips-link-precompiled = ["boring-sys/fips-link-precompiled"]
3232

33-
# Enables Raw public key API (https://datatracker.ietf.org/doc/html/rfc7250)
34-
# This feature is necessary in order to compile the bindings for the
35-
# default branch of boringSSL. Alternatively, a version of boringSSL that
36-
# implements the same feature set can be provided by setting
37-
# `BORING_BSSL{,_FIPS}_SOURCE_PATH` and `BORING_BSSL{,_FIPS}_ASSUME_PATCHED`.
38-
rpk = ["boring-sys/rpk"]
39-
4033
# Applies a patch to the boringSSL source code that enables support for PQ key
4134
# exchange. This feature is necessary in order to compile the bindings for the
4235
# default branch of boringSSL. Alternatively, a version of boringSSL that

boring/src/lib.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,6 @@
6363
//!
6464
//! # Optional patches
6565
//!
66-
//! ## Raw Public Key
67-
//!
68-
//! The crate can be compiled with [RawPublicKey](https://datatracker.ietf.org/doc/html/rfc7250)
69-
//! support by turning on `rpk` compilation feature.
70-
//!
7166
//! ## Experimental post-quantum cryptography
7267
//!
7368
//! The crate can be compiled with [post-quantum cryptography](https://blog.cloudflare.com/post-quantum-for-all/)

boring/src/ssl/connector.rs

Lines changed: 3 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,13 @@ ssbzSibBsu/6iGtCOGEoXJf//////////wIBAg==
2424
";
2525

2626
enum ContextType {
27-
WithMethod(SslMethod),
28-
#[cfg(feature = "rpk")]
29-
Rpk,
27+
WithMethod(SslMethod)
3028
}
3129

3230
#[allow(clippy::inconsistent_digit_grouping)]
3331
fn ctx(ty: ContextType) -> Result<SslContextBuilder, ErrorStack> {
3432
let mut ctx = match ty {
35-
ContextType::WithMethod(method) => SslContextBuilder::new(method),
36-
#[cfg(feature = "rpk")]
37-
ContextType::Rpk => SslContextBuilder::new_rpk(),
33+
ContextType::WithMethod(method) => SslContextBuilder::new(method)
3834
}?;
3935

4036
let mut opts = SslOptions::ALL
@@ -99,17 +95,6 @@ impl SslConnector {
9995
Ok(SslConnectorBuilder(ctx))
10096
}
10197

102-
/// Creates a new builder for TLS connections with raw public key.
103-
#[cfg(feature = "rpk")]
104-
pub fn rpk_builder() -> Result<SslConnectorBuilder, ErrorStack> {
105-
let mut ctx = ctx(ContextType::Rpk)?;
106-
ctx.set_cipher_list(
107-
"DEFAULT:!aNULL:!eNULL:!MD5:!3DES:!DES:!RC4:!IDEA:!SEED:!aDSS:!SRP:!PSK",
108-
)?;
109-
110-
Ok(SslConnectorBuilder(ctx))
111-
}
112-
11398
/// Initiates a client-side TLS session on a stream.
11499
///
115100
/// The domain is used for SNI and hostname verification.
@@ -231,13 +216,7 @@ impl ConnectConfiguration {
231216
self.ssl.set_hostname(domain)?;
232217
}
233218

234-
#[cfg(feature = "rpk")]
235-
let verify_hostname = !self.ssl.ssl_context().is_rpk() && self.verify_hostname;
236-
237-
#[cfg(not(feature = "rpk"))]
238-
let verify_hostname = self.verify_hostname;
239-
240-
if verify_hostname {
219+
if self.verify_hostname {
241220
setup_verify_hostname(&mut self.ssl, domain)?;
242221
}
243222

@@ -299,21 +278,6 @@ impl DerefMut for ConnectConfiguration {
299278
pub struct SslAcceptor(SslContext);
300279

301280
impl SslAcceptor {
302-
/// Creates a new builder configured to connect to clients that support Raw Public Keys.
303-
#[cfg(feature = "rpk")]
304-
pub fn rpk() -> Result<SslAcceptorBuilder, ErrorStack> {
305-
let mut ctx = ctx(ContextType::Rpk)?;
306-
ctx.set_options(SslOptions::NO_TLSV1 | SslOptions::NO_TLSV1_1);
307-
let dh = Dh::params_from_pem(FFDHE_2048.as_bytes())?;
308-
ctx.set_tmp_dh(&dh)?;
309-
ctx.set_cipher_list(
310-
"ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:\
311-
ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:\
312-
DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384"
313-
)?;
314-
Ok(SslAcceptorBuilder(ctx))
315-
}
316-
317281
/// Creates a new builder configured to connect to non-legacy clients. This should generally be
318282
/// considered a reasonable default choice.
319283
///

boring/src/ssl/error.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -200,12 +200,6 @@ fn fmt_mid_handshake_error(
200200
f: &mut fmt::Formatter,
201201
prefix: &str,
202202
) -> fmt::Result {
203-
#[cfg(feature = "rpk")]
204-
if s.ssl().ssl_context().is_rpk() {
205-
write!(f, "{}", prefix)?;
206-
return write!(f, " {}", s.error());
207-
}
208-
209203
match s.ssl().verify_result() {
210204
// INVALID_CALL is returned if no verification took place,
211205
// such as before a cert is sent.

0 commit comments

Comments
 (0)