Repository navigation
flare v0.13.1 fixes HTTPS on Linux with the default TlsConfig, a link failure on macOS and a crash in the TLS shim on macOS. It also closes a related NUL-byte gap at the C boundary. There are 18 commits since v0.13.0 and no API changes. The one behavior change is that an empty SNI is now refused.
Fixes
- HTTPS failed by default on Linux with
CA bundle load failed(#42). With a defaultTlsConfig, an emptyca_bundlepassed the pointer of an emptyStringto OpenSSL. On Linux that pointer does not point at"", soSSL_CTX_load_verify_locationsreceived a garbage path. An emptyca_bundlenow passes NULL, which loads the system trust store. An explicitca_bundlebehaves as before. The check runs once perSSL_CTX, so the request path is unchanged. - macOS builds failed to link with
Symbols not found: [ _eventfd_write ](#43). The accept balancer callseventfd_writeand only runs on Linux, but the call was compiled in everywhere. Anything that reached the unified reactor, including the HTTP client, the WebSocket server and the gRPC client, could not link on macOS. The call is now compiled on Linux only (#44). - The TLS shim crashed on macOS after its last
dlclose(#45). Since the shim's error buffer moved to a pthread key, nothing keptlibflare_tlsmapped. The lastdlcloseunmapped it while OpenSSL and the key's destructor still pointed into it, and every fork-based test intests/tls/test_tls.mojosegfaulted. The shim now takes anRTLD_NODELETEreference to itself from a constructor. This also fixes therecipe.yamlbuild, which never passed-z nodelete, so the conda package could not be loaded on Linux either.
Hardening
Issue #42 was one way a char* goes wrong at the C boundary. Another is a string that contains a NUL, which C reads cut short. Before this release, unlink("victim\0x") deleted victim, inet_pton("1.2.3.4\0junk") reported a valid address, and getaddrinfo resolved "localhost\0.evil" as localhost. The public parsers (IpAddr, SocketAddr, resolve) already refused a NUL, so these were not reachable through them.
flare/net/cstr.mojo is a new sans-I/O kernel that decides whether a string passes, goes as NULL, or is refused, based on what an empty value means to the C parameter. It now covers every char* flare hands C: the TLS client and server certificate, key, CA and SNI arguments, getaddrinfo, inet_pton and unlink. An empty SNI is refused because the C side skips hostname verification for an empty name. The kernel runs only during context setup and address parsing.
tests/net/test_cstr.mojo covers each wrapper, and fuzz-cstr ran 200K clean cases against libc strlen and memcmp.
Formal models and docs
The Lean models gained a proof that every verdict of the char* kernel meets its spec, a difftest that compares the kernel with what libc reads back, and proofs for the HPACK integer decoder, the QUIC varint encoder and decoder, and the H1 framing, field-value and response-head parsers. Witnesses show the hypotheses of the headline theorems can hold, theorem statements are locked, and the SIMD Huffman decoder shared by HPACK and QPACK now has a difftest. The Lean models are still not part of CI. The README also has HttpArena results.
Upgrading
Nothing to change. If you pinned tag = "v0.13.0" and hit one of the failures above, move the tag to v0.13.1.
Thanks
- @abhisheksreesaila reported #42 with a gdb trace that found the cause, a working
ca_bundleworkaround and a suggested fix. - @adnlz reported #43, reproduced it with a minimal
pixi.tomland the README example, and confirmed the fix. - @winding-lines wrote both macOS fixes, #44 and #45, with before and after test results for each.
Full Changelog: v0.13.0...v0.13.1