Nothing in the standard enforces an upper limit, and we can try
documenting an open range in the Security Policy. Worst case, this is
easy to revert.
For #69536
Change-Id: Id3082e73556fdcd6d2e6c2054c512516e9156c5c
Reviewed-on: https://go-review.googlesource.com/c/go/+/632536
Auto-Submit: Filippo Valsorda <filippo@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
return nil, errors.New("rsa: key too small")
}
fips140.RecordApproved()
- if bits < 2048 || bits > 16384 || bits%2 == 1 {
+ if bits < 2048 || bits%2 == 1 {
fips140.RecordNonApproved()
}
// FIPS 186-5, Section 5.1: "This standard specifies the use of a modulus
// whose bit length is an even integer and greater than or equal to 2048
// bits."
- if pub.N.BitLen() < 2048 || pub.N.BitLen() > 16384 {
+ if pub.N.BitLen() < 2048 {
fipsApproved = false
}
if pub.N.BitLen()%2 == 1 {
if pub.N.BitLen() < 2048 {
return errors.New("crypto/rsa: use of keys smaller than 2048 bits is not allowed in FIPS 140-only mode")
}
- if pub.N.BitLen() > 16384 {
- return errors.New("crypto/rsa: use of keys larger than 16384 bits is not allowed in FIPS 140-only mode")
- }
if pub.N.BitLen()%2 == 1 {
return errors.New("crypto/rsa: use of keys with odd size is not allowed in FIPS 140-only mode")
}
if fips140only.Enabled && bits < 2048 {
return nil, errors.New("crypto/rsa: use of keys smaller than 2048 bits is not allowed in FIPS 140-only mode")
}
- if fips140only.Enabled && bits > 16384 {
- return nil, errors.New("crypto/rsa: use of keys larger than 16384 bits is not allowed in FIPS 140-only mode")
- }
if fips140only.Enabled && bits%2 == 1 {
return nil, errors.New("crypto/rsa: use of keys with odd size is not allowed in FIPS 140-only mode")
}