Skip to content

Commit 82aa1e3

Browse files
yaronfcursoragent
andcommitted
Improve fuzz suite: unique names, richer seeds, CI smoke
Rename overlapping fuzz targets so -fuzz matches one function, harden harness invariants, expand SFV/trailer/digest seeds, and add a short CI fuzz job plus maintainer playbook. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent df20e0c commit 82aa1e3

5 files changed

Lines changed: 297 additions & 117 deletions

File tree

.github/workflows/test.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,25 @@ jobs:
1515
cache: false
1616
- name: Test
1717
run: go test ./...
18+
19+
fuzz:
20+
runs-on: ubuntu-latest
21+
env:
22+
GOTOOLCHAIN: local
23+
steps:
24+
- name: Checkout code
25+
uses: actions/checkout@v6
26+
- name: Install Go
27+
uses: actions/setup-go@v6
28+
with:
29+
go-version: '1.27'
30+
cache: false
31+
- name: Fuzz smoke
32+
# Short per-target budget (~75s total). See internal-docs/FUZZ.md.
33+
run: |
34+
set -euo pipefail
35+
for target in FuzzVerifyRequest FuzzVerifyViaMessage FuzzSignAndVerifyHMAC FuzzHMACViaMessage FuzzNewMessage; do
36+
echo "::group::fuzz $target"
37+
go test -run='^$' -fuzz="$target" -fuzztime=15s .
38+
echo "::endgroup::"
39+
done

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Optional foreign JWS uses `lestrrat-go/jwx/v4` via `NewJWSSigner` / `NewJWSVerif
6161
### Testing conventions
6262

6363
- `signatures_test.go` contains the full RFC 9421 test vector suite (134 KB) — do not modify without understanding the spec.
64-
- `fuzz_test.go` has fuzz entry points; seed corpus lives in `testdata/fuzz/`.
64+
- `fuzz_test.go` has fuzz entry points (`FuzzVerifyRequest`, `FuzzVerifyViaMessage`, `FuzzSignAndVerifyHMAC`, `FuzzHMACViaMessage`, `FuzzNewMessage`); see [internal-docs/FUZZ.md](internal-docs/FUZZ.md). Seed corpus: `f.Add` plus optional `testdata/fuzz/`.
6565
- `http2_test.go` and `trailer_test.go` cover HTTP/2 and trailer-header edge cases.
6666
- Tests use `github.com/stretchr/testify` assertions and `github.com/andreyvit/diff` for readable diffs.
6767

0 commit comments

Comments
 (0)