Repository navigation
Beryl 0.2.2
Memory and polish for HTTPS servers: a --tls Amber app under 32 keep-alive
connections peaks at 15.8 to 19.6 MiB, down from 17.6 to 25.2 MiB on 0.2.1.
- A TLS socket keeps about 8 KiB per connection instead of about 103 KiB.
The record layer reads ahead into its own buffer, sized to the first record
and doubled only when a larger record arrives, up to the record limits; it
turns off read buffering on theIO::Bufferedbeneath it.TLS::Socket
reads straight from the opened record, soIO::Bufferedallocates no read
buffer, and writes gather in a small growable buffer sealed atflush, when
a record fills, or atclose.flush_on_newlineis honored. Handshake
reassembly storage is released once no message is waiting, and a server
socket wipes its resumption master secret when the handshake ends (#34). TLS::RecordProtection#wipenow also zeroes the AEAD's key material:
AES-GCM's expanded round keys and GHASH key state (H to H^8 on the
processor instructions), and the ChaCha20-Poly1305 key. Every
AuthenticatedEncryptiongainswipeandis_wiped?; once wiped, every
encryption, decryption and tag check raisesCrypto::KeyWiped. The check
is one branch on public state at each call, outside the per-block loops.- A certificate signed with SHA-1 (sha1WithRSAEncryption, ecdsa-with-SHA1,
dsa-with-SHA1) or MD5 is refused by its algorithm identifier, before any
signature check, with a message that names the hash: "the certificate for
CN=... is signed with SHA-1, which Beryl refuses (RFC 9155)". The new
FailureReason::SignatureAlgorithmRefusedmaps to the bad_certificate
alert in TLS. A SHA-1 CertificateVerify scheme, should one be configured,
raises with illegal_parameter and the same wording. scripts/fetch_vectors.rbaccepts manifest entries of kindgenerated:
fixtures made by a script in this repository, committed and pinned by
sha256 rather than downloaded. The first is
spec/vectors/beryl/sha1_signed_chains.pem, from
scripts/generate_sha1_signed_chains.sh(OpenSSL 4.1.0 pinned by version
and binary sha256).
Checks at the tagged commit
Release PR #35 on GitHub Actions; its head e46bf1b passed run 45699664111: 19 jobs green, one on-request job skipped. The merge commit has the same tree as the tested head (6e900023). main requires all 19 checks.
Measured for relay chunk B1 (M1 Max, wrk 4.2.0 pinned, 32 keep-alive connections): an Amber --tls app peaks at 15.8 to 19.6 MiB on 0.2.2 against 17.6 to 25.2 MiB on 0.2.1 and about 28 to 31 MiB with OpenSSL. testssl.sh 3.2.5 against an Amber --tls app: 0 critical, high or medium findings, grade A+.
Commit: 8ba496ec6dec614435e3dd8ac30fbf20e2d90e36
Tree: 6e900023799a4ec4b36c8d0983b5027108f62afc
Tarball: beryl-0.2.2.tar.gz (git archive --format=tar.gz --prefix=beryl-0.2.2/ 8ba496ec6dec614435e3dd8ac30fbf20e2d90e36)
Tarball sha256: 15cacec959287134d9230620ced5b3f559ed9b7fc8e3331c81ecddcb034fa791
The tarball was built twice from the commit and gave the same sha256 both times, and the copy attached here was downloaded again and matched.