#[non_exhaustive]pub enum Error {
Show 16 variants
TruncatedHeader,
NonMinimalHeader,
TruncatedCiphertext,
UnknownKeyId(u64),
KeyRoleConflict(u64),
AuthenticationFailed,
Replayed {
kid: u64,
ctr: u64,
},
CounterExhausted(u64),
KeyReuse(u64),
EmptyBaseKey,
KeyIdLayout,
StaleEpoch(u64),
UnknownEpoch(u64),
TooManyKeys,
RatchetExhausted,
Crypto(CryptoError),
}Expand description
Why an SFrame operation failed.
No variant carries key material, plaintext, a nonce or a tag.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
TruncatedHeader
The input ends before the SFrame header does (RFC 9605 section 4.3).
NonMinimalHeader
The header carries a KID or CTR that is not in its shortest form (RFC 9605 section 4.3: a value below 8 goes in the config byte, a larger one in the fewest bytes).
TruncatedCiphertext
What follows the header is shorter than the cipher suite’s authentication tag.
UnknownKeyId(u64)
No key is stored for this KID.
KeyRoleConflict(u64)
The key stored for this KID is marked for the other direction: a key is usable for encryption or for decryption, never both (RFC 9605 section 4.4.1).
AuthenticationFailed
The authentication tag does not match the header, the metadata and the ciphertext.
Replayed
The ciphertext is authentic, but its counter was already accepted or is older than the replay window (RFC 9605 section 9.3).
CounterExhausted(u64)
Every counter of this key has been used: one more encryption would repeat a nonce (RFC 9605 sections 7.4 and 9.1). The sender needs a new key.
KeyReuse(u64)
The key is already installed for sending under this KID. Installing it again would restart its counter and repeat (key, nonce) pairs (RFC 9605 sections 7.4 and 9.1).
EmptyBaseKey
A base key is empty.
KeyIdLayout
A KID layout does not fit 64 bits, or a value does not fit its field of the KID (RFC 9605 sections 5.1 and 5.2).
StaleEpoch(u64)
An MLS epoch is older than, or contradicts, one already introduced with the same low-order bits (RFC 9605 section 5.2).
UnknownEpoch(u64)
No secret is stored for this MLS epoch.
TooManyKeys
The store already holds as many derived keys as its limit allows.
RatchetExhausted
A ratchet step counter cannot advance further.
Crypto(CryptoError)
The crypto provider failed, or does not implement what the cipher suite needs.
Implementations§
Trait Implementations§
impl Eq for Error
Source§impl Error for Error
impl Error for Error
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()