Commit c0094338 authored by Filippo Valsorda's avatar Filippo Valsorda Committed by Brad Fitzpatrick

crypto/rsa: improve error message for keys too short for PSS

Fixes #23736

Change-Id: I850d91a512394c4292927d51c475064bfa4e3053
Reviewed-on: https://go-review.googlesource.com/92815Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 9558ba29
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment