Skip to main content

PasskiError

Enum PasskiError 

Source
#[non_exhaustive]
pub enum PasskiError {
Show 31 variants UserIdTooShort, Base64Decode(Error), InvalidClientDataJson(Error), CborDecode(Error<Error>), CborEncode(Error<Error>), MissingClientDataField(String), InvalidClientDataType(String), ClientDataTypeMismatch { expected: ClientDataType, got: ClientDataType, }, ChallengeMismatch, OriginMismatch { expected: Vec<String>, got: String, }, CrossOriginNotAllowed, InvalidAuthenticatorData, RpIdHashMismatch, UserNotPresent, UserVerificationRequired, InvalidBackupFlags, CounterRegression, NoAttestedCredentialData, CredentialNotAllowed, CredentialIdMismatch, UnsupportedAlgorithm(i32), SignatureVerificationFailed, InvalidCoseKey(String), InvalidAttestationObject(String), UnsupportedAttestationFormat(String), MissingAttStmtField(String), InvalidAttestation(String), InvalidCertificate(String), InvalidCertificateChain(String), UntrustedAttestation, MissingAttestationChain,
}
Expand description

Error type for Passki operations.

One variant per way a ceremony can fail, so callers can react to a specific failure - a PasskiError::CounterRegression means something quite different from a malformed request - without matching on message strings.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

UserIdTooShort

user_id passed to crate::Passki::start_passkey_registration was too short.

§

Base64Decode(Error)

Base64url decoding failed.

§

InvalidClientDataJson(Error)

Client data JSON could not be parsed.

§

CborDecode(Error<Error>)

CBOR decoding failed.

§

CborEncode(Error<Error>)

CBOR encoding failed.

§

MissingClientDataField(String)

A required field was missing from the client data JSON.

§

InvalidClientDataType(String)

The client data type field was not a recognized WebAuthn operation.

§

ClientDataTypeMismatch

The client data type did not match the expected operation.

§

ChallengeMismatch

The client data challenge did not match the one that was issued.

§

OriginMismatch

The client data origin did not match any of the relying party’s origins.

Fields

§expected: Vec<String>
§

CrossOriginNotAllowed

The client data indicated a cross-origin iframe request.

§

InvalidAuthenticatorData

The authenticator data was truncated or otherwise malformed.

§

RpIdHashMismatch

The rpIdHash in the authenticator data did not match the relying party.

§

UserNotPresent

The UP (user present) flag was not set.

§

UserVerificationRequired

User verification was required but the UV flag was not set.

§

InvalidBackupFlags

The BS (backup state) flag was set without the BE (backup eligibility) flag, which the WebAuthn spec forbids.

§

CounterRegression

The signature counter did not increase, indicating a possible replay attack or a cloned authenticator.

§

NoAttestedCredentialData

The authenticator data did not contain attested credential data.

§

CredentialNotAllowed

The credential used for authentication was not in the allowed list.

§

CredentialIdMismatch

The credential ID reported by the client did not match the one in the attested credential data.

§

UnsupportedAlgorithm(i32)

The COSE algorithm identifier is not supported.

§

SignatureVerificationFailed

Signature verification failed.

§

InvalidCoseKey(String)

A COSE key was malformed or missing a required field.

§

InvalidAttestationObject(String)

The attestation object did not have the expected structure.

§

UnsupportedAttestationFormat(String)

The attestation format (fmt) is not supported.

§

MissingAttStmtField(String)

A required field was missing from the attestation statement.

§

InvalidAttestation(String)

The attestation statement failed a format-specific structural or signature check.

§

InvalidCertificate(String)

The attestation certificate was malformed or did not satisfy the WebAuthn attestation certificate requirements.

§

InvalidCertificateChain(String)

The certificate chain did not hold together: a broken signature link, an expired certificate, or an issuer that is not a CA.

§

UntrustedAttestation

The chain was well formed but did not reach any of the roots installed with crate::Passki::with_attestation_trust.

§

MissingAttestationChain

AttestationTrustPolicy::Required is in effect but the authenticator sent no attestation certificate to validate.

Trait Implementations§

Source§

impl Debug for PasskiError

Source§

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

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

impl Display for PasskiError

Source§

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

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

impl Error for PasskiError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<Error<Error>> for PasskiError

Source§

fn from(source: Error<Error>) -> Self

Converts to this type from the input type.
Source§

impl From<Error<Error>> for PasskiError

Source§

fn from(source: Error<Error>) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for PasskiError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for PasskiError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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.