OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef NET_QUIC_CORE_CRYPTO_QUIC_CRYPTO_CLIENT_CONFIG_H_ | 5 #ifndef NET_QUIC_CORE_CRYPTO_QUIC_CRYPTO_CLIENT_CONFIG_H_ |
6 #define NET_QUIC_CORE_CRYPTO_QUIC_CRYPTO_CLIENT_CONFIG_H_ | 6 #define NET_QUIC_CORE_CRYPTO_QUIC_CRYPTO_CLIENT_CONFIG_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <cstdint> |
9 | |
10 #include <map> | 9 #include <map> |
11 #include <memory> | 10 #include <memory> |
12 #include <queue> | 11 #include <queue> |
13 #include <string> | 12 #include <string> |
14 #include <vector> | 13 #include <vector> |
15 | 14 |
16 #include "base/macros.h" | 15 #include "base/macros.h" |
17 #include "base/strings/string_piece.h" | 16 #include "base/strings/string_piece.h" |
18 #include "net/quic/core/crypto/crypto_handshake.h" | 17 #include "net/quic/core/crypto/crypto_handshake.h" |
19 #include "net/quic/core/quic_packets.h" | 18 #include "net/quic/core/quic_packets.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 // it in |server_config_|. |now| is used to judge whether |server_config| | 77 // it in |server_config_|. |now| is used to judge whether |server_config| |
79 // has expired. | 78 // has expired. |
80 ServerConfigState SetServerConfig(base::StringPiece server_config, | 79 ServerConfigState SetServerConfig(base::StringPiece server_config, |
81 QuicWallTime now, | 80 QuicWallTime now, |
82 QuicWallTime expiry_time, | 81 QuicWallTime expiry_time, |
83 std::string* error_details); | 82 std::string* error_details); |
84 | 83 |
85 // InvalidateServerConfig clears the cached server config (if any). | 84 // InvalidateServerConfig clears the cached server config (if any). |
86 void InvalidateServerConfig(); | 85 void InvalidateServerConfig(); |
87 | 86 |
88 // SetProof stores a certificate chain and signature. | 87 // SetProof stores a cert chain, cert signed timestamp and signature. |
89 void SetProof(const std::vector<std::string>& certs, | 88 void SetProof(const std::vector<std::string>& certs, |
90 base::StringPiece cert_sct, | 89 base::StringPiece cert_sct, |
91 base::StringPiece chlo_hash, | 90 base::StringPiece chlo_hash, |
92 base::StringPiece signature); | 91 base::StringPiece signature); |
93 | 92 |
94 // Clears all the data. | 93 // Clears all the data. |
95 void Clear(); | 94 void Clear(); |
96 | 95 |
97 // Clears the certificate chain and signature and invalidates the proof. | 96 // Clears the certificate chain and signature and invalidates the proof. |
98 void ClearProof(); | 97 void ClearProof(); |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 // nonces and connection_ids together in one queue. | 194 // nonces and connection_ids together in one queue. |
196 std::queue<QuicConnectionId> server_designated_connection_ids_; | 195 std::queue<QuicConnectionId> server_designated_connection_ids_; |
197 std::queue<std::string> server_nonces_; | 196 std::queue<std::string> server_nonces_; |
198 | 197 |
199 DISALLOW_COPY_AND_ASSIGN(CachedState); | 198 DISALLOW_COPY_AND_ASSIGN(CachedState); |
200 }; | 199 }; |
201 | 200 |
202 // Used to filter server ids for partial config deletion. | 201 // Used to filter server ids for partial config deletion. |
203 class ServerIdFilter { | 202 class ServerIdFilter { |
204 public: | 203 public: |
| 204 virtual ~ServerIdFilter() {} |
| 205 |
205 // Returns true if |server_id| matches the filter. | 206 // Returns true if |server_id| matches the filter. |
206 virtual bool Matches(const QuicServerId& server_id) const = 0; | 207 virtual bool Matches(const QuicServerId& server_id) const = 0; |
207 }; | 208 }; |
208 | 209 |
209 explicit QuicCryptoClientConfig( | 210 explicit QuicCryptoClientConfig( |
210 std::unique_ptr<ProofVerifier> proof_verifier); | 211 std::unique_ptr<ProofVerifier> proof_verifier); |
211 ~QuicCryptoClientConfig(); | 212 ~QuicCryptoClientConfig(); |
212 | 213 |
213 // LookupOrCreate returns a CachedState for the given |server_id|. If no such | 214 // LookupOrCreate returns a CachedState for the given |server_id|. If no such |
214 // CachedState currently exists, it will be created and cached. | 215 // CachedState currently exists, it will be created and cached. |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 | 386 |
386 // The |user_agent_id_| passed in QUIC's CHLO message. | 387 // The |user_agent_id_| passed in QUIC's CHLO message. |
387 std::string user_agent_id_; | 388 std::string user_agent_id_; |
388 | 389 |
389 DISALLOW_COPY_AND_ASSIGN(QuicCryptoClientConfig); | 390 DISALLOW_COPY_AND_ASSIGN(QuicCryptoClientConfig); |
390 }; | 391 }; |
391 | 392 |
392 } // namespace net | 393 } // namespace net |
393 | 394 |
394 #endif // NET_QUIC_CORE_CRYPTO_QUIC_CRYPTO_CLIENT_CONFIG_H_ | 395 #endif // NET_QUIC_CORE_CRYPTO_QUIC_CRYPTO_CLIENT_CONFIG_H_ |
OLD | NEW |