Module crypto::tls
TLS 1.3 Record Layer Implements the TLS 1.3 record protocol (RFC 8446 §5). Crypto operations are delegated to std/crypto/aes.h and std/crypto/sha256.h. This module handles record framing, the inner content type and alerts. There is no handshake here: keys come from install_keys(). For complete TLS connections (handshake, certificates, every TLS 1.3 cipher suite, the OS's TLS library when there is one) use std/tls/tls.h.
Record protection is the AES-256-GCM AEAD of RFC 8446 §5.2 (the TLS_AES_256_GCM_SHA384 cipher suite's record layer), so protected records are wire-compatible with other TLS 1.3 stacks given the same traffic keys. Freestanding-safe.
Structs
| TlsRecord | |
| TlsTranscript | Transcript hash context (used during handshake). |
| TlsSession | TLS session — holds traffic keys and sequence numbers. |
Macros
| TLS_CHANGE_CIPHER_SPEC | TLS content types |
| TLS_ALERT | |
| TLS_HANDSHAKE | |
| TLS_APPLICATION_DATA | |
| TLS_ALERT_WARNING | Alert levels and descriptions |
| TLS_ALERT_FATAL | |
| TLS_ALERT_CLOSE_NOTIFY | |
| TLS_ALERT_HANDSHAKE_FAIL | |
| TLS_ALERT_DECODE_ERROR | |
| TLS_MAX_RECORD_LEN | Maximum TLS plaintext/ciphertext fragment size (RFC 8446 §5.1) |
| TLS_KEY_LEN | Record protection is TLS_AES_256_GCM_SHA384's AEAD: AES-256-GCM. |
| TLS_IV_LEN | per RFC 8446 §5.3 |
| TLS_TAG_LEN | GCM authentication tag |