1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
//! Transport Layer Security — TLS 1.2 (RFC 5246, AEAD suites per
//! RFC 7905 + Extended Master Secret per RFC 7627), TLS 1.3 (RFC 8446)
//! including session resumption, 0-RTT, and key update — and a unified
//! [`Config`] / [`Connection`] that also drives DTLS 1.2 / 1.3 (see
//! [`crate::dtls`]) and is reused by the QUIC stack ([`crate::quic`])
//! through an internal handshake-seam.
//!
//! A transport-agnostic ("sans-I/O") implementation: the connection
//! state machine consumes and produces bytes through buffers and never
//! touches a socket. The host wires the byte streams to a `TcpStream`
//! (see the `s_client` / `s_server` CLI examples) or any other
//! transport.
//!
//! **Cipher suites** — TLS 1.3: `TLS_AES_128_GCM_SHA256`,
//! `TLS_AES_256_GCM_SHA384`, `TLS_CHACHA20_POLY1305_SHA256`. TLS 1.2:
//! ECDHE with the same three AEAD suites per RFC 7905 (no CBC, no RC4).
//! **Key exchange** — X25519, secp256r1, secp384r1, plus the
//! X25519MLKEM768 PQ-hybrid group (draft-ietf-tls-ecdhe-mlkem).
//! **Signature schemes** — ECDSA (P-256/P-384/P-521), Ed25519, RSA-PSS,
//! RSA-PKCS1 (TLS 1.2 only), plus ML-DSA in TLS 1.3.
//!
//! **Status:** the handshake, record protection, key schedule, and
//! resumption paths are validated against the RFC 8448 traces and run
//! end-to-end against the in-tree CLI loopback tests across Linux,
//! macOS, and Windows. The codebase has had an internal security
//! audit (`b52157d`…`8aa0881`) but no external audit; APIs may still
//! evolve before 1.0.
//!
//! # Legacy TLS 1.0 / 1.1 / SSL 3.0 (opt-in, off by default)
//!
//! The non-default `tls-legacy` Cargo feature adds the deprecated
//! SSL 3.0 / TLS 1.0 / TLS 1.1 protocol versions and their CBC
//! MAC-then-encrypt cipher suites — `TLS_RSA_WITH_*` (static-RSA key
//! transport) and `TLS_ECDHE_RSA_WITH_*` over AES-CBC-SHA, AES-CBC-SHA256
//! (TLS 1.0/1.1 only) and 3DES-CBC-SHA — for client and server roles.
//! These exist purely to interoperate with legacy hardware (e.g. VoIP-phone
//! provisioning servers) that speaks nothing newer.
//!
//! Enabling the feature does **not** change defaults: a [`Config`] still
//! negotiates only TLS 1.2/1.3 unless the caller explicitly lowers
//! [`Config::min_version`] (e.g. to [`ProtocolVersion::TLSv1_0`]). To offer
//! *only* legacy versions — talking to a peer that rejects a TLS 1.2
//! ClientHello — also lower `max_version`.
//!
//! **These versions are insecure (RFC 8996).** They rely on MD5/SHA-1 in the
//! PRF and signatures, are subject to CBC padding-oracle attacks (Lucky13;
//! the legacy CBC decrypt is constant-time + uniform-error but does not yet
//! fully equalise the MAC block count), BEAST (mitigated on TLS 1.0 send via
//! 1/n-1 record splitting), and — for SSL 3.0 — POODLE (unauthenticated CBC
//! padding, which cannot be fixed). Enable `tls-legacy` only for last-resort
//! interop, and never expose it where an adversary controls a chosen-plaintext
//! timing/oracle channel. Prefer TLS 1.2+ AEAD, which this crate keeps fully
//! constant-time.
pub
pub
pub
pub
pub
pub
pub use ;
pub use ClientCertConfig;
pub use ReplayWindow;
pub use ;
pub use HashAlg;
pub use ;
pub use NamedGroup;
pub use KeyLog;
pub use ;
pub use ;
pub use ;