pub enum SessionError {
Inauthentic,
Replayed,
}Expand description
What can go wrong opening a sealed message on a session.
Sealing never fails, so this only describes the receive side. The two cases are kept distinct on purpose: a forged or corrupted message is an attack or a wire fault, while a replayed message is a captured-and-resent valid message, and an operator may want to react to them differently.
Variants§
Inauthentic
The message did not authenticate: its tag does not match, so it was altered in flight, was sealed under a different key, or is an outright forgery. The plaintext is never revealed in this case.
Replayed
The message’s counter has already been seen, or is older than the replay window still tracks, so it is a replay of a message already accepted (or one too old to prove is not). It is rejected without revealing the plaintext.
Trait Implementations§
Source§impl Clone for SessionError
impl Clone for SessionError
Source§fn clone(&self) -> SessionError
fn clone(&self) -> SessionError
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 SessionError
Source§impl Debug for SessionError
impl Debug for SessionError
Source§impl Display for SessionError
impl Display for SessionError
impl Eq for SessionError
Source§impl Error for SessionError
impl Error for SessionError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl PartialEq for SessionError
impl PartialEq for SessionError
Source§fn eq(&self, other: &SessionError) -> bool
fn eq(&self, other: &SessionError) -> bool
self and other values to be equal, and is used by ==.