Skip to content

Commit

Permalink
the key doesn't support signing, we skip it.
Browse files Browse the repository at this point in the history
  • Loading branch information
shogo82148 committed Nov 7, 2022
1 parent ef58735 commit ee639ee
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions jws/fuzz_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ func FuzzJWS(f *testing.F) {
return
}

if key.PrivateKey() == nil {
return // the key doesn't support signing, we skip it.
}

msg2 := NewMessage(payload1)
if err := msg2.Sign(protected1, header1, protected1.Algorithm().New().NewSigningKey(key)); err != nil {
t.Fatal(err)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
go test fuzz v1
string("{\"payload\":\"eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFtcGxlLmNvbS9pc19yb290Ijp0cnVlfQ\",\"protected\":\"eyJhbGciOiJFUzI1NiJ9\",\"\":{\"2\":\"\xa2\xa2\xa27221101001292010\"},\"signature\":\"DtEhU3ljbEg8L38VWAfUAqOyKAM6-Xx-F4GawxaepmXFCgfTjDxw5djxLa8ISlSApmWQxfKTUJqPP3-Kg6NU1a\"}")
string("{\"kty\":\"EC\",\"crv\":\"P-256\",\"x\":\"f83OJ3D2xF1Bg8vub9tLe1gHMzV76e8Tus9uPHvRVEX\",\"y\":\"x_FEzRu9m36HLN_tue659LNpXW6pCyStikYjKIWI5a0\"}")

0 comments on commit ee639ee

Please sign in to comment.