Skip to content

Commit 3dca192

Browse files
authored
Merge branch 'main' into tls-version-cipher-metadata
2 parents 912f785 + 531b6dd commit 3dca192

28 files changed

Lines changed: 97 additions & 106 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ elided_lifetimes_in_paths = "warn"
6767
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(fuzzing)'] }
6868
unnameable_types = "warn"
6969
unreachable_pub = "warn"
70+
unused_qualifications = "warn"
7071

7172
[workspace.lints.clippy]
7273
manual_let_else = "warn"

bench/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ pub fn configure_tracing_subscriber() {
3030

3131
/// Creates a server endpoint which runs on the given runtime
3232
pub fn server_endpoint(
33-
rt: &tokio::runtime::Runtime,
33+
rt: &Runtime,
3434
cert: CertificateDer<'static>,
3535
key: PrivateKeyDer<'static>,
3636
opt: &Opt,

perf/src/noprotection.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ impl crypto::Session for NoProtectionSession {
131131

132132
impl crypto::ClientConfig for NoProtectionClientConfig {
133133
fn start_session(
134-
self: std::sync::Arc<Self>,
134+
self: Arc<Self>,
135135
version: u32,
136136
server_name: &str,
137137
params: &transport_parameters::TransportParameters,

perf/src/stats.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ impl Stats {
121121
#[cfg(feature = "json-output")]
122122
pub fn print_json(&self, path: &Path) -> io::Result<()> {
123123
if path == Path::new("-") {
124-
json::print(self, std::io::stdout());
124+
json::print(self, io::stdout());
125125
} else {
126126
let file = File::create(path)?;
127127
json::print(self, file)
@@ -281,7 +281,7 @@ mod json {
281281

282282
fn serialize_timestamp<S>(time: &SystemTime, s: S) -> Result<S::Ok, S::Error>
283283
where
284-
S: serde::Serializer,
284+
S: Serializer,
285285
{
286286
use serde::ser::SerializeMap;
287287
let mut state = s.serialize_map(Some(1))?;
@@ -355,7 +355,7 @@ mod json {
355355

356356
impl Stream {
357357
fn from_stream_interval_stats(
358-
stats: &stats::StreamIntervalStats,
358+
stats: &StreamIntervalStats,
359359
period: &stats::IntervalPeriod,
360360
) -> Self {
361361
let bits_per_second = stats.bytes as f64 * 8.0 / period.seconds;

quinn-proto/src/config/transport.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,7 @@ impl From<VarInt> for IdleTimeout {
781781
}
782782
}
783783

784-
impl std::convert::TryFrom<Duration> for IdleTimeout {
784+
impl TryFrom<Duration> for IdleTimeout {
785785
type Error = VarIntBoundsExceeded;
786786

787787
fn try_from(timeout: Duration) -> Result<Self, Self::Error> {

quinn-proto/src/connection/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ impl Connection {
709709
// Clamp the datagram to at most the minimum MTU to ensure that loss probes
710710
// can get through and enable recovery even if the path MTU has shrank
711711
// unexpectedly.
712-
std::cmp::min(segment_size, usize::from(INITIAL_MTU))
712+
cmp::min(segment_size, usize::from(INITIAL_MTU))
713713
}
714714
};
715715
buf_capacity += next_datagram_size_limit;
@@ -3351,7 +3351,7 @@ impl Connection {
33513351
id = %issued.id,
33523352
"NEW_CONNECTION_ID"
33533353
);
3354-
frame::NewConnectionId {
3354+
NewConnectionId {
33553355
sequence: issued.sequence,
33563356
retire_prior_to: self.local_cid_state.retire_prior_to(),
33573357
id: issued.id,
@@ -3515,7 +3515,7 @@ impl Connection {
35153515
negotiate_max_idle_timeout(self.config.max_idle_timeout, Some(params.max_idle_timeout));
35163516
trace!("negotiated max idle timeout {:?}", self.idle_timeout);
35173517
if let Some(ref info) = params.preferred_address {
3518-
self.rem_cids.insert(frame::NewConnectionId {
3518+
self.rem_cids.insert(NewConnectionId {
35193519
sequence: 1,
35203520
id: info.connection_id,
35213521
reset_token: info.stateless_reset_token,

quinn-proto/src/connection/spaces.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ impl Dedup {
568568
type Window = u128;
569569

570570
/// Number of packets tracked by `Dedup`
571-
const WINDOW_SIZE: u64 = 1 + mem::size_of::<Window>() as u64 * 8;
571+
const WINDOW_SIZE: u64 = 1 + size_of::<Window>() as u64 * 8;
572572

573573
/// Indicates which data is available for sending
574574
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
@@ -1097,6 +1097,6 @@ mod test {
10971097
fn sent_packet_size() {
10981098
// The tracking state of sent packets should be minimal, and not grow
10991099
// over time.
1100-
assert!(std::mem::size_of::<SentPacket>() <= 128);
1100+
assert!(size_of::<SentPacket>() <= 128);
11011101
}
11021102
}

quinn-proto/src/crypto/rustls.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ const RETRY_INTEGRITY_NONCE_V1: [u8; 12] = [
235235
0x46, 0x15, 0x99, 0xd3, 0x5d, 0x63, 0x2b, 0xf2, 0x23, 0x98, 0x25, 0xbb,
236236
];
237237

238-
impl crypto::HeaderKey for Box<dyn HeaderProtectionKey> {
238+
impl HeaderKey for Box<dyn HeaderProtectionKey> {
239239
fn decrypt(&self, pn_offset: usize, packet: &mut [u8]) {
240240
let (header, sample) = packet.split_at_mut(pn_offset + 4);
241241
let (first, rest) = header.split_at_mut(1);
@@ -380,7 +380,7 @@ impl crypto::ClientConfig for QuicClientConfig {
380380
version,
381381
got_handshake_data: false,
382382
next_secrets: None,
383-
inner: rustls::quic::Connection::Client(
383+
inner: Connection::Client(
384384
rustls::quic::ClientConnection::new(
385385
self.inner.clone(),
386386
version,
@@ -461,7 +461,7 @@ impl QuicServerConfig {
461461
pub(crate) fn new(
462462
cert_chain: Vec<CertificateDer<'static>>,
463463
key: PrivateKeyDer<'static>,
464-
) -> Result<Self, rustls::Error> {
464+
) -> Result<Self, Error> {
465465
let inner = Self::inner(cert_chain, key)?;
466466
Ok(Self {
467467
// We're confident that the *ring* default provider contains TLS13_AES_128_GCM_SHA256
@@ -492,7 +492,7 @@ impl QuicServerConfig {
492492
pub(crate) fn inner(
493493
cert_chain: Vec<CertificateDer<'static>>,
494494
key: PrivateKeyDer<'static>,
495-
) -> Result<rustls::ServerConfig, rustls::Error> {
495+
) -> Result<rustls::ServerConfig, Error> {
496496
let mut inner = rustls::ServerConfig::builder_with_provider(configured_provider())
497497
.with_protocol_versions(&[&rustls::version::TLS13])
498498
.unwrap() // The *ring* default provider supports TLS 1.3
@@ -536,7 +536,7 @@ impl crypto::ServerConfig for QuicServerConfig {
536536
version,
537537
got_handshake_data: false,
538538
next_secrets: None,
539-
inner: rustls::quic::Connection::Server(
539+
inner: Connection::Server(
540540
rustls::quic::ServerConnection::new(self.inner.clone(), version, to_vec(params))
541541
.unwrap(),
542542
),
@@ -586,9 +586,7 @@ pub(crate) fn initial_suite_from_provider(
586586
.cipher_suites
587587
.iter()
588588
.find_map(|cs| match (cs.suite(), cs.tls13()) {
589-
(rustls::CipherSuite::TLS13_AES_128_GCM_SHA256, Some(suite)) => {
590-
Some(suite.quic_suite())
591-
}
589+
(CipherSuite::TLS13_AES_128_GCM_SHA256, Some(suite)) => Some(suite.quic_suite()),
592590
_ => None,
593591
})
594592
.flatten()

quinn-proto/src/tests/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,7 @@ fn alpn_success() {
839839
.crypto_session()
840840
.handshake_data()
841841
.unwrap()
842-
.downcast::<crate::crypto::rustls::HandshakeData>()
842+
.downcast::<crypto::rustls::HandshakeData>()
843843
.unwrap();
844844
assert_eq!(hd.protocol.unwrap(), &b"bar"[..]);
845845
assert_eq!(

quinn-proto/src/tests/util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,7 @@ fn client_crypto_inner(
646646
certs: Option<Vec<CertificateDer<'static>>>,
647647
alpn: Option<Vec<Vec<u8>>>,
648648
) -> QuicClientConfig {
649-
let mut roots = rustls::RootCertStore::empty();
649+
let mut roots = RootCertStore::empty();
650650
for cert in certs.unwrap_or_else(|| vec![CERTIFIED_KEY.cert.der().clone()]) {
651651
roots.add(cert).unwrap();
652652
}

0 commit comments

Comments
 (0)