aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/crypto/rsa/pss.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/crypto/rsa/pss.go')
-rw-r--r--libgo/go/crypto/rsa/pss.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/libgo/go/crypto/rsa/pss.go b/libgo/go/crypto/rsa/pss.go
index b2adbed..814522d 100644
--- a/libgo/go/crypto/rsa/pss.go
+++ b/libgo/go/crypto/rsa/pss.go
@@ -269,7 +269,7 @@ func SignPSS(rand io.Reader, priv *PrivateKey, hash crypto.Hash, digest []byte,
saltLength := opts.saltLength()
switch saltLength {
case PSSSaltLengthAuto:
- saltLength = priv.Size() - 2 - hash.Size()
+ saltLength = (priv.N.BitLen()-1+7)/8 - 2 - hash.Size()
case PSSSaltLengthEqualsHash:
saltLength = hash.Size()
}