Skip to content

Commit fbdd994

Browse files
FiloSottilegopherbot
authored andcommitted
crypto/tls: allow P-521 in FIPS 140-3 mode and Go+BoringCrypto
Partially reverts CL 587296, restoring the Go+BoringCrypto 1.23 behavior in terms of supported curves. Updates #71757 Change-Id: I6a6a465651a8407056fd0fae091d10a945b37997 Reviewed-on: https://go-review.googlesource.com/c/go/+/657095 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Daniel McCarney <[email protected]> Reviewed-by: David Chase <[email protected]> Reviewed-by: Roland Shoemaker <[email protected]> Auto-Submit: Filippo Valsorda <[email protected]>
1 parent 12ea4f7 commit fbdd994

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/crypto/tls/defaults.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ var defaultCipherSuitesTLS13NoAES = []uint16{
9292
}
9393

9494
// The FIPS-only policies below match BoringSSL's
95-
// ssl_compliance_policy_fips_202205, which is based on NIST SP 800-52r2.
95+
// ssl_compliance_policy_fips_202205, which is based on NIST SP 800-52r2, with
96+
// minor changes per https://go.dev/issue/71757.
9697
// https://cs.opensource.google/boringssl/boringssl/+/master:ssl/ssl_lib.cc;l=3289;drc=ea7a88fa
9798

9899
var defaultSupportedVersionsFIPS = []uint16{
@@ -102,7 +103,7 @@ var defaultSupportedVersionsFIPS = []uint16{
102103

103104
// defaultCurvePreferencesFIPS are the FIPS-allowed curves,
104105
// in preference order (most preferable first).
105-
var defaultCurvePreferencesFIPS = []CurveID{CurveP256, CurveP384}
106+
var defaultCurvePreferencesFIPS = []CurveID{CurveP256, CurveP384, CurveP521}
106107

107108
// defaultSupportedSignatureAlgorithmsFIPS currently are a subset of
108109
// defaultSupportedSignatureAlgorithms without Ed25519 and SHA-1.
@@ -115,6 +116,7 @@ var defaultSupportedSignatureAlgorithmsFIPS = []SignatureScheme{
115116
PKCS1WithSHA384,
116117
ECDSAWithP384AndSHA384,
117118
PKCS1WithSHA512,
119+
ECDSAWithP521AndSHA512,
118120
}
119121

120122
// defaultCipherSuitesFIPS are the FIPS-allowed cipher suites.

src/crypto/tls/fips_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ func isFIPSCipherSuite(id uint16) bool {
106106

107107
func isFIPSCurve(id CurveID) bool {
108108
switch id {
109-
case CurveP256, CurveP384:
109+
case CurveP256, CurveP384, CurveP521:
110110
return true
111111
}
112112
return false
@@ -130,6 +130,7 @@ func isFIPSSignatureScheme(alg SignatureScheme) bool {
130130
PKCS1WithSHA384,
131131
ECDSAWithP384AndSHA384,
132132
PKCS1WithSHA512,
133+
ECDSAWithP521AndSHA512,
133134
PSSWithSHA256,
134135
PSSWithSHA384,
135136
PSSWithSHA512:

0 commit comments

Comments
 (0)