Skip to content

Commit

Permalink
jws: fix RSA-PSS signatures
Browse files Browse the repository at this point in the history
We were picking the wrong salt length. Verified that previously
signatures could not be verified by jose or jwt.io, but succeed with
this change.
  • Loading branch information
imirkin committed Feb 18, 2021
1 parent 5d8f69a commit 2ed6931
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion jws/rsa.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func makeSignPSS(hash crypto.Hash) rsaSignFunc {
return nil, errors.Wrap(err, "failed to write payload using SignPSS")
}
return rsa.SignPSS(rand.Reader, key, hash, h.Sum(nil), &rsa.PSSOptions{
SaltLength: rsa.PSSSaltLengthAuto,
SaltLength: rsa.PSSSaltLengthEqualsHash,
})
}
}
Expand Down

0 comments on commit 2ed6931

Please sign in to comment.