diff options
author | Filippo Valsorda <filippo@golang.org> | 2023-03-08 17:35:30 +0100 |
---|---|---|
committer | Filippo Valsorda <filippo@golang.org> | 2023-05-17 11:57:35 +0000 |
commit | 7bc3281747030877e13d218ba12c6e95fcf4e7d4 (patch) | |
tree | 4092c38db0811786087c493725e5badcfe5f317a | |
parent | 547aed18e0db6a18c207731d56b60a24d0c69ba5 (diff) | |
download | go-git-7bc3281747030877e13d218ba12c6e95fcf4e7d4.tar.gz |
crypto/rsa: use BoringCrypto for 4096 bit keys
Fixes #58803
Change-Id: I097938ff61dae2b65214f8d0126d68de63525f5b
Reviewed-on: https://go-review.googlesource.com/c/go/+/474515
Run-TryBot: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
-rw-r--r-- | src/crypto/rsa/rsa.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/crypto/rsa/rsa.go b/src/crypto/rsa/rsa.go index adb76b6ce5..64a27660dc 100644 --- a/src/crypto/rsa/rsa.go +++ b/src/crypto/rsa/rsa.go @@ -286,7 +286,8 @@ func GenerateKey(random io.Reader, bits int) (*PrivateKey, error) { func GenerateMultiPrimeKey(random io.Reader, nprimes int, bits int) (*PrivateKey, error) { randutil.MaybeReadByte(random) - if boring.Enabled && random == boring.RandReader && nprimes == 2 && (bits == 2048 || bits == 3072) { + if boring.Enabled && random == boring.RandReader && nprimes == 2 && + (bits == 2048 || bits == 3072 || bits == 4096) { bN, bE, bD, bP, bQ, bDp, bDq, bQinv, err := boring.GenerateKeyRSA(bits) if err != nil { return nil, err |