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

Side by Side Diff: net/quic/crypto/crypto_server_config_protobuf.h

Issue 213473003: This change introduces a way to tie source address token keys to specific QUIC server configs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use QuicEncrypter and QuicDecrypter to encrypt and decrypt SecretBoxer's Box/Unbox methods Created 6 years, 8 months 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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_CRYPTO_CRYPTO_SERVER_CONFIG_PROTOBUF_H_ 5 #ifndef NET_QUIC_CRYPTO_CRYPTO_SERVER_CONFIG_PROTOBUF_H_
6 #define NET_QUIC_CRYPTO_CRYPTO_SERVER_CONFIG_PROTOBUF_H_ 6 #define NET_QUIC_CRYPTO_CRYPTO_SERVER_CONFIG_PROTOBUF_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 } 82 }
83 83
84 void set_primary_time(int64 primary_time) { 84 void set_primary_time(int64 primary_time) {
85 primary_time_ = primary_time; 85 primary_time_ = primary_time;
86 } 86 }
87 87
88 bool has_priority() const { 88 bool has_priority() const {
89 return priority_ > 0; 89 return priority_ > 0;
90 } 90 }
91 91
92 int64 priority() const { 92 uint64 priority() const {
93 return priority_; 93 return priority_;
94 } 94 }
95 95
96 void set_priority(int64 priority) { 96 void set_priority(int64 priority) {
97 priority_ = priority; 97 priority_ = priority;
98 } 98 }
99 99
100 bool has_source_address_token_secret_override() const {
101 return !source_address_token_secret_override_.empty();
102 }
103
104 std::string source_address_token_secret_override() const {
105 return source_address_token_secret_override_;
106 }
107
108 void set_source_address_token_secret_override(
109 base::StringPiece source_address_token_secret_override) {
110 source_address_token_secret_override_ =
111 source_address_token_secret_override.as_string();
wtc 2014/04/07 18:38:24 Nit: source_address_token_secret_override.CopyToSt
ramant (doing other things) 2014/04/21 22:39:29 Done.
112 LOG(ERROR) << "override: " << source_address_token_secret_override_;
wtc 2014/04/07 18:38:24 IMPORTANT: remove this error message?
ramant (doing other things) 2014/04/21 22:39:29 Done.
113 }
114
100 private: 115 private:
101 std::vector<PrivateKey*> keys_; 116 std::vector<PrivateKey*> keys_;
102 117
103 // config_ is a serialised config in QUIC wire format. 118 // config_ is a serialised config in QUIC wire format.
104 std::string config_; 119 std::string config_;
105 120
106 // primary_time_ contains a UNIX epoch seconds value that indicates when this 121 // primary_time_ contains a UNIX epoch seconds value that indicates when this
107 // config should become primary. 122 // config should become primary.
108 int64 primary_time_; 123 int64 primary_time_;
109 124
110 // Relative priority of this config vs other configs with the same 125 // Relative priority of this config vs other configs with the same
111 // primary time. For use as a secondary sort key when selecting the 126 // primary time. For use as a secondary sort key when selecting the
112 // primary config. 127 // primary config.
113 uint64 priority_; 128 uint64 priority_;
129
130 // Optional override to the secret used to box/unbox source address
131 // tokens when talking to clients that select this server config.
132 // It can be of any length as it is fed into a KDF before use.
133 std::string source_address_token_secret_override_;
114 }; 134 };
115 135
116 } // namespace net 136 } // namespace net
117 137
118 #endif // NET_QUIC_CRYPTO_CRYPTO_SERVER_CONFIG_PROTOBUF_H_ 138 #endif // NET_QUIC_CRYPTO_CRYPTO_SERVER_CONFIG_PROTOBUF_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698