Skip to content

v1.2.0

Latest

Choose a tag to compare

@github-actions github-actions released this 24 Oct 04:56
7da2c59

MbedTLS v1.2.0

Diff since v1.1.11

Memory-safety, thread-safety and correctness fixes (#280–#325). HTTP.jl 1.x's test suite passes against this release.

Fixes

  • Thread safety: the bundled Mbed TLS has no locks of its own, so CtrDrbg, Entropy, and every handshake and key operation now take Julia locks. Threads sharing an SSLConfig no longer send duplicate random values or corrupt a shared private key.
  • Reading from a TLS connection no longer waits behind a write that is blocked on a slow peer.
  • Use-after-free and buffer-overflow fixes in ALPN setup, own_cert!, EC signing, entropy sources, custom RNGs, and the digest, cipher and RSA helpers.
  • read(ctx), readline, read(ctx, Char), get_peer_cert, copy(::MD), encrypt with a Cipher object, get_key_bitlen and rand(rng, Float64) now work.
  • A CA bundle containing a certificate Mbed TLS can't parse no longer breaks every connection.
  • log_secrets logs per config and no longer slows down later connections.
  • With renegotiation enabled, writes during a peer-initiated renegotiation wait instead of failing.

Behavior changes

  • Undersized output buffers, and hashes of the wrong size, throw ArgumentError instead of overrunning memory.
  • encrypt/decrypt/crypt! refuse authenticated modes (GCM, CCM, ChaCha20-Poly1305), whose tag they never produced or checked.
  • alpn_proto returns nothing when no protocol was negotiated; get_peer_cert returns a copy, or nothing.
  • Reads at end of stream return no data instead of throwing; close no longer throws after a peer reset.
  • readbytes! grows its buffer and returns an Int; write(::MD, x) returns the number of bytes written.
  • rand!(::CtrDrbg, A) fills non-integer arrays with proper samples.
  • Parsing into a PKContext that already holds a key, and set_alpn! with an empty list, throw ArgumentError.
  • Handshakes and key operations share one process-wide lock.

New

  • parse_key, parse_public_key, RSA(::PKContext), mpi_export/mpi_export!, get_type, complete!; CtrDrbg works with Random's samplers.

Merged pull requests:

  • pk/rsa: Fix GC rooting issues and fill out API (#280) (@Keno)
  • Add parse_key and parse_public_key methods (#282) (@devmotion)
  • Bump codecov/codecov-action from 5 to 6 (#289) (@dependabot[bot])
  • Specialize the bio callbacks on the bio's type (#291) (@asinghvi17)
  • Bump julia-actions/setup-julia from 2 to 3 (#292) (@dependabot[bot])
  • [Documentation] Reattach the docstring for SSLConfig(cert_file, key_file) (#293) (@sotashimozono)
  • Use Base's GMP library name in ccall (#294) (@KristofferC)
  • ssl: distrust the compromised eMudhra intermediate CA keys (#296) (@IanButterworth)
  • Fix the symmetric cipher helpers (#298) (@quinnj)
  • Fix copy and write for message digests (#299) (@quinnj)
  • Make CtrDrbg safe and usable as an AbstractRNG (#300) (@quinnj)
  • Check buffer sizes in the key and RSA functions (#301) (@quinnj)
  • Fix ALPN lifetime, get_peer_cert, long cert info, and byte reads (#302) (@quinnj)
  • Document that readavailable(::SSLContext) doesn't wait for data (#303) (@quinnj)
  • Skip unparsable CAs in the default bundle; fix get_key_bitlen (#304) (@quinnj)
  • Let readbytes! grow the buffer, so read(ctx) works (#305) (@quinnj)
  • Fix the README example and TagBot (#306) (@quinnj)
  • Check output sizes in the digest and cipher functions (#307) (@quinnj)
  • Lock CtrDrbg so threads sharing an SSLConfig don't repeat random bytes (#308) (@quinnj)
  • Keep every own_cert! pair alive, not just the last (#309) (@quinnj)
  • Fix reads at end of stream, close after a reset, and empty records (#310) (@quinnj)
  • Refuse authenticated cipher modes in encrypt/decrypt (#311) (@quinnj)
  • Write TLS records after releasing the context lock (#312) (@quinnj)
  • Log TLS secrets per config, through mbedtls's key-export callback (#313) (@quinnj)
  • Take turns on handshakes that share an SSLConfig (#314) (@quinnj)
  • Use one process-wide lock for key operations and handshakes (#315) (@quinnj)
  • Lock Entropy so generators seeded from it on several threads differ (#316) (@quinnj)
  • Let writes wait out a peer-initiated renegotiation instead of asserting (#317) (@quinnj)
  • Give mbedtls the stored entropy source and RNG, not temporary copies (#318) (@quinnj)
  • Hold MBEDTLSLOCK while ca_chain!, own_cert! and set_alpn! change a config (#319) (@quinnj)
  • Let writes wait when a renegotiation meets application data (#320) (@quinnj)
  • Keep every ALPN list, copy ALPN names to Strings, store raw rng!/dbg! objects (#321) (@quinnj)
  • Re-seed a CtrDrbg in a fresh context; keep raw add_source! objects alive (#322) (@quinnj)
  • Don't let a write wait forever after a read finishes the renegotiation (#323) (@quinnj)
  • Fix isreadable stealing data, key re-parse, failed re-seed, empty CRT info, empty ALPN (#324) (@quinnj)
  • Fix crypt! decrypt sizes, empty CRT display, and read(ctx, Char) (#325) (@quinnj)
  • Bump version to 1.2.0 (#326) (@quinnj)

Closed issues:

  • More errors building MbedTLS in Windows. (#172)
  • Program crash due to bus error (#182)
  • Could not unpack MbedTLS (#184)
  • MbedTLS > 0.6.3 problem with WebSockets (#186)
  • MbedTLS has build errors (#187)
  • libmbedx509.dll missing crt_parse (#190)
  • Incorrect libmbedtls.dll and libmbedx509.dll in v0.6.7 for Windows (#195)
  • ERROR: MbedTLS.SSLContext does not support byte I/O (#197)
  • Build / using errors (#198)
  • Build issue on macos Mojave (#199)
  • Make CtrDrbg easier to use (#207)
  • Julia version in Project.toml (#208)
  • build fails on julia 1.2, Win10 X64 (#209)
  • Testing MbedTLS on Julia master sometimes crashes (#215)
  • Can not build it for use in IJulia (#222)
  • MbedTLS error code -28800 (#223)
  • Unable to install in Julia 1.5.1 (#225)
  • MbedTLS_jll started failing to load (#229)
  • Delay after initial write (#236)
  • MbedTLS 1.1.1 breaks S3.put_object() (#247)
  • possible performance issue: mbedtls_gcm_update CPU utilization (#254)
  • encrypt method mentioned in the documentation does not actually work (#263)
  • CPU use skyrockets and program bricks when connection closed by server (#264)
  • MbedTLS changed ABI (#278)
  • Distrust the compromised eMudhra intermediate CA keys (#295)