go-jose / go-jose

An implementation of JOSE standards (JWE, JWS, JWT) in Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TestSignerWithBrokenRand fails on Go1.20

zhsj opened this issue · comments

commented
$ go version
go version go1.20rc3 linux/amd64
$ go test -v -run TestSignerWithBrokenRand
=== RUN   TestSignerWithBrokenRand
    signing_test.go:175: signer should fail if rand is broken RS256 0
    signing_test.go:175: signer should fail if rand is broken RS256 1
    signing_test.go:175: signer should fail if rand is broken RS384 0
    signing_test.go:175: signer should fail if rand is broken RS384 1
    signing_test.go:175: signer should fail if rand is broken RS512 0
    signing_test.go:175: signer should fail if rand is broken RS512 1
--- FAIL: TestSignerWithBrokenRand (0.02s)
FAIL
exit status 1
FAIL    github.com/go-jose/go-jose/v3   0.210s

Probably related to https://tip.golang.org/doc/go1.20#math/rand

The problem here is that random is deprecated in the call to rsa.PSignPKCS1v15() since Go 1.20.

See https://pkg.go.dev/crypto/rsa#SignPKCS1v15

You called that one @maraino. Nice spotting.