Repository navigation
Add testing infrastructure - #37
Open
JeremiahM37 wants to merge 7 commits into
Open
JeremiahM37 wants to merge 7 commits into
JeremiahM37 wants to merge 7 commits into
Conversation
JeremiahM37
force-pushed
the
go-testing
branch
12 times, most recently
from
May 1, 2026 16:25
a82d158 to
3888aa6
Compare
JeremiahM37
marked this pull request as ready for review
May 1, 2026 16:37
JeremiahM37
force-pushed
the
go-testing
branch
from
November 4, 2026 00:50
6da7e46 to
bdf81d8
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Certificate-generation tests still fail rather than skip when WOLFSSL_CERT_GEN is unavailable, and the sanitizer job lacks Go’s -asan flag, leaving native out-of-bounds accesses to Go-allocated buffers potentially undetected.
2 open issues
What changed in this PR
Adds testing infrastructure for go-wolfssl’s crypto wrappers and higher-level packages, with compatibility fixes for reduced-feature wolfSSL builds.
Changes:
- Adds known-answer, round-trip, differential, and boundary tests.
- Adds C-heap key allocation helpers and missing-feature error handling.
- Expands CI configuration coverage, adds sanitizer testing and staticcheck, and updates Go dependencies.
| File | Description |
|---|---|
x509.go |
Adds a fallback for unavailable object parsing. |
x509_test.go |
Tests X509, BIO, and ASN.1 boundaries. |
wolfx509/skip_test.go |
Adds a missing-certgen skip helper. |
wolfx509/parsecerts_test.go |
Skips selected tests without certgen. |
wolfx509/name.go |
Removes unused comparison helpers. |
wolfx509/certgen_wolfcrypt.go |
Adds certgen stubs and sentinel errors. |
wolfx509/certgen_test.go |
Adds missing-feature skips to selected tests. |
wolftls/tls_test.go |
Skips ALPN testing when unavailable. |
wolftls/conn.go |
Exposes a missing-feature sentinel for ALPN. |
testing_helpers_test.go |
Shares feature-gating helpers. |
ssl_test.go |
Tests error strings and library version. |
random_test.go |
Tests RNG output and size boundaries. |
misc.go |
Exports NOT_COMPILED_IN. |
misc_test.go |
Tests comparison and memory clearing. |
hmac_test.go |
Adds HMAC and HKDF tests. |
hash_test.go |
Tests hash vectors, streaming, and bounds. |
go.sum |
Records dependency checksums. |
go.mod |
Raises minimum Go version and declares dependencies. |
ecc.go |
Adds C-heap ECC key lifecycle helpers. |
ecc_test.go |
Tests ECC signing and key operations. |
curve25519.go |
Adds C-heap Curve25519 key lifecycle helpers. |
curve25519_test.go |
Tests shared-secret agreement. |
correctness_test.go |
Tests crypto input dependence and authentication. |
chacha_poly_test.go |
Tests ChaCha variants and authentication failures. |
boundary_test.go |
Tests invalid-input rejection without panics. |
blake2_test.go |
Tests Blake2s hashing and MAC behavior. |
aes_test.go |
Tests AES modes and PBKDF2 behavior. |
.github/workflows/linters.yml |
Expands vet coverage and adds staticcheck. |
.github/workflows/build.yml |
Expands wolfSSL configurations and runs package tests. |
.github/workflows/address-sanitizer.yml |
Adds sanitizer-instrumented builds and testing. |
Review effort: Balanced
| } | ||
| der, err := CreateCertificate(tmpl, tmpl, k, k) | ||
| if err != nil { | ||
| skipIfCertGenMissing(t, err) |
| CGO_LDFLAGS: "-L/usr/local/lib -fsanitize=address" | ||
| # Detect leaks at exit; abort on any error. | ||
| ASAN_OPTIONS: "detect_leaks=1:halt_on_error=1:strict_string_checks=1:print_stacktrace=1" | ||
| run: go test -count=1 -v . ./handles ./wolftls ./wolfx509 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Adds a Go test suite and CI infrastructure for go-wolfssl
Tests — ~80 unit tests across crypto wrappers (AES, Blake2, ChaCha20-Poly1305, Curve25519, ECC, hashes, HMAC, RNG, X509, SSL boundary), plus differential and panic-recovery suites. All gate cleanly on
notCompiledIn(-174) for minimal builds.Source fixes (separate commits, each fixing a real bug):
Wc_Curve25519_AllocKey/Wc_Ecc_AllocKey— allocate keys on the C heap so wolfSSL's pointer-typed struct fields don't trip cgo's "Go pointer to unpinned Go pointer" check#ifndef HAVE_ALPN/WOLFSSL_CERT_EXTcgo stubs inssl.go/x509.goso non---enable-allconfigs linkwolfx509/wolftlsnow build and test cleanly across all matrix configs (sentinel error for cert generation, skip on missing ALPN)CI — build matrix now Go 1.21/1.22/1.23 × 3 wolfSSL configures (full, modern TLS 1.3 stack, DTLS 1.3); adds AddressSanitizer + linters (vet + staticcheck) workflows. Build/test now covers the
handles,wolftls, andwolfx509subpackages.