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);