mirror of https://github.com/ctz/rustls
quic: adhere to naming conventions
This commit is contained in:
parent
11f86d3329
commit
b16ac0d0c7
|
@ -713,7 +713,7 @@ fn exec(opts: &Options, mut sess: ClientOrServer, count: usize) {
|
|||
.is_empty()
|
||||
{
|
||||
let their_transport_params = sess
|
||||
.get_quic_transport_parameters()
|
||||
.quic_transport_parameters()
|
||||
.expect("missing peer quic transport params");
|
||||
assert_eq!(opts.expect_quic_transport_params, their_transport_params);
|
||||
}
|
||||
|
|
|
@ -684,7 +684,7 @@ impl PlaintextSink for ClientConnection {
|
|||
|
||||
#[cfg(feature = "quic")]
|
||||
impl quic::QuicExt for ClientConnection {
|
||||
fn get_quic_transport_parameters(&self) -> Option<&[u8]> {
|
||||
fn quic_transport_parameters(&self) -> Option<&[u8]> {
|
||||
self.common
|
||||
.quic
|
||||
.params
|
||||
|
@ -692,7 +692,7 @@ impl quic::QuicExt for ClientConnection {
|
|||
.map(|v| v.as_ref())
|
||||
}
|
||||
|
||||
fn get_0rtt_keys(&self) -> Option<quic::DirectionalKeys> {
|
||||
fn zero_rtt_keys(&self) -> Option<quic::DirectionalKeys> {
|
||||
Some(quic::DirectionalKeys::new(
|
||||
self.resumption_ciphersuite?,
|
||||
self.common.quic.early_secret.as_ref()?,
|
||||
|
@ -708,7 +708,7 @@ impl quic::QuicExt for ClientConnection {
|
|||
quic::write_hs(&mut self.common, buf)
|
||||
}
|
||||
|
||||
fn get_alert(&self) -> Option<AlertDescription> {
|
||||
fn alert(&self) -> Option<AlertDescription> {
|
||||
self.common.quic.alert
|
||||
}
|
||||
|
||||
|
|
|
@ -38,10 +38,10 @@ pub trait QuicExt {
|
|||
/// handshake completes, and reliance on them should be minimized.
|
||||
/// However, any tampering with the parameters will cause the handshake
|
||||
/// to fail.
|
||||
fn get_quic_transport_parameters(&self) -> Option<&[u8]>;
|
||||
fn quic_transport_parameters(&self) -> Option<&[u8]>;
|
||||
|
||||
/// Compute the keys for encrypting/decrypting 0-RTT packets, if available
|
||||
fn get_0rtt_keys(&self) -> Option<DirectionalKeys>;
|
||||
fn zero_rtt_keys(&self) -> Option<DirectionalKeys>;
|
||||
|
||||
/// Consume unencrypted TLS handshake data.
|
||||
///
|
||||
|
@ -56,7 +56,7 @@ pub trait QuicExt {
|
|||
/// Emit the TLS description code of a fatal alert, if one has arisen.
|
||||
///
|
||||
/// Check after `read_hs` returns `Err(_)`.
|
||||
fn get_alert(&self) -> Option<AlertDescription>;
|
||||
fn alert(&self) -> Option<AlertDescription>;
|
||||
|
||||
/// Compute the keys to use following a 1-RTT key update
|
||||
///
|
||||
|
|
|
@ -618,7 +618,7 @@ impl fmt::Debug for ServerConnection {
|
|||
|
||||
#[cfg(feature = "quic")]
|
||||
impl quic::QuicExt for ServerConnection {
|
||||
fn get_quic_transport_parameters(&self) -> Option<&[u8]> {
|
||||
fn quic_transport_parameters(&self) -> Option<&[u8]> {
|
||||
self.common
|
||||
.quic
|
||||
.params
|
||||
|
@ -626,7 +626,7 @@ impl quic::QuicExt for ServerConnection {
|
|||
.map(|v| v.as_ref())
|
||||
}
|
||||
|
||||
fn get_0rtt_keys(&self) -> Option<quic::DirectionalKeys> {
|
||||
fn zero_rtt_keys(&self) -> Option<quic::DirectionalKeys> {
|
||||
Some(quic::DirectionalKeys::new(
|
||||
self.common.get_suite()?,
|
||||
self.common.quic.early_secret.as_ref()?,
|
||||
|
@ -642,7 +642,7 @@ impl quic::QuicExt for ServerConnection {
|
|||
quic::write_hs(&mut self.common, buf)
|
||||
}
|
||||
|
||||
fn get_alert(&self) -> Option<AlertDescription> {
|
||||
fn alert(&self) -> Option<AlertDescription> {
|
||||
self.common.quic.alert
|
||||
}
|
||||
|
||||
|
|
|
@ -2883,7 +2883,7 @@ mod test_quic {
|
|||
if let Err(e) = recv.read_hs(&buf) {
|
||||
return Err(e);
|
||||
} else {
|
||||
assert_eq!(recv.get_alert(), None);
|
||||
assert_eq!(recv.alert(), None);
|
||||
}
|
||||
Ok(secrets)
|
||||
}
|
||||
|
@ -2927,12 +2927,12 @@ mod test_quic {
|
|||
|
||||
let client_initial = step(&mut client, &mut server).unwrap();
|
||||
assert!(client_initial.is_none());
|
||||
assert!(client.get_0rtt_keys().is_none());
|
||||
assert_eq!(server.get_quic_transport_parameters(), Some(client_params));
|
||||
assert!(client.zero_rtt_keys().is_none());
|
||||
assert_eq!(server.quic_transport_parameters(), Some(client_params));
|
||||
let server_hs = step(&mut server, &mut client)
|
||||
.unwrap()
|
||||
.unwrap();
|
||||
assert!(server.get_0rtt_keys().is_none());
|
||||
assert!(server.zero_rtt_keys().is_none());
|
||||
let client_hs = step(&mut client, &mut server)
|
||||
.unwrap()
|
||||
.unwrap();
|
||||
|
@ -2942,7 +2942,7 @@ mod test_quic {
|
|||
.unwrap()
|
||||
.unwrap();
|
||||
assert!(!client.is_handshaking());
|
||||
assert_eq!(client.get_quic_transport_parameters(), Some(server_params));
|
||||
assert_eq!(client.quic_transport_parameters(), Some(server_params));
|
||||
assert!(server.is_handshaking());
|
||||
let client_1rtt = step(&mut client, &mut server)
|
||||
.unwrap()
|
||||
|
@ -2980,10 +2980,10 @@ mod test_quic {
|
|||
.unwrap();
|
||||
|
||||
step(&mut client, &mut server).unwrap();
|
||||
assert_eq!(client.get_quic_transport_parameters(), Some(server_params));
|
||||
assert_eq!(client.quic_transport_parameters(), Some(server_params));
|
||||
{
|
||||
let client_early = client.get_0rtt_keys().unwrap();
|
||||
let server_early = server.get_0rtt_keys().unwrap();
|
||||
let client_early = client.zero_rtt_keys().unwrap();
|
||||
let server_early = server.zero_rtt_keys().unwrap();
|
||||
assert!(equal_dir_keys(&client_early, &server_early));
|
||||
}
|
||||
step(&mut server, &mut client)
|
||||
|
@ -3014,9 +3014,9 @@ mod test_quic {
|
|||
.unwrap();
|
||||
|
||||
step(&mut client, &mut server).unwrap();
|
||||
assert_eq!(client.get_quic_transport_parameters(), Some(server_params));
|
||||
assert!(client.get_0rtt_keys().is_some());
|
||||
assert!(server.get_0rtt_keys().is_none());
|
||||
assert_eq!(client.quic_transport_parameters(), Some(server_params));
|
||||
assert!(client.zero_rtt_keys().is_some());
|
||||
assert!(server.zero_rtt_keys().is_none());
|
||||
step(&mut server, &mut client)
|
||||
.unwrap()
|
||||
.unwrap();
|
||||
|
@ -3048,7 +3048,7 @@ mod test_quic {
|
|||
.unwrap();
|
||||
assert!(step(&mut server, &mut client).is_err());
|
||||
assert_eq!(
|
||||
client.get_alert(),
|
||||
client.alert(),
|
||||
Some(rustls::internal::msgs::enums::AlertDescription::BadCertificate)
|
||||
);
|
||||
}
|
||||
|
@ -3088,7 +3088,7 @@ mod test_quic {
|
|||
);
|
||||
|
||||
assert_eq!(
|
||||
server.get_alert(),
|
||||
server.alert(),
|
||||
Some(rustls::internal::msgs::enums::AlertDescription::NoApplicationProtocol)
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue