Skip to content

Beryl 0.2.2

Choose a tag to compare

@crimson-knight crimson-knight released this 25 Nov 21:28
8ba496e

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 the IO::Buffered beneath it. TLS::Socket
    reads straight from the opened record, so IO::Buffered allocates no read
    buffer, and writes gather in a small growable buffer sealed at flush, when
    a record fills, or at close. flush_on_newline is 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#wipe now 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
    AuthenticatedEncryption gains wipe and is_wiped?; once wiped, every
    encryption, decryption and tag check raises Crypto::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::SignatureAlgorithmRefused maps 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.rb accepts manifest entries of kind generated:
    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.