ytls_ctx/error.rs
1//! errors
2
3use ytls_record::BuilderError;
4use ytls_record::RecordError;
5
6/// yTLS Context Errors
7#[derive(Debug, PartialEq)]
8pub enum CtxError {
9 /// Record Error
10 Record(RecordError),
11 /// Builder Error
12 Builder(BuilderError),
13 /// Encountered Bug
14 Bug(&'static str),
15 /// Unexpected Application Data record
16 UnexpectedAppData,
17 /// Attempted to send hanshake out without AEAD Iv
18 MissingHandshakeIv,
19 /// Attempted to send hanshake out without AEAD Key
20 MissingHandshakeKey,
21 /// Iv is exhausted for any further record generation
22 ExhaustedIv,
23 /// Cryptography provider related error. Usually a bug.
24 Crypto,
25 /// Private Key related error, typically wrong length.
26 PrivateKey,
27 /// RFC 8446 TLS 1.3 Specified Error
28 Rfc8446(Rfc8446Error),
29}
30
31#[derive(Debug, PartialEq)]
32pub enum Rfc8446Error {
33 /// decrypt_error
34 Decrypt,
35 /// Unexpected record
36 Unexpected,
37}