Repository navigation
tls 1.4.4: truncation protection and protocol hardening
Security hardening release. Upgrade from 1.4.3 or earlier.
Security
- Truncation:
recv_all()returns only after an authenticated close_notify. A bare TCP close raisestls: truncated: connection closed without close_notify; passallow_truncation=Trueto accept it.- Plaintext or undecryptable alerts after the handshake are rejected (forged close_notify).
- A record cut off part-way raises
tls: truncated record.
- RSA: fixed out-of-bounds reads in PKCS#1 v1.5 verification on malformed signatures, which crashed the process.
- X25519: an all-zero shared secret (low-order point) and keys that aren't 32 bytes are rejected.
- Downgrade: the TLS 1.3 downgrade sentinel is detected in TLS 1.2 ServerHellos.
- CertificateVerify: TLS 1.3 no longer accepts PKCS#1 v1.5 (
rsa_pkcs1_sha256). - Hostnames:
*.com-style wildcards and wildcards matching IP addresses are rejected. - Record padding: TLS 1.3 record padding is removed correctly.
API
recv_all(max_size, allow_truncation=False)close_notify_received() -> Bool- Unchanged for
recv(): at a bare TCP close it still raises an error containing "connection closed", so existing read-to-close callers behave as before.
Interoperability
- TLS 1.2 ServerKeyExchange accepts RSA-PSS, which the ClientHello already offered.
rsa_pkcs1_sha512, which could not be verified, is no longer offered. TLS 1.2 RSA servers such as badssl.com previously failed the handshake.
See the README's "End of stream" and "Security status" sections.