ytls-ctx 0.0.4

yolox sans-io TLS common context
Documentation
//! errors

use ytls_record::BuilderError;
use ytls_record::RecordError;

/// yTLS Context Errors
#[derive(Debug, PartialEq)]
pub enum CtxError {
    /// Record Error
    Record(RecordError),
    /// Builder Error
    Builder(BuilderError),
    /// Encountered Bug
    Bug(&'static str),
    /// Unexpected Application Data record
    UnexpectedAppData,
    /// Attempted to send hanshake out without AEAD Iv
    MissingHandshakeIv,
    /// Attempted to send hanshake out without AEAD Key
    MissingHandshakeKey,
    /// Iv is exhausted for any further record generation
    ExhaustedIv,
    /// Cryptography provider related error. Usually a bug.
    Crypto,
    /// Private Key related error, typically wrong length.
    PrivateKey,
    /// RFC 8446 TLS 1.3 Specified Error
    Rfc8446(Rfc8446Error),
}

#[derive(Debug, PartialEq)]
pub enum Rfc8446Error {
    /// decrypt_error
    Decrypt,
    /// Unexpected record
    Unexpected,
}