Struct EchGreaseShape
pub struct EchGreaseShape { /* private fields */ }boring and crypto and std only.Expand description
The algorithms and lengths of an ECH GREASE extension, never its keys or bytes.
Apply with super::ClientHelloShape::with_ech_grease. GREASE must also be
enabled with super::SslRef::set_enable_ech_grease, and TLS 1.3 must be
offered. A usable real ECH configuration takes precedence; this shape only
applies when BoringSSL falls back to GREASE. An unusable configuration still
follows the native ECH rejection policy.
Each new handshake generates fresh X25519 encapsulation, random payload and
config ID, independently of super::GreaseValues. A HelloRetryRequest
reuses the first GREASE extension byte for byte. A new connection, including
one made with real ECH retry configs, must be configured separately.
Implementations§
§impl EchGreaseShape
impl EchGreaseShape
pub const ENCAPSULATED_KEY_LEN: usize = 32
pub const ENCAPSULATED_KEY_LEN: usize = 32
The X25519 encapsulated key length. Other KEMs are not supported here.
pub const MIN_PAYLOAD_LEN: usize = 16
pub const MIN_PAYLOAD_LEN: usize = 16
Minimum payload length, including the AEAD’s 16-byte tag.
pub const MAX_PAYLOAD_LEN: usize = 65_489
pub const MAX_PAYLOAD_LEN: usize = 65_489
Largest payload that fits the TLS extensions block with ECH framing. The complete ClientHello must also fit its length prefixes: other extensions reduce the available space. If it does not fit, the handshake fails before writing a ClientHello.
pub fn new(
cipher_suite: EchGreaseCipherSuite,
payload_len: usize,
) -> Result<EchGreaseShape, ErrorStack>
pub fn new( cipher_suite: EchGreaseCipherSuite, payload_len: usize, ) -> Result<EchGreaseShape, ErrorStack>
Selects an exact payload length in bytes, including the AEAD tag. Lengths need not be multiples of 32.
pub fn from_wire(
kdf_id: u16,
aead_id: u16,
encapsulated_key_len: usize,
payload_len: usize,
) -> Result<EchGreaseShape, ErrorStack>
pub fn from_wire( kdf_id: u16, aead_id: u16, encapsulated_key_len: usize, payload_len: usize, ) -> Result<EchGreaseShape, ErrorStack>
Validates algorithms and lengths retained from a captured extension. Accepts KDF 1, AEAD 1/2/3, and exactly 32 encapsulation bytes. No captured cryptographic bytes or config ID are accepted.
pub const fn cipher_suite(self) -> EchGreaseCipherSuite
pub const fn cipher_suite(self) -> EchGreaseCipherSuite
The selected HPKE cipher suite.
pub const fn payload_len(self) -> usize
pub const fn payload_len(self) -> usize
The exact wire payload length, including the AEAD tag.
Trait Implementations§
§impl Clone for EchGreaseShape
impl Clone for EchGreaseShape
§fn clone(&self) -> EchGreaseShape
fn clone(&self) -> EchGreaseShape
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for EchGreaseShape
§impl Debug for EchGreaseShape
impl Debug for EchGreaseShape
impl Eq for EchGreaseShape
§impl Hash for EchGreaseShape
impl Hash for EchGreaseShape
§impl PartialEq for EchGreaseShape
impl PartialEq for EchGreaseShape
impl StructuralPartialEq for EchGreaseShape
Auto Trait Implementations§
impl Freeze for EchGreaseShape
impl RefUnwindSafe for EchGreaseShape
impl Send for EchGreaseShape
impl Sync for EchGreaseShape
impl Unpin for EchGreaseShape
impl UnsafeUnpin for EchGreaseShape
impl UnwindSafe for EchGreaseShape
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a rama_grpc::Request§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more