pub struct NullProvider {
pub alpn: Vec<Vec<u8>>,
pub hello_padding: usize,
pub server_flight: usize,
pub accept_any_tag: bool,
/* private fields */
}Expand description
The null provider. alpn lists the protocols offered (client) or accepted (server).
Fields§
§alpn: Vec<Vec<u8>>§hello_padding: usizeExtra bytes in the ClientHello, to exercise multi-packet CRYPTO data.
server_flight: usizeSize of a mock Certificate message in the server’s flight.
accept_any_tag: boolAccept any packet tag, so mutated packets reach frame processing (fuzzing).
Implementations§
Source§impl NullProvider
impl NullProvider
Sourcepub fn new(seed: u64) -> Self
pub fn new(seed: u64) -> Self
Examples found in repository?
examples/bench_quic.rs (line 21)
19fn providers(real: bool) -> (Arc<dyn CryptoProvider>, Arc<dyn CryptoProvider>) {
20 if !real {
21 return (Arc::new(NullProvider::new(1)), Arc::new(NullProvider::new(2)));
22 }
23 let ss = certgen::issue(&CertParams::server(&["localhost"]), PrivateKey::generate_ec(EcCurve::P256), None);
24 let ck = simoom_tls::CertifiedKey::new(vec![ss.cert_der.clone()], ss.key.clone()).unwrap();
25 let s = TlsProvider::server(Arc::new(simoom_tls::ServerConfig::new(ck).with_alpn(&[b"h3"])));
26 let mut roots = simoom_tls::x509::RootStore::empty();
27 roots.add_der(&ss.cert_der).unwrap();
28 let c = TlsProvider::client(Arc::new(simoom_tls::ClientConfig::new(roots).with_alpn(&[b"h3"])));
29 (Arc::new(c), Arc::new(s))
30}Trait Implementations§
Source§impl CryptoProvider for NullProvider
impl CryptoProvider for NullProvider
Source§fn initial_keys(&self, version: u32, dcid: &[u8], is_server: bool) -> Keys
fn initial_keys(&self, version: u32, dcid: &[u8], is_server: bool) -> Keys
Initial keys derived from the client’s first destination connection ID.
Source§fn retry_tag(&self, version: u32, pseudo_packet: &[u8]) -> [u8; 16]
fn retry_tag(&self, version: u32, pseudo_packet: &[u8]) -> [u8; 16]
The Retry integrity tag over the Retry pseudo-packet (RFC 9001 §5.8).
Source§fn hmac(&self, key: &[u8; 32], parts: &[&[u8]]) -> [u8; 32]
fn hmac(&self, key: &[u8; 32], parts: &[&[u8]]) -> [u8; 32]
HMAC-SHA256 over the concatenation of
parts.Source§fn fill_random(&self, buf: &mut [u8])
fn fill_random(&self, buf: &mut [u8])
Cryptographically secure random bytes.
Source§fn server_session(
&self,
_version: u32,
tp: Vec<u8>,
) -> Result<Box<dyn CryptoSession>, TransportError>
fn server_session( &self, _version: u32, tp: Vec<u8>, ) -> Result<Box<dyn CryptoSession>, TransportError>
Starts a server handshake for QUIC
version that will send transport_params.Source§fn client_session(
&self,
_version: u32,
_name: &str,
tp: Vec<u8>,
) -> Result<Box<dyn CryptoSession>, TransportError>
fn client_session( &self, _version: u32, _name: &str, tp: Vec<u8>, ) -> Result<Box<dyn CryptoSession>, TransportError>
Starts a client handshake to
server_name that will send transport_params.Auto Trait Implementations§
impl !Freeze for NullProvider
impl Forget for NullProvider
impl Move for NullProvider
impl RefUnwindSafe for NullProvider
impl Send for NullProvider
impl Sync for NullProvider
impl Unpin for NullProvider
impl UnsafeUnpin for NullProvider
impl UnwindSafe for NullProvider
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more