Skip to content

Commit 77144d6

Browse files
committed
chore(tls): Remove ring as crypto backend
The broader ecosystem has mostly moved to aws-lc-rs as the primary rustls backend, and we should follow suit. This will also simplify the maintenance of the proxy's TLS implementation in the long term. There will need to be some refactoring to clean up the rustls provider interfaces, but that will come in follow-ups. Signed-off-by: Scott Fleener <[email protected]>
1 parent d46e7c0 commit 77144d6

File tree

9 files changed

+13
-104
lines changed

9 files changed

+13
-104
lines changed

Cargo.lock

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3753,7 +3753,6 @@ dependencies = [
37533753
"aws-lc-rs",
37543754
"log",
37553755
"once_cell",
3756-
"ring",
37573756
"rustls-pki-types",
37583757
"rustls-webpki",
37593758
"subtle",

deny.toml

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,6 @@ allow = [
2323
private = { ignore = true }
2424
confidence-threshold = 0.8
2525
exceptions = [
26-
{ allow = [
27-
"ISC",
28-
"MIT",
29-
"OpenSSL",
30-
], name = "ring", version = "*" },
3126
{ allow = [
3227
"ISC",
3328
"OpenSSL",
@@ -38,14 +33,6 @@ exceptions = [
3833
], name = "aws-lc-fips-sys", version = "*" },
3934
]
4035

41-
[[licenses.clarify]]
42-
name = "ring"
43-
version = "*"
44-
expression = "MIT AND ISC AND OpenSSL"
45-
license-files = [
46-
{ path = "LICENSE", hash = 0xbd0eed23 },
47-
]
48-
4936
[bans]
5037
multiple-versions = "deny"
5138
# Wildcard dependencies are used for all workspace-local crates.
@@ -55,6 +42,8 @@ deny = [
5542
{ name = "rustls", wrappers = ["tokio-rustls"] },
5643
# rustls-webpki should be used instead.
5744
{ name = "webpki" },
45+
# aws-lc-rs should be used instead.
46+
{ name = "ring" }
5847
]
5948
skip = [
6049
# `linkerd-trace-context`, `rustls-pemfile` and `tonic` depend on `base64`

linkerd/meshtls/Cargo.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ publish = { workspace = true }
88

99
[features]
1010
rustls = ["linkerd-meshtls-rustls", "__has_any_tls_impls"]
11-
rustls-aws-lc = ["rustls", "linkerd-meshtls-rustls/aws-lc"]
12-
rustls-aws-lc-fips = ["rustls-aws-lc", "linkerd-meshtls-rustls/aws-lc-fips"]
13-
rustls-ring = ["rustls", "linkerd-meshtls-rustls/ring"]
11+
rustls-fips = ["linkerd-meshtls-rustls/fips"]
1412
boring = ["linkerd-meshtls-boring", "__has_any_tls_impls"]
1513
boring-fips = ["boring", "linkerd-meshtls-boring/fips"]
1614
# Enabled if *any* TLS impl is enabled.

linkerd/meshtls/rustls/Cargo.toml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,16 @@ edition = "2018"
77
publish = { workspace = true }
88

99
[features]
10-
default = ["aws-lc"]
11-
ring = ["tokio-rustls/ring", "rustls-webpki/ring"]
12-
aws-lc = ["tokio-rustls/aws-lc-rs", "rustls-webpki/aws-lc-rs"]
13-
aws-lc-fips = ["aws-lc", "tokio-rustls/fips"]
10+
fips = ["tokio-rustls/fips"]
1411
test-util = ["linkerd-tls-test-util"]
1512

1613
[dependencies]
1714
futures = { version = "0.3", default-features = false }
1815
rustls-pemfile = "2.2"
19-
rustls-webpki = { version = "0.103.4", default-features = false, features = ["std"] }
16+
rustls-webpki = { version = "0.103.4", default-features = false, features = ["std", "aws-lc-rs"] }
2017
thiserror = "2"
2118
tokio = { version = "1", features = ["macros", "rt", "sync"] }
22-
tokio-rustls = { workspace = true }
19+
tokio-rustls = { workspace = true, features = ["aws-lc-rs"] }
2320
tracing = { workspace = true }
2421

2522
linkerd-dns-name = { path = "../../dns/name" }
Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,3 @@
1-
#[cfg(all(feature = "aws-lc", feature = "ring"))]
2-
compile_error!(
3-
"Multiple rustls backends enabled. Enabled one of the \"ring\" or \"aws-lc\" features"
4-
);
5-
#[cfg(not(any(feature = "aws-lc", feature = "ring")))]
6-
compile_error!("No rustls backend enabled. Enabled one of the \"ring\" or \"aws-lc\" features");
1+
pub use aws_lc::{default_provider, SUPPORTED_SIG_ALGS, TLS_SUPPORTED_CIPHERSUITES};
72

8-
#[cfg(feature = "aws-lc")]
93
mod aws_lc;
10-
#[cfg(feature = "ring")]
11-
mod ring;
12-
13-
#[cfg(feature = "aws-lc")]
14-
pub use aws_lc::{default_provider, SUPPORTED_SIG_ALGS, TLS_SUPPORTED_CIPHERSUITES};
15-
#[cfg(feature = "ring")]
16-
pub use ring::{default_provider, SUPPORTED_SIG_ALGS, TLS_SUPPORTED_CIPHERSUITES};

linkerd/meshtls/rustls/src/backend/aws_lc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ use tokio_rustls::rustls::{
44
crypto::{aws_lc_rs, WebPkiSupportedAlgorithms},
55
};
66

7-
#[cfg(not(feature = "aws-lc-fips"))]
7+
#[cfg(not(feature = "fips"))]
88
pub static TLS_SUPPORTED_CIPHERSUITES: &[rustls::SupportedCipherSuite] = &[
99
aws_lc_rs::cipher_suite::TLS13_AES_128_GCM_SHA256,
1010
aws_lc_rs::cipher_suite::TLS13_AES_256_GCM_SHA384,
1111
aws_lc_rs::cipher_suite::TLS13_CHACHA20_POLY1305_SHA256,
1212
];
1313
// Prefer aes-256-gcm if fips is enabled
14-
#[cfg(feature = "aws-lc-fips")]
14+
#[cfg(feature = "fips")]
1515
pub static TLS_SUPPORTED_CIPHERSUITES: &[rustls::SupportedCipherSuite] = &[
1616
aws_lc_rs::cipher_suite::TLS13_AES_256_GCM_SHA384,
1717
aws_lc_rs::cipher_suite::TLS13_AES_128_GCM_SHA256,

linkerd/meshtls/rustls/src/backend/ring.rs

Lines changed: 0 additions & 55 deletions
This file was deleted.

linkerd2-proxy/Cargo.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@ publish = { workspace = true }
88
description = "The main proxy executable"
99

1010
[features]
11-
default = ["meshtls-rustls-aws-lc"]
11+
default = ["meshtls-rustls"]
1212
meshtls-boring = ["linkerd-meshtls/boring"]
1313
meshtls-boring-fips = ["linkerd-meshtls/boring-fips"]
14-
meshtls-rustls-aws-lc = ["linkerd-meshtls/rustls-aws-lc"]
15-
meshtls-rustls-aws-lc-fips = ["linkerd-meshtls/rustls-aws-lc-fips"]
16-
meshtls-rustls-ring = ["linkerd-meshtls/rustls-ring"]
14+
meshtls-rustls = ["linkerd-meshtls/rustls"]
15+
meshtls-rustls-fips = ["linkerd-meshtls/rustls-fips"]
1716
log-streaming = ["linkerd-app/log-streaming"]
1817
pprof = ["linkerd-app/pprof"]
1918
# From https://github.com/polarsignals/rust-jemalloc-pprof/blob/bcf1ad7f7ad3ec8e71098f4d5a9ce55905c7a602/README.md#usage

linkerd2-proxy/src/main.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,7 @@
66

77
// Emit a compile-time error if no TLS implementations are enabled. When adding
88
// new implementations, add their feature flags here!
9-
#[cfg(not(any(
10-
feature = "meshtls-boring",
11-
feature = "meshtls-rustls-ring",
12-
feature = "meshtls-rustls-aws-lc",
13-
feature = "meshtls-rustls-aws-lc-fips"
14-
)))]
9+
#[cfg(not(any(feature = "meshtls-boring", feature = "meshtls-rustls",)))]
1510
compile_error!(
1611
"at least one of the following TLS implementations must be enabled: 'meshtls-boring', 'meshtls-rustls'"
1712
);

0 commit comments

Comments
 (0)