From ce1071195bc93caada7d05ed43ce178a50d36f59 Mon Sep 17 00:00:00 2001 From: Benjamin Saunders Date: Sat, 19 Feb 2022 11:56:17 -0800 Subject: [PATCH] Relax feature guard on ServerConfig::with_crypto This constructor doesn't require rustls. --- quinn-proto/src/config.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/quinn-proto/src/config.rs b/quinn-proto/src/config.rs index cb79ba8b6..25cb74cf7 100644 --- a/quinn-proto/src/config.rs +++ b/quinn-proto/src/config.rs @@ -518,11 +518,14 @@ impl ServerConfig { let crypto = crypto::rustls::server_config(cert_chain, key)?; Ok(Self::with_crypto(Arc::new(crypto))) } +} - /// Create a server config with the given [`rustls::ServerConfig`] +#[cfg(feature = "ring")] +impl ServerConfig { + /// Create a server config with the given [`crypto::ServerConfig`] /// /// Uses a randomized handshake token key. - pub fn with_crypto(crypto: Arc) -> Self { + pub fn with_crypto(crypto: Arc) -> Self { let rng = &mut rand::thread_rng(); let mut master_key = [0u8; 64]; rng.fill_bytes(&mut master_key);