Skip to main content

IdentityError

Enum IdentityError 

Source
pub enum IdentityError {
    Unsigned,
    UnknownKey(String),
    BadSignature,
    BadKey,
    Verifier(String),
    UnsupportedScheme(u16),
    ChallengeMismatch,
}
Expand description

Failure modes of signing and verification.

Variants§

§

Unsigned

Entry has no author_sig.

§

UnknownKey(String)

Signing key id is not in the registry.

§

BadSignature

Signature bytes are malformed or do not verify.

§

BadKey

Public key bytes are not a valid ed25519 key.

§

Verifier(String)

The external verifier could not be run at all, with the reason.

Kept apart from IdentityError::BadSignature for the same reason IdentityError::UnknownKey is: the repairs are opposite. A signature that does not verify is evidence about the request; a verifier that will not start is evidence about the host, and answering the second with the first would report an operational fault as an attack.

§

UnsupportedScheme(u16)

The signature names a scheme this verifier cannot check, carrying the tag it named (choir_oplog::scheme).

Separate from IdentityError::BadSignature because the two are different events: a bad signature is a claim that failed, while this is a claim never examined. Collapsing them would let a future scheme look like an attack, and — worse in the other direction — would let a caller believe an unexamined signature had been rejected on its merits.

§

ChallengeMismatch

A WebAuthn assertion verified cryptographically but attests to a different challenge than the one asked about, so it is a valid signature over something nobody in this request agreed to.

D39 treats this as forgery-class rather than as a mismatch: the whole point of binding the challenge to choir_oplog::OpEntry::signing_hash is that a signature cannot be moved from the operation it approved to another one.

Trait Implementations§

Source§

impl Debug for IdentityError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for IdentityError

Source§

fn eq(&self, other: &IdentityError) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for IdentityError

Source§

impl StructuralPartialEq for IdentityError

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.