Make ClientDemandsX509Proof a free function
gfe-relnote: n/a Code motion only.
PiperOrigin-RevId: 238704660
Change-Id: I521a8b916eb6e1a0b6e2a198d42a0561753ff266
diff --git a/quic/core/crypto/quic_crypto_server_config.cc b/quic/core/crypto/quic_crypto_server_config.cc
index 56de827..cb5ad45 100644
--- a/quic/core/crypto/quic_crypto_server_config.cc
+++ b/quic/core/crypto/quic_crypto_server_config.cc
@@ -95,6 +95,23 @@
}
};
+// Returns true if the PDMD field from the client hello demands an X509
+// certificate.
+bool ClientDemandsX509Proof(const CryptoHandshakeMessage& client_hello) {
+ QuicTagVector their_proof_demands;
+
+ if (client_hello.GetTaglist(kPDMD, &their_proof_demands) != QUIC_NO_ERROR) {
+ return false;
+ }
+
+ for (const QuicTag tag : their_proof_demands) {
+ if (tag == kX509) {
+ return true;
+ }
+ }
+ return false;
+}
+
} // namespace
// static
@@ -1931,22 +1948,6 @@
return CryptoUtils::ComputeLeafCertHash(certs.at(0)) == hash_from_client;
}
-bool QuicCryptoServerConfig::ClientDemandsX509Proof(
- const CryptoHandshakeMessage& client_hello) const {
- QuicTagVector their_proof_demands;
-
- if (client_hello.GetTaglist(kPDMD, &their_proof_demands) != QUIC_NO_ERROR) {
- return false;
- }
-
- for (const QuicTag tag : their_proof_demands) {
- if (tag == kX509) {
- return true;
- }
- }
- return false;
-}
-
bool QuicCryptoServerConfig::IsNextConfigReady(QuicWallTime now) const {
if (GetQuicReloadableFlag(quic_fix_config_rotation)) {
QUIC_RELOADABLE_FLAG_COUNT(quic_fix_config_rotation);
diff --git a/quic/core/crypto/quic_crypto_server_config.h b/quic/core/crypto/quic_crypto_server_config.h
index 0d7037f..54ddf76 100644
--- a/quic/core/crypto/quic_crypto_server_config.h
+++ b/quic/core/crypto/quic_crypto_server_config.h
@@ -682,10 +682,6 @@
const CryptoHandshakeMessage& client_hello,
const std::vector<std::string>& certs) const;
- // Returns true if the PDMD field from the client hello demands an X509
- // certificate.
- bool ClientDemandsX509Proof(const CryptoHandshakeMessage& client_hello) const;
-
// Callback to receive the results of ProofSource::GetProof. Note: this
// callback has no cancellation support, since the lifetime of the ProofSource
// is controlled by this object via unique ownership. If that ownership