1
0
mirror of https://github.com/golang/go synced 2024-11-23 18:20:04 -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:
Filippo Valsorda 2018-02-08 16:19:24 +01:00 committed by Brad Fitzpatrick
parent 9558ba293f
commit c0094338fb

View File

@ -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. // 3. If emLen < hLen + sLen + 2, output "encoding error" and stop.
if emLen < hLen+sLen+2 { 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) em := make([]byte, emLen)