mirror of
https://github.com/golang/go
synced 2024-11-23 16:00:06 -07:00
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>
This commit is contained in:
parent
9558ba293f
commit
c0094338fb
@ -36,7 +36,7 @@ func emsaPSSEncode(mHash []byte, emBits int, salt []byte, hash hash.Hash) ([]byt
|
||||
// 3. If emLen < hLen + sLen + 2, output "encoding error" and stop.
|
||||
|
||||
if emLen < hLen+sLen+2 {
|
||||
return nil, errors.New("crypto/rsa: encoding error")
|
||||
return nil, errors.New("crypto/rsa: key size too small for PSS signature")
|
||||
}
|
||||
|
||||
em := make([]byte, emLen)
|
||||
|
Loading…
Reference in New Issue
Block a user