Skip to content

Commit c009433

Browse files
FiloSottilebradfitz
authored andcommitted
crypto/rsa: improve error message for keys too short for PSS
Fixes #23736 Change-Id: I850d91a512394c4292927d51c475064bfa4e3053 Reviewed-on: https://go-review.googlesource.com/92815 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
1 parent 9558ba2 commit c009433

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/crypto/rsa/pss.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func emsaPSSEncode(mHash []byte, emBits int, salt []byte, hash hash.Hash) ([]byt
3636
// 3. If emLen < hLen + sLen + 2, output "encoding error" and stop.
3737

3838
if emLen < hLen+sLen+2 {
39-
return nil, errors.New("crypto/rsa: encoding error")
39+
return nil, errors.New("crypto/rsa: key size too small for PSS signature")
4040
}
4141

4242
em := make([]byte, emLen)

0 commit comments

Comments
 (0)