Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(70)

Side by Side Diff: net/quic/core/crypto/quic_crypto_server_config.h

Issue 2561893002: Add QUIC_EXPORT macros (Closed)
Patch Set: More Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/quic/core/crypto/quic_crypto_proof.h ('k') | net/quic/core/crypto/quic_decrypter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_SERVER_CONFIG_H_ 5 #ifndef NET_QUIC_CORE_CRYPTO_QUIC_CRYPTO_SERVER_CONFIG_H_
6 #define NET_QUIC_CORE_CRYPTO_QUIC_CRYPTO_SERVER_CONFIG_H_ 6 #define NET_QUIC_CORE_CRYPTO_QUIC_CRYPTO_SERVER_CONFIG_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
11 #include <map> 11 #include <map>
12 #include <memory> 12 #include <memory>
13 #include <string> 13 #include <string>
14 #include <vector> 14 #include <vector>
15 15
16 #include "base/macros.h" 16 #include "base/macros.h"
17 #include "base/memory/ref_counted.h" 17 #include "base/memory/ref_counted.h"
18 #include "base/strings/string_piece.h" 18 #include "base/strings/string_piece.h"
19 #include "base/synchronization/lock.h" 19 #include "base/synchronization/lock.h"
20 #include "net/base/ip_address.h" 20 #include "net/base/ip_address.h"
21 #include "net/base/ip_endpoint.h" 21 #include "net/base/ip_endpoint.h"
22 #include "net/base/net_export.h"
23 #include "net/quic/core/crypto/crypto_handshake.h" 22 #include "net/quic/core/crypto/crypto_handshake.h"
24 #include "net/quic/core/crypto/crypto_handshake_message.h" 23 #include "net/quic/core/crypto/crypto_handshake_message.h"
25 #include "net/quic/core/crypto/crypto_protocol.h" 24 #include "net/quic/core/crypto/crypto_protocol.h"
26 #include "net/quic/core/crypto/crypto_secret_boxer.h" 25 #include "net/quic/core/crypto/crypto_secret_boxer.h"
27 #include "net/quic/core/crypto/proof_source.h" 26 #include "net/quic/core/crypto/proof_source.h"
28 #include "net/quic/core/crypto/quic_compressed_certs_cache.h" 27 #include "net/quic/core/crypto/quic_compressed_certs_cache.h"
29 #include "net/quic/core/crypto/quic_crypto_proof.h" 28 #include "net/quic/core/crypto/quic_crypto_proof.h"
30 #include "net/quic/core/proto/cached_network_parameters.pb.h" 29 #include "net/quic/core/proto/cached_network_parameters.pb.h"
31 #include "net/quic/core/proto/source_address_token.pb.h" 30 #include "net/quic/core/proto/source_address_token.pb.h"
32 #include "net/quic/core/quic_time.h" 31 #include "net/quic/core/quic_time.h"
32 #include "net/quic/platform/api/quic_export.h"
33 #include "net/quic/platform/api/quic_socket_address.h" 33 #include "net/quic/platform/api/quic_socket_address.h"
34 34
35 namespace net { 35 namespace net {
36 36
37 class CryptoHandshakeMessage; 37 class CryptoHandshakeMessage;
38 class EphemeralKeySource; 38 class EphemeralKeySource;
39 class KeyExchange; 39 class KeyExchange;
40 class ProofSource; 40 class ProofSource;
41 class QuicClock; 41 class QuicClock;
42 class QuicRandom; 42 class QuicRandom;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 public: 76 public:
77 PrimaryConfigChangedCallback(); 77 PrimaryConfigChangedCallback();
78 virtual ~PrimaryConfigChangedCallback(); 78 virtual ~PrimaryConfigChangedCallback();
79 virtual void Run(const std::string& scid) = 0; 79 virtual void Run(const std::string& scid) = 0;
80 80
81 private: 81 private:
82 DISALLOW_COPY_AND_ASSIGN(PrimaryConfigChangedCallback); 82 DISALLOW_COPY_AND_ASSIGN(PrimaryConfigChangedCallback);
83 }; 83 };
84 84
85 // Callback used to accept the result of the |client_hello| validation step. 85 // Callback used to accept the result of the |client_hello| validation step.
86 class NET_EXPORT_PRIVATE ValidateClientHelloResultCallback { 86 class QUIC_EXPORT_PRIVATE ValidateClientHelloResultCallback {
87 public: 87 public:
88 // Opaque token that holds information about the client_hello and 88 // Opaque token that holds information about the client_hello and
89 // its validity. Can be interpreted by calling ProcessClientHello. 89 // its validity. Can be interpreted by calling ProcessClientHello.
90 struct NET_EXPORT_PRIVATE Result : public base::RefCountedThreadSafe<Result> { 90 struct QUIC_EXPORT_PRIVATE Result
91 : public base::RefCountedThreadSafe<Result> {
91 Result(const CryptoHandshakeMessage& in_client_hello, 92 Result(const CryptoHandshakeMessage& in_client_hello,
92 QuicIpAddress in_client_ip, 93 QuicIpAddress in_client_ip,
93 QuicWallTime in_now); 94 QuicWallTime in_now);
94 95
95 CryptoHandshakeMessage client_hello; 96 CryptoHandshakeMessage client_hello;
96 ClientHelloInfo info; 97 ClientHelloInfo info;
97 QuicErrorCode error_code; 98 QuicErrorCode error_code;
98 std::string error_details; 99 std::string error_details;
99 100
100 // Populated if the CHLO STK contained a CachedNetworkParameters proto. 101 // Populated if the CHLO STK contained a CachedNetworkParameters proto.
101 CachedNetworkParameters cached_network_params; 102 CachedNetworkParameters cached_network_params;
102 103
103 private: 104 private:
104 friend class base::RefCountedThreadSafe<Result>; 105 friend class base::RefCountedThreadSafe<Result>;
105 ~Result(); 106 ~Result();
106 }; 107 };
107 108
108 ValidateClientHelloResultCallback(); 109 ValidateClientHelloResultCallback();
109 virtual void Run(scoped_refptr<Result> result, 110 virtual void Run(scoped_refptr<Result> result,
110 std::unique_ptr<ProofSource::Details> details) = 0; 111 std::unique_ptr<ProofSource::Details> details) = 0;
111 virtual ~ValidateClientHelloResultCallback(); 112 virtual ~ValidateClientHelloResultCallback();
112 113
113 private: 114 private:
114 DISALLOW_COPY_AND_ASSIGN(ValidateClientHelloResultCallback); 115 DISALLOW_COPY_AND_ASSIGN(ValidateClientHelloResultCallback);
115 }; 116 };
116 117
117 // Callback used to accept the result of the ProcessClientHello method. 118 // Callback used to accept the result of the ProcessClientHello method.
118 class NET_EXPORT_PRIVATE ProcessClientHelloResultCallback { 119 class QUIC_EXPORT_PRIVATE ProcessClientHelloResultCallback {
119 public: 120 public:
120 ProcessClientHelloResultCallback(); 121 ProcessClientHelloResultCallback();
121 virtual ~ProcessClientHelloResultCallback(); 122 virtual ~ProcessClientHelloResultCallback();
122 virtual void Run(QuicErrorCode error, 123 virtual void Run(QuicErrorCode error,
123 const std::string& error_details, 124 const std::string& error_details,
124 std::unique_ptr<CryptoHandshakeMessage> message, 125 std::unique_ptr<CryptoHandshakeMessage> message,
125 std::unique_ptr<DiversificationNonce> diversification_nonce, 126 std::unique_ptr<DiversificationNonce> diversification_nonce,
126 std::unique_ptr<ProofSource::Details> details) = 0; 127 std::unique_ptr<ProofSource::Details> details) = 0;
127 128
128 private: 129 private:
(...skipping 24 matching lines...) Expand all
153 154
154 private: 155 private:
155 DISALLOW_COPY_AND_ASSIGN(RejectionObserver); 156 DISALLOW_COPY_AND_ASSIGN(RejectionObserver);
156 }; 157 };
157 158
158 // QuicCryptoServerConfig contains the crypto configuration of a QUIC server. 159 // QuicCryptoServerConfig contains the crypto configuration of a QUIC server.
159 // Unlike a client, a QUIC server can have multiple configurations active in 160 // Unlike a client, a QUIC server can have multiple configurations active in
160 // order to support clients resuming with a previous configuration. 161 // order to support clients resuming with a previous configuration.
161 // TODO(agl): when adding configurations at runtime is added, this object will 162 // TODO(agl): when adding configurations at runtime is added, this object will
162 // need to consider locking. 163 // need to consider locking.
163 class NET_EXPORT_PRIVATE QuicCryptoServerConfig { 164 class QUIC_EXPORT_PRIVATE QuicCryptoServerConfig {
164 public: 165 public:
165 // ConfigOptions contains options for generating server configs. 166 // ConfigOptions contains options for generating server configs.
166 struct NET_EXPORT_PRIVATE ConfigOptions { 167 struct QUIC_EXPORT_PRIVATE ConfigOptions {
167 ConfigOptions(); 168 ConfigOptions();
168 ConfigOptions(const ConfigOptions& other); 169 ConfigOptions(const ConfigOptions& other);
169 ~ConfigOptions(); 170 ~ConfigOptions();
170 171
171 // expiry_time is the time, in UNIX seconds, when the server config will 172 // expiry_time is the time, in UNIX seconds, when the server config will
172 // expire. If unset, it defaults to the current time plus six months. 173 // expire. If unset, it defaults to the current time plus six months.
173 QuicWallTime expiry_time; 174 QuicWallTime expiry_time;
174 // channel_id_enabled controls whether the server config will indicate 175 // channel_id_enabled controls whether the server config will indicate
175 // support for ChannelIDs. 176 // support for ChannelIDs.
176 bool channel_id_enabled; 177 bool channel_id_enabled;
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 void set_rejection_observer(RejectionObserver* rejection_observer) { 422 void set_rejection_observer(RejectionObserver* rejection_observer) {
422 rejection_observer_ = rejection_observer; 423 rejection_observer_ = rejection_observer;
423 } 424 }
424 425
425 private: 426 private:
426 friend class test::QuicCryptoServerConfigPeer; 427 friend class test::QuicCryptoServerConfigPeer;
427 friend struct QuicSignedServerConfig; 428 friend struct QuicSignedServerConfig;
428 429
429 // Config represents a server config: a collection of preferences and 430 // Config represents a server config: a collection of preferences and
430 // Diffie-Hellman public values. 431 // Diffie-Hellman public values.
431 class NET_EXPORT_PRIVATE Config : public QuicCryptoConfig, 432 class QUIC_EXPORT_PRIVATE Config : public QuicCryptoConfig,
432 public base::RefCounted<Config> { 433 public base::RefCounted<Config> {
433 public: 434 public:
434 Config(); 435 Config();
435 436
436 // TODO(rtenneti): since this is a class, we should probably do 437 // TODO(rtenneti): since this is a class, we should probably do
437 // getters/setters here. 438 // getters/setters here.
438 // |serialized| contains the bytes of this server config, suitable for 439 // |serialized| contains the bytes of this server config, suitable for
439 // sending on the wire. 440 // sending on the wire.
440 std::string serialized; 441 std::string serialized;
441 // id contains the SCID of this server config. 442 // id contains the SCID of this server config.
442 std::string id; 443 std::string id;
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
778 779
779 // Enable serving SCT or not. 780 // Enable serving SCT or not.
780 bool enable_serving_sct_; 781 bool enable_serving_sct_;
781 782
782 // Does not own this observer. 783 // Does not own this observer.
783 RejectionObserver* rejection_observer_; 784 RejectionObserver* rejection_observer_;
784 785
785 DISALLOW_COPY_AND_ASSIGN(QuicCryptoServerConfig); 786 DISALLOW_COPY_AND_ASSIGN(QuicCryptoServerConfig);
786 }; 787 };
787 788
788 struct NET_EXPORT_PRIVATE QuicSignedServerConfig 789 struct QUIC_EXPORT_PRIVATE QuicSignedServerConfig
789 : public base::RefCounted<QuicSignedServerConfig> { 790 : public base::RefCounted<QuicSignedServerConfig> {
790 QuicSignedServerConfig(); 791 QuicSignedServerConfig();
791 792
792 QuicCryptoProof proof; 793 QuicCryptoProof proof;
793 scoped_refptr<ProofSource::Chain> chain; 794 scoped_refptr<ProofSource::Chain> chain;
794 // The server config that is used for this proof (and the rest of the 795 // The server config that is used for this proof (and the rest of the
795 // request). 796 // request).
796 scoped_refptr<QuicCryptoServerConfig::Config> config; 797 scoped_refptr<QuicCryptoServerConfig::Config> config;
797 std::string primary_scid; 798 std::string primary_scid;
798 799
799 private: 800 private:
800 friend class base::RefCounted<QuicSignedServerConfig>; 801 friend class base::RefCounted<QuicSignedServerConfig>;
801 virtual ~QuicSignedServerConfig(); 802 virtual ~QuicSignedServerConfig();
802 }; 803 };
803 804
804 } // namespace net 805 } // namespace net
805 806
806 #endif // NET_QUIC_CORE_CRYPTO_QUIC_CRYPTO_SERVER_CONFIG_H_ 807 #endif // NET_QUIC_CORE_CRYPTO_QUIC_CRYPTO_SERVER_CONFIG_H_
OLDNEW
« no previous file with comments | « net/quic/core/crypto/quic_crypto_proof.h ('k') | net/quic/core/crypto/quic_decrypter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698