Enum EDHOCError

Source
#[non_exhaustive]
pub enum EDHOCError {
Show 13 variants UnexpectedCredential, MissingIdentity, IdentityAlreadySet, MacVerificationFailed, UnsupportedMethod, UnsupportedCipherSuite, ParsingError, EncodingError, CredentialTooLongError, EadLabelTooLongError, EadTooLongError, EADUnprocessable, AccessDenied,
}

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.
§

UnexpectedCredential

In an exchange, a credential was set as “expected”, but the credential configured by the peer did not match what was presented. This is more an application internal than an EDHOC error: When the application sets the expected credential, that process should be informed by the known details.

§

MissingIdentity

§

IdentityAlreadySet

§

MacVerificationFailed

§

UnsupportedMethod

§

UnsupportedCipherSuite

§

ParsingError

§

EncodingError

§

CredentialTooLongError

§

EadLabelTooLongError

§

EadTooLongError

§

EADUnprocessable

An EAD was received that was either not known (and critical), or not understood, or otherwise erroneous.

§

AccessDenied

The credential or EADs could be processed (possibly by a third party), but the decision based on that was to not to continue the EDHOC session.

See also https://datatracker.ietf.org/doc/html/draft-ietf-lake-authz#name-edhoc-error-access-denied

Implementations§

Source§

impl EDHOCError

Source

pub fn err_code(&self) -> ErrCode

The ERR_CODE corresponding to the error

Errors that refer to internal limitations (such as EadTooLongError) are treated the same way as parsing errors, and return an unspecified error: Those are equivalent to limitations of the parser, and a constrained system can not be expected to differentiate between “the standard allows this but my number space is too small” and “this violates the standard”.

If an EDHOCError is returned through EDHOC, it will use this in its EDHOC error message.

Note that this on its own is insufficient to create an error message: Additional ERR_INFO is needed, which may or may not be available with the EDHOCError alone.

TODO: Evolve the EDHOCError type such that all information needed is available.

Trait Implementations§

Source§

impl Debug for EDHOCError

Source§

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

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

impl From<CBORError> for EDHOCError

Source§

fn from(error: CBORError) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for EDHOCError

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · 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 StructuralPartialEq for EDHOCError

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, 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.