pub enum E2eeError {
InvalidSignature,
NonContributoryDh,
Aead,
Padding,
TooManySkipped,
CounterOverflow,
NoChain,
FingerprintChanged {
previous: Fingerprint,
current: Fingerprint,
},
WrongState,
Fragmentation,
Internal,
}Expand description
Everything that can go wrong here: a doomed handshake, a ratchet that refuses to advance, or a caller asking the state machine for a transition it does not allow.
Variants§
InvalidSignature
A signature the protocol requires did not verify.
NonContributoryDh
A Diffie-Hellman output was non-contributory: a small-order or otherwise degenerate public key, which HKDF would otherwise turn into a predictable key.
Aead
An AEAD operation failed: on decrypt, a tampered, misrouted, or out-of-session ciphertext; on encrypt, only ever a coding error in this module.
Padding
A decrypted plaintext’s padding was not well-formed ISO/IEC 7816-4 padding.
TooManySkipped
A message implied a skip-ahead of more than MAX_SKIP messages in one jump.
CounterOverflow
A message counter would overflow u32, which cannot happen in a real conversation and
therefore signals a malicious or corrupted counter.
NoChain
There is no established sending or receiving chain to use yet.
FingerprintChanged
The peer’s fingerprint changed since it was first pinned. The caller must call
Session::confirm_fingerprint_change before the same operation can succeed.
Fields
previous: FingerprintThe fingerprint pinned from an earlier conversation.
current: FingerprintThe fingerprint just observed.
WrongState
The session is not in a state that allows this operation, such as decrypting content
before the handshake’s ack has been received and decrypted.
Fragmentation
A frag set could not be reassembled: a mismatched id/n, a duplicate or
out-of-range index, or a missing piece.
Internal
An underlying primitive rejected an input this module always constructs to be valid (an HMAC key length, an HKDF output length). Never expected to occur in practice.