Skip to content

Commit d1077c0

Browse files
committed
Cleanup dependencies and their features.
1 parent 46846cf commit d1077c0

File tree

2 files changed

+11
-14
lines changed

2 files changed

+11
-14
lines changed

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@ publish = false
1111
rust-version = "1.87" # MSRV
1212

1313
[package.metadata.cargo-udeps.ignore]
14-
normal = [ "ntp-proto", "rustls-platform-verifier", "rustls-pemfile2", "rustls23", "serde", "tokio-rustls", "toml", "tracing", "tracing-subscriber" ]
14+
normal = [ "ntp-proto", "rustls-platform-verifier", "rustls-pemfile2", "rustls", "serde", "tokio-rustls", "toml", "tracing", "tracing-subscriber" ]
1515

1616
[dependencies]
1717
tokio = { version = "1.32", features = ["rt-multi-thread", "io-util", "fs", "net", "macros", "time" ] }
1818
toml = { version = ">=0.6.0,<0.9.0", default-features = false, features = ["parse"] }
1919
tracing = "0.1.37"
2020
tracing-subscriber = { version = "0.3.0", default-features = false, features = ["std", "fmt", "ansi"] }
21-
rustls23 = { package = "rustls", version = "0.23.16", features = ["logging", "std", "tls12"] }
21+
rustls = { version = "0.23.16", features = ["logging", "std"] }
2222
rustls-platform-verifier = "0.5.0"
2323
serde = { version = "1.0.145", features = ["derive"] }
24-
tokio-rustls = { version = "0.26.0", features = ["logging", "tls12"] }
24+
tokio-rustls = { version = "0.26.0", features = ["logging"] }
2525

2626
[[bin]]
2727
name = "nts-pool-ke"

src/lib.rs

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
extern crate rustls23 as rustls;
2-
31
mod cli;
42
mod config;
53

@@ -15,8 +13,11 @@ use std::{
1513
use ::tracing::{debug, info};
1614
use cli::NtsPoolKeOptions;
1715
use config::{Config, NtsPoolKeConfig};
18-
use rustls::{pki_types::CertificateDer, version::TLS13, ServerConnection};
19-
use rustls23::pki_types::pem::PemObject;
16+
use rustls::{
17+
pki_types::{pem::PemObject, CertificateDer},
18+
version::TLS13,
19+
ServerConnection,
20+
};
2021
use rustls_platform_verifier::Verifier;
2122
use tokio::{
2223
io::AsyncWriteExt,
@@ -172,23 +173,23 @@ async fn run(options: NtsPoolKeOptions) -> Result<(), Box<dyn std::error::Error>
172173
async fn run_nts_pool_ke(nts_pool_ke_config: NtsPoolKeConfig) -> std::io::Result<()> {
173174
let certificate_authority_file =
174175
std::fs::File::open(&nts_pool_ke_config.certificate_authority_path).map_err(|e| {
175-
io_error(&format!(
176+
std::io::Error::other(format!(
176177
"error reading certificate_authority_path at `{:?}`: {:?}",
177178
nts_pool_ke_config.certificate_authority_path, e
178179
))
179180
})?;
180181

181182
let certificate_chain_file = std::fs::File::open(&nts_pool_ke_config.certificate_chain_path)
182183
.map_err(|e| {
183-
io_error(&format!(
184+
std::io::Error::other(format!(
184185
"error reading certificate_chain_path at `{:?}`: {:?}",
185186
nts_pool_ke_config.certificate_chain_path, e
186187
))
187188
})?;
188189

189190
let private_key_file =
190191
std::fs::File::open(&nts_pool_ke_config.private_key_path).map_err(|e| {
191-
io_error(&format!(
192+
std::io::Error::other(format!(
192193
"error reading key_der_path at `{:?}`: {:?}",
193194
nts_pool_ke_config.private_key_path, e
194195
))
@@ -237,10 +238,6 @@ async fn run_nts_pool_ke(nts_pool_ke_config: NtsPoolKeConfig) -> std::io::Result
237238
.await
238239
}
239240

240-
fn io_error(msg: &str) -> std::io::Error {
241-
std::io::Error::new(std::io::ErrorKind::Other, msg)
242-
}
243-
244241
async fn pool_key_exchange_server(
245242
address: impl ToSocketAddrs,
246243
certificate_authority: Arc<[rustls::pki_types::CertificateDer<'static>]>,

0 commit comments

Comments
 (0)