Add regression test for b/194177024. PiperOrigin-RevId: 386015465
diff --git a/quic/core/crypto/quic_crypto_client_config.h b/quic/core/crypto/quic_crypto_client_config.h index bb06260..847fc96 100644 --- a/quic/core/crypto/quic_crypto_client_config.h +++ b/quic/core/crypto/quic_crypto_client_config.h
@@ -362,6 +362,14 @@ // handshake message. const std::string& user_agent_id() const { return user_agent_id_; } + void set_tls_signature_algorithms(std::string signature_algorithms) { + tls_signature_algorithms_ = std::move(signature_algorithms); + } + + const absl::optional<std::string>& tls_signature_algorithms() const { + return tls_signature_algorithms_; + } + // Saves the |alpn| that will be passed in QUIC's CHLO message. void set_alpn(const std::string& alpn) { alpn_ = alpn; } @@ -435,6 +443,10 @@ // incorporating |pre_shared_key_| into the key schedule. std::string pre_shared_key_; + // If set, configure the client to use the specified signature algorithms, via + // SSL_set1_sigalgs_list. TLS only. + absl::optional<std::string> tls_signature_algorithms_; + // In QUIC, technically, client hello should be fully padded. // However, fully padding on slow network connection (e.g. 50kbps) can add // 150ms latency to one roundtrip. Therefore, you can disable padding of
diff --git a/quic/core/tls_client_handshaker.cc b/quic/core/tls_client_handshaker.cc index 932737a..737f449 100644 --- a/quic/core/tls_client_handshaker.cc +++ b/quic/core/tls_client_handshaker.cc
@@ -47,6 +47,10 @@ if (!token.empty()) { session->SetSourceAddressTokenToSend(token); } + if (crypto_config->tls_signature_algorithms().has_value()) { + SSL_set1_sigalgs_list(ssl(), + crypto_config->tls_signature_algorithms()->c_str()); + } } TlsClientHandshaker::~TlsClientHandshaker() {}
diff --git a/quic/tools/quic_client_base.h b/quic/tools/quic_client_base.h index 82ee392..51e3433 100644 --- a/quic/tools/quic_client_base.h +++ b/quic/tools/quic_client_base.h
@@ -145,6 +145,11 @@ crypto_config_.set_user_agent_id(user_agent_id); } + void SetTlsSignatureAlgorithms(std::string signature_algorithms) { + crypto_config_.set_tls_signature_algorithms( + std::move(signature_algorithms)); + } + const ParsedQuicVersionVector& supported_versions() const { return supported_versions_; }