pub struct SessionId(/* private fields */);Expand description
A completed session’s channel binding — hiss’s type, re-exported.
[RATIFIED 2026/08/15 — ruling 89] SessionId is
hiss::noise::SessionId and not a slither wrapper: hiss derives it
from the handshake hash, both peers of a session produce the same value,
and it is a public channel-binding value meant for out-of-band
comparison — logging it, or a short-authentication-string check between
peers. A slither wrapper would be a type that must be kept equal to
hiss’s by hand, for no gain.
§Its Eq is not constant-time
By hiss’s deliberate choice. It carries no secret material and must not be used to compare one: reaching for it as a session token or an authentication comparison is the mistake this paragraph exists to prevent.
Read it off a live connection with
Connection::session_id.
Unique identifier for a Noise session, derived from the handshake hash.
Both peers in a completed handshake produce the same SessionId.
§Equality is not constant-time
The derived PartialEq/Eq compare the raw bytes with the
standard slice comparison, which short-circuits on the first
differing byte and is therefore not constant-time. This is
acceptable because a SessionId is a public channel-binding
value: it is meant to be compared out-of-band — e.g. as a
short-authentication-string check between peers — and carries no
secret material. Do not use this type (or its equality) to
compare secrets; reach for a constant-time comparison there instead.
Implementations§
Trait Implementations§
impl Eq for SessionId
impl StructuralPartialEq for SessionId
Auto Trait Implementations§
impl Freeze for SessionId
impl RefUnwindSafe for SessionId
impl Send for SessionId
impl Sync for SessionId
impl Unpin for SessionId
impl UnsafeUnpin for SessionId
impl UnwindSafe for SessionId
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
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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<P> ProviderExt for P
impl<P> ProviderExt for P
Source§fn generate<C>(
&mut self,
) -> Result<<P as CryptoKeyProvider<C>>::PrivateKey, <P as CryptoKeyProvider<C>>::Error>where
C: Curve,
P: CryptoKeyProvider<C>,
fn generate<C>(
&mut self,
) -> Result<<P as CryptoKeyProvider<C>>::PrivateKey, <P as CryptoKeyProvider<C>>::Error>where
C: Curve,
P: CryptoKeyProvider<C>,
C.Source§fn generate_ephemeral<C>(
&mut self,
) -> Result<<P as CryptoKeyProvider<C>>::PrivateKey, <P as CryptoKeyProvider<C>>::Error>where
C: Curve,
P: CryptoKeyProvider<C>,
fn generate_ephemeral<C>(
&mut self,
) -> Result<<P as CryptoKeyProvider<C>>::PrivateKey, <P as CryptoKeyProvider<C>>::Error>where
C: Curve,
P: CryptoKeyProvider<C>,
C.impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ToHex for T
impl<T> ToHex for T
Source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
self into the result. Lower case
letters are used (e.g. f9b4ca)Source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
self into the result. Upper case
letters are used (e.g. F9B4CA)