Skip to content

Commit

Permalink
Remove token_key for now.
Browse files Browse the repository at this point in the history
  • Loading branch information
finnbear committed Aug 19, 2024
1 parent aa4bf30 commit d88906e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 18 deletions.
1 change: 0 additions & 1 deletion wtransport/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ allowed_external_types = [
"quinn_proto::config::ServerConfig",
"quinn_proto::config::TransportConfig",
"quinn_proto::connection::ConnectionError",
"quinn_proto::crypto::HandshakeTokenKey",
"rustls",
"rustls::webpki::anchors::RootCertStore",
"rustls::client::client_conn::ClientConfig",
Expand Down
18 changes: 1 addition & 17 deletions wtransport/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,6 @@ impl ServerConfigBuilder<states::WantsIdentity> {
bind_address: self.0.bind_address,
dual_stack_config: self.0.dual_stack_config,
tls_config,
token_key: None,
transport_config,
migration: true,
})
Expand All @@ -497,11 +496,7 @@ impl ServerConfigBuilder<states::WantsTransportConfigServer> {
quinn::crypto::rustls::QuicServerConfig::try_from(self.0.tls_config)
.expect("TLS 1.3 cipher suite missing"),
);
let mut quic_config = if let Some(token_key) = self.0.token_key {
QuicServerConfig::new(crypto, token_key)
} else {
QuicServerConfig::with_crypto(crypto)
};
let mut quic_config = QuicServerConfig::with_crypto(crypto);

quic_config.transport_config(Arc::new(self.0.transport_config));
quic_config.migration(self.0.migration);
Expand Down Expand Up @@ -555,15 +550,6 @@ impl ServerConfigBuilder<states::WantsTransportConfigServer> {
self
}

/// Use `Some` to use specific handshake token key instead of a random one.
///
/// Allows reloading the configuration without invalidating in-flight retry tokens.
#[cfg(feature = "quinn")]
pub fn token_key(mut self, value: Option<Arc<dyn quinn::crypto::HandshakeTokenKey>>) -> Self {
self.0.token_key = value;
self
}

/// Writes key material for debugging into file provided by `SSLKEYLOGFILE` environment variable.
///
/// Disabled by default.
Expand Down Expand Up @@ -1055,7 +1041,6 @@ impl Default for ClientConfigBuilder<states::WantsBindAddress> {
/// State-types for client/server builder.
pub mod states {
use super::*;
use quinn::crypto::HandshakeTokenKey;

/// Config builder state where the caller must supply binding address.
pub struct WantsBindAddress {}
Expand All @@ -1077,7 +1062,6 @@ pub mod states {
pub(super) bind_address: SocketAddr,
pub(super) dual_stack_config: Ipv6DualStackConfig,
pub(super) tls_config: TlsServerConfig,
pub(super) token_key: Option<Arc<dyn HandshakeTokenKey>>,
pub(super) transport_config: quinn::TransportConfig,
pub(super) migration: bool,
}
Expand Down

0 comments on commit d88906e

Please sign in to comment.