diff options
Diffstat (limited to 'libgo/go/crypto/rsa/pss.go')
-rw-r--r-- | libgo/go/crypto/rsa/pss.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libgo/go/crypto/rsa/pss.go b/libgo/go/crypto/rsa/pss.go index 8a94589..1ba194a 100644 --- a/libgo/go/crypto/rsa/pss.go +++ b/libgo/go/crypto/rsa/pss.go @@ -64,7 +64,7 @@ func emsaPSSEncode(mHash []byte, emBits int, salt []byte, hash hash.Hash) ([]byt hash.Reset() // 7. Generate an octet string PS consisting of emLen - sLen - hLen - 2 - // zero octets. The length of PS may be 0. + // zero octets. The length of PS may be 0. // // 8. Let DB = PS || 0x01 || salt; DB is an octet string of length // emLen - hLen - 1. @@ -246,7 +246,7 @@ func (opts *PSSOptions) saltLength() int { // Note that hashed must be the result of hashing the input message using the // given hash function. The opts argument may be nil, in which case sensible // defaults are used. -func SignPSS(rand io.Reader, priv *PrivateKey, hash crypto.Hash, hashed []byte, opts *PSSOptions) (s []byte, err error) { +func SignPSS(rand io.Reader, priv *PrivateKey, hash crypto.Hash, hashed []byte, opts *PSSOptions) ([]byte, error) { saltLength := opts.saltLength() switch saltLength { case PSSSaltLengthAuto: @@ -260,8 +260,8 @@ func SignPSS(rand io.Reader, priv *PrivateKey, hash crypto.Hash, hashed []byte, } salt := make([]byte, saltLength) - if _, err = io.ReadFull(rand, salt); err != nil { - return + if _, err := io.ReadFull(rand, salt); err != nil { + return nil, err } return signPSSWithSalt(rand, priv, hash, hashed, salt) } |