Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crypto: support ECDHE when ec_point_formats is missing in ClientHello #49127

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/crypto/tls/handshake_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,9 @@ func supportsECDHE(c *Config, supportedCurves []CurveID, supportedPoints []uint8
}
}

supportsPointFormat := false
// RFC 8422, Section 5.1.2
// If this extension is missing, it means that only the uncompressed point format is supported
supportsPointFormat := len(supportedPoints) == 0
for _, pointFormat := range supportedPoints {
if pointFormat == pointFormatUncompressed {
supportsPointFormat = true
Expand Down
3 changes: 2 additions & 1 deletion src/crypto/tls/handshake_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ func TestTLS12OnlyCipherSuites(t *testing.T) {
}

func TestTLSPointFormats(t *testing.T) {
// Test that a Server returns the ec_point_format extension when ECC is
// Test that a Server returns the ec_point_formats extension when ECC is
// negotiated, and not returned on RSA handshake.
tests := []struct {
name string
Expand All @@ -290,6 +290,7 @@ func TestTLSPointFormats(t *testing.T) {
wantSupportedPoints bool
}{
{"ECC", []uint16{TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA}, []CurveID{CurveP256}, []uint8{compressionNone}, true},
{"ECC without ec_point_formats", []uint16{TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA}, []CurveID{CurveP256}, []uint8{}, true},
{"RSA", []uint16{TLS_RSA_WITH_AES_256_GCM_SHA384}, nil, nil, false},
}
for _, tt := range tests {
Expand Down