Skip to content

Commit e64b4cf

Browse files
committed
Add ECDSA P-521 support for XDS interface
Signed-off-by: Tero Saarni <[email protected]>
1 parent 284fce7 commit e64b4cf

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add support for the SECP521R1 curve, enabling the use of EC certificates with 521-bit private keys in the xDS gRPC interface between Envoy and Contour.

internal/envoy/v3/bootstrap.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,22 @@ func upstreamSdsTLSContext(certificateSdsFile, validationSdsFile string) *envoy_
360360
CommonTlsContext: &envoy_transport_socket_tls_v3.CommonTlsContext{
361361
TlsParams: &envoy_transport_socket_tls_v3.TlsParameters{
362362
TlsMaximumProtocolVersion: envoy_transport_socket_tls_v3.TlsParameters_TLSv1_3,
363+
// To allow use of ECDSA P-521 certs for xDS the default signature algorithms list is overridden.
364+
// This override is a temporary workaround until BoringSSL includes "ecdsa_secp521r1_sha512" in the default list.
365+
// The default list can be found here:
366+
// https://github.com/google/boringssl/blob/45a865d6682a7bc989143d73466ade7728959324/ssl/extensions.cc#L275-L293
367+
SignatureAlgorithms: []string{
368+
"ecdsa_secp256r1_sha256",
369+
"rsa_pss_rsae_sha256",
370+
"rsa_pkcs1_sha256",
371+
"ecdsa_secp384r1_sha384",
372+
"rsa_pss_rsae_sha384",
373+
"rsa_pkcs1_sha384",
374+
"ecdsa_secp521r1_sha512",
375+
"rsa_pss_rsae_sha512",
376+
"rsa_pkcs1_sha512",
377+
"rsa_pkcs1_sha1",
378+
},
363379
},
364380
TlsCertificateSdsSecretConfigs: []*envoy_transport_socket_tls_v3.SdsSecretConfig{{
365381
Name: "contour_xds_tls_certificate",

internal/envoy/v3/bootstrap_test.go

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1595,7 +1595,19 @@ func TestBootstrap(t *testing.T) {
15951595
"@type": "type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.UpstreamTlsContext",
15961596
"common_tls_context": {
15971597
"tls_params": {
1598-
"tls_maximum_protocol_version": "TLSv1_3"
1598+
"tls_maximum_protocol_version": "TLSv1_3",
1599+
"signature_algorithms": [
1600+
"ecdsa_secp256r1_sha256",
1601+
"rsa_pss_rsae_sha256",
1602+
"rsa_pkcs1_sha256",
1603+
"ecdsa_secp384r1_sha384",
1604+
"rsa_pss_rsae_sha384",
1605+
"rsa_pkcs1_sha384",
1606+
"ecdsa_secp521r1_sha512",
1607+
"rsa_pss_rsae_sha512",
1608+
"rsa_pkcs1_sha512",
1609+
"rsa_pkcs1_sha1"
1610+
]
15991611
},
16001612
"tls_certificate_sds_secret_configs": [
16011613
{

0 commit comments

Comments
 (0)