pub enum MessageDecodeError {
    ReadFailure(Error),
    HeaderDecodeFailure(HeaderDecodeError),
    AttributeDecodeFailure {
        source: AttributeDecodeError,
        transaction_id: [u8; 12],
    },
    IntegrityKeyGenerationFailure(IntegrityKeyGenerationError),
    IncorrectFingerprintAttributePosition {
        msg_len: usize,
        attr_pos: usize,
    },
    FingerprintMismatch {
        attr_value: u32,
        computed_value: u32,
    },
    MessageIntegrityFail {
        attr_value: Vec<u8>,
        computed_value: Vec<u8>,
    },
}
Expand description

Message encoding errors.

Variants

ReadFailure(Error)

IO error when reading a field value

HeaderDecodeFailure(HeaderDecodeError)

Failure to decode the STUN header section

AttributeDecodeFailure

Fields

transaction_id: [u8; 12]

STUN transaction id.

Failure to decode a STUN attribute

IntegrityKeyGenerationFailure(IntegrityKeyGenerationError)

Failure to generate an integrity verification key

IncorrectFingerprintAttributePosition

Fields

msg_len: usize

STUN message length

attr_pos: usize

Fingerprint attribute position in that message

Fingerprint attribute is not the last one. This can mean that either the provided byte data contains more than only the STUN message, or message integrity has been compromised.

FingerprintMismatch

Fields

attr_value: u32

Provided CRC32 value

computed_value: u32

Computed CRC32 value

Stored and calculated fingerprints mismatch. Means that the message integrity has been compromised.

MessageIntegrityFail

Fields

attr_value: Vec<u8>

Provided HMAC

computed_value: Vec<u8>

Calculated HMAC

The calculated HMAC value doesn’t match with the provided one. Either the provided integrity_key is incorrect or the message integrity has been compromised.

Trait Implementations

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

The lower-level source of this error, if any. Read more

🔬 This is a nightly-only experimental API. (backtrace)

Returns a stack backtrace, if available, of where this error occurred. Read more

👎 Deprecated since 1.42.0:

use the Display impl or to_string()

👎 Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Converts to this type from the input type.

Converts to this type from the input type.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.