Skip to content

Fix JWS base64url padding vectors - #281

Open
sean0407 wants to merge 1 commit into
C2SP:mainfrom
sean0407:codex/fix-jws-padding-vectors-236
Open

sean0407 wants to merge 1 commit into
C2SP:mainfrom
sean0407:codex/fix-jws-padding-vectors-236

Conversation

@sean0407

Copy link
Copy Markdown

Issue

Fixes #236. Test cases 367 and 370 carried the same compact JWS as valid test case 357, so their invalidBase64Padding labels did not match the encoded input.

Change

  • Add forbidden Base64 padding to the signature segment in test case 367.
  • Add forbidden Base64 padding to the payload segment in test case 370 and recompute its HMAC-SHA256 signature over the padded payload.

Verification

  • GOEXPERIMENT=jsonv2 go run ./tools/vectorgen fmt --check 'testvectors_v1/*.json' — passed.
  • GOEXPERIMENT=jsonv2 go run ./tools/vectorgen lint — passed: 343 valid vector files, 0 invalid, 0 without a schema.
  • Independent HMAC-SHA256 checks confirmed the corrected signature bytes match the respective JWS signing inputs.
  • git diff --check — passed.

@cpu

cpu commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

Vector Lint / gostaticcheck (pull_request) Failing after 1m

Would you mind rebasing on current main? This should fix itself afterwards.

@sean0407
sean0407 force-pushed the codex/fix-jws-padding-vectors-236 branch from 5a1a3cb to e9cf570 Compare October 21, 2026 07:40
@sean0407

Copy link
Copy Markdown
Author

I rebased the commit onto current main; the stable patch-id is unchanged and git diff --check passes. The latest run has vectorlint, gostaticcheck, and golint green; govulncheck fails on GO-2026-6809 in the Go standard library (crypto/x509 in Go 1.27.2), reached from tools/vectorgen/main.go. Could you confirm whether that repository-level toolchain finding should stay outside this test-vector change?

@botovq

botovq commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Another rebase onto main will pick up #283 and should fix the failing test.

@sean0407
sean0407 force-pushed the codex/fix-jws-padding-vectors-236 branch from e9cf570 to 7db7db3 Compare October 24, 2026 23:27
@sean0407

Copy link
Copy Markdown
Author

Rebased codex/fix-jws-padding-vectors-236 onto current upstream main, including merged #283 (d17cc89). The patch-id remains unchanged (95e99ff), and git diff --check passed. GitHub has started a fresh run; govulncheck and the other checks are currently pending.

@sean0407

Copy link
Copy Markdown
Author

Update: GitHub’s fresh checks on rebased head 7db7db3 have all passed: golint, gostaticcheck, govulncheck, and vectorlint.

@sean0407

Copy link
Copy Markdown
Author

I rebased onto current main with #283; govulncheck, gostaticcheck, golint, and vectorlint all pass on 7db7db3. Please let me know if anything else is needed, or merge when convenient.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

json_web_signature_test.json: tcIds 357/367/370 are byte-identical with contradictory result labels

3 participants