--enable-chain-verify-cb reached wolfSSL master in wolfSSL/wolfssl#11367
and no release carries it. configure exits 1 on an unrecognized --enable-*,
so carrying the flag in the shared tls profile failed that whole directory
on the stable tag rather than just skipping the one example.
Give it its own profile and its own entry, pinned to master with
wolfssl_ref, the way pkcs7-signeddata-stream already is. The other 22 tls
targets keep testing the released library. The entry builds only the two
binaries its pair needs, since the tls entry builds the rest against both
refs already.
wolfssl-matrix built every profile for every ref and then seeded whatever
pins were missing, so a profile no unpinned entry uses was still built for
refs its flags predate. Build the (profile, ref) pairs entries actually ask
for instead, which covers the pinned ones and drops the impossible ones.
The trust service thread calls wolfSSL, so joining it after
wolfSSL_Cleanup() could tear down library state the thread was still
using. Stop the service first.
Three error paths alongside it:
- Size the anchor file before allocating for it. A ftell() of -1 became a
SIZE_MAX malloc, and the read failure path returned without freeing.
- Destroy the mutex and condition variable and free the anchor when
pthread_create() fails, so a service that never started leaves nothing
behind.
- Keep the socket's existing flags when setting O_NONBLOCK, and fail if
either fcntl() does, rather than running blocking without saying so.
The example needs --enable-chain-verify-cb, which the tls profile did not
carry, so client-tls-chainverifycb built as the stub that prints "wolfSSL
was built without --enable-chain-verify-cb" and nothing ran it. Add the
flag, and a pair entry that runs it against server-tls.
The flag only defines WOLFSSL_CHAIN_VERIFY_CB. WOLFSSL_ASYNC_IO is already
on in this profile, so nothing else in tls/ is affected.
server-tls presents ../certs/server-cert.pem on port 11111, which the
client's default anchor ../certs/ca-cert.pem issued, so the pair needs no
arguments beyond the host.
A TLS client whose root of trust lives outside wolfSSL. No CA is loaded
into the context; a chain verify callback hands the server's certificates
to a trust service on its own thread, standing in for an HSM that holds
the anchors, and defers the handshake with CHAIN_VERIFY_WANT_E until the
service has a verdict. Switches show the handshake failing with no
callback installed and with the service rejecting the chain.
Requires wolfSSL built with --enable-chain-verify-cb.
certvfy: wc_ParseCert() now takes a WOLFSSL_CERT_MANAGER*, so a Signer
can no longer be passed as the CA. Check the issuer and verify the
signature with wc_CheckCertSigPubKey() instead.
tls: NO_SESSION_CACHE_REF is now the default, so a session from
wolfSSL_get_session() is freed with its connection. Use
wolfSSL_get1_session() in client-tls13-resume and client-tls-perf.
recvfrom() returns 0 for an empty UDP datagram. The server treated that
as fatal, so any peer could stop it with a single empty packet. Also
retry EINTR/EAGAIN and report other receive errors.