go-wolfssl
go-wolfssl wraps wolfSSL and wolfCrypt for Go, with a crypto/tls style Conn and an X.509 package. I fixed bugs in wolftls, wolfx509 and the examples.
Main changes
- Fixed wolftls Conn lifecycle, concurrency and errors: Read no longer holds the session lock, and EOF and timeouts match crypto/tls.#67
- Fixed wolftls Config: intermediate chains, GetCertificate fallback, ALPN and cipher validation, TLS 1.2 default minimum, IP literal ServerName.#68
- Fixed wolfx509: ParseCertificate fills extensions and SANs, and Verify returns the chain and enforces extended key usage.#69
- Fixed bugs and unsafe patterns in the example programs and added CI checks for them.#71
One design choice
I moved Conn.Read's wait on the transport outside the session lock, so Write stays unblocked while Read waits when wolfSSL has no write dup. A transport EOF before close_notify becomes io.ErrUnexpectedEOF, and io.EOF is returned only for a real close_notify.
A bug I fixed
The PSK example callbacks copied the identity with the caller's length and ignored the key buffer size. The fix returns 0 when the identity or key does not fit, and the server callback now matches the full identity instead of a prefix. (#71)
How it was checked
| PR | Evidence |
|---|---|
| #71 | CI builds the PSK callbacks under AddressSanitizer and checks undersized buffers return 0. |
| #67 | New wolftls-race workflow runs go test -race, plus TestConcurrentReadWrite payload checks. |
What is not done yet
Behavior depends on how wolfSSL was configured. Concurrent Read and Write only run in parallel with --enable-writedup. Several more fixes are still open.