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

Issue 213473003: This change introduces a way to tie source address token keys to specific QUIC server configs (Closed)

Created:
6 years, 9 months ago by ramant (doing other things)
Modified:
6 years, 7 months ago
Reviewers:
wtc, Ryan Hamilton
CC:
chromium-reviews, cbentzel+watch_chromium.org, avd, jar (doing other things)
Visibility:
Public.

Description

This change introduces a way to tie source address token keys to specific QUIC server configs, so that server can replace both the server config and source address token key when communication with keystore succeeds. Add retry logic and more graceful fallback to code that loads QUIC insecure secrets from keystore. Not flag protected. Merge internal change: 63497296 + Changed ComputeSourceAddressTokenKey to DeriveSourceAddressTokenKey + Fixed comments. + Changed Config* to a const reference in BuildRejection, NewSourceAddressToken and ValidateSourceAddressToken methods. Merge internal change: 65382861 Use QuicEncrypter and QuicDecrypter with "AES128 + GCM-12" as the AEAD algorithm to implement CryptoSecretBoxes' Box and Unbox methods. These methods are used in unit tests only. R=wtc@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=266491

Patch Set 1 #

Patch Set 2 : Use QuicEncrypter and QuicDecrypter to encrypt and decrypt SecretBoxer's Box/Unbox methods #

Total comments: 28

Patch Set 3 : Fix wtc's comments for patch set 2 #

Patch Set 4 : Merge with TOT #

Patch Set 5 : Merge internal change: 65382861 #

Total comments: 28

Patch Set 6 : Fix wtc's comments for patch set 5 #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+294 lines, -102 lines) Patch
M net/quic/crypto/crypto_secret_boxer.h View 1 2 3 4 5 3 chunks +14 lines, -3 lines 0 comments Download
M net/quic/crypto/crypto_secret_boxer.cc View 1 2 3 4 5 3 chunks +51 lines, -37 lines 6 comments Download
M net/quic/crypto/crypto_server_config_protobuf.h View 1 2 3 4 chunks +21 lines, -2 lines 0 comments Download
M net/quic/crypto/quic_crypto_server_config.h View 1 2 3 4 5 5 chunks +32 lines, -10 lines 0 comments Download
M net/quic/crypto/quic_crypto_server_config.cc View 1 2 3 4 5 20 chunks +89 lines, -30 lines 0 comments Download
M net/quic/crypto/quic_crypto_server_config_test.cc View 1 2 2 chunks +87 lines, -20 lines 0 comments Download

Messages

Total messages: 26 (0 generated)
ramant (doing other things)
6 years, 9 months ago (2014-03-26 20:56:47 UTC) #1
ramant (doing other things)
Hi Wan-Teh and Ryan, This code is not ready for review yet. This patch works ...
6 years, 9 months ago (2014-03-26 22:14:58 UTC) #2
avd
Problem: crypto_secret_boxer in Chrome doesn't use key_ for anything: it just ignores the key! https://code.google.com/p/chromium/codesearch#chromium/src/net/quic/crypto/crypto_secret_boxer.cc ...
6 years, 9 months ago (2014-03-26 22:32:30 UTC) #3
ramant (doing other things)
Hi Wan-Teh, This is a very crude first cut at using QuicEncrypter and QuicDecrypter with ...
6 years, 8 months ago (2014-04-05 02:45:05 UTC) #4
wtc
Review comments on patch set 2: I reviewed everything except quic_crypto_server_config_test.cc. https://codereview.chromium.org/213473003/diff/20001/net/quic/crypto/crypto_secret_boxer.cc File net/quic/crypto/crypto_secret_boxer.cc (right): ...
6 years, 8 months ago (2014-04-07 18:38:24 UTC) #5
ramant (doing other things)
Hi Wan-Teh, Thanks very much for your comments. Will merge this CL back into the ...
6 years, 8 months ago (2014-04-21 22:39:28 UTC) #6
ramant (doing other things)
https://codereview.chromium.org/213473003/diff/20001/net/quic/crypto/crypto_secret_boxer.cc File net/quic/crypto/crypto_secret_boxer.cc (right): https://codereview.chromium.org/213473003/diff/20001/net/quic/crypto/crypto_secret_boxer.cc#newcode37 net/quic/crypto/crypto_secret_boxer.cc:37: scoped_ptr<QuicEncrypter> encrypter(QuicEncrypter::Create(kAESG)); On 2014/04/21 22:39:29, ramant wrote: > On ...
6 years, 8 months ago (2014-04-22 01:09:08 UTC) #7
ramant (doing other things)
https://codereview.chromium.org/213473003/diff/20001/net/quic/crypto/crypto_secret_boxer.cc File net/quic/crypto/crypto_secret_boxer.cc (right): https://codereview.chromium.org/213473003/diff/20001/net/quic/crypto/crypto_secret_boxer.cc#newcode37 net/quic/crypto/crypto_secret_boxer.cc:37: scoped_ptr<QuicEncrypter> encrypter(QuicEncrypter::Create(kAESG)); On 2014/04/21 22:39:29, ramant wrote: > On ...
6 years, 8 months ago (2014-04-22 01:35:15 UTC) #8
wtc
Patch set 5 LGTM. https://codereview.chromium.org/213473003/diff/120001/net/quic/crypto/crypto_secret_boxer.cc File net/quic/crypto/crypto_secret_boxer.cc (right): https://codereview.chromium.org/213473003/diff/120001/net/quic/crypto/crypto_secret_boxer.cc#newcode33 net/quic/crypto/crypto_secret_boxer.cc:33: size_t CryptoSecretBoxer::GetKeySize() { return kKeySize; ...
6 years, 8 months ago (2014-04-22 19:12:09 UTC) #9
ramant (doing other things)
Thanks very much Wan-Teh for the comments. PTAL. https://codereview.chromium.org/213473003/diff/120001/net/quic/crypto/crypto_secret_boxer.cc File net/quic/crypto/crypto_secret_boxer.cc (right): https://codereview.chromium.org/213473003/diff/120001/net/quic/crypto/crypto_secret_boxer.cc#newcode33 net/quic/crypto/crypto_secret_boxer.cc:33: size_t ...
6 years, 8 months ago (2014-04-25 23:40:58 UTC) #10
ramant (doing other things)
The CQ bit was checked by rtenneti@chromium.org
6 years, 8 months ago (2014-04-25 23:57:03 UTC) #11
ramant (doing other things)
The CQ bit was unchecked by rtenneti@chromium.org
6 years, 8 months ago (2014-04-25 23:58:09 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rtenneti@chromium.org/213473003/160001
6 years, 8 months ago (2014-04-25 23:58:18 UTC) #13
ramant (doing other things)
The CQ bit was checked by rtenneti@chromium.org
6 years, 8 months ago (2014-04-27 01:45:52 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rtenneti@chromium.org/213473003/160001
6 years, 8 months ago (2014-04-27 01:46:14 UTC) #15
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-04-27 02:21:38 UTC) #16
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.chromium on linux_chromium_chromeos_rel
6 years, 8 months ago (2014-04-27 02:21:38 UTC) #17
ramant (doing other things)
The CQ bit was checked by rtenneti@chromium.org
6 years, 8 months ago (2014-04-27 05:11:38 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rtenneti@chromium.org/213473003/160001
6 years, 8 months ago (2014-04-27 05:12:06 UTC) #19
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-04-27 05:53:56 UTC) #20
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.chromium on win_chromium_rel
6 years, 8 months ago (2014-04-27 05:53:57 UTC) #21
ramant (doing other things)
The CQ bit was checked by rtenneti@chromium.org
6 years, 8 months ago (2014-04-27 13:43:57 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rtenneti@chromium.org/213473003/160001
6 years, 8 months ago (2014-04-27 13:45:00 UTC) #23
commit-bot: I haz the power
Change committed as 266491
6 years, 8 months ago (2014-04-28 08:55:42 UTC) #24
wtc
Patch set 6 LGTM. I suggest some changes. https://codereview.chromium.org/213473003/diff/120001/net/quic/crypto/crypto_secret_boxer.h File net/quic/crypto/crypto_secret_boxer.h (right): https://codereview.chromium.org/213473003/diff/120001/net/quic/crypto/crypto_secret_boxer.h#newcode15 net/quic/crypto/crypto_secret_boxer.h:15: #include ...
6 years, 7 months ago (2014-04-28 18:44:57 UTC) #25
ramant (doing other things)
6 years, 7 months ago (2014-04-29 00:31:18 UTC) #26
Message was sent while issue was closed.
Hi Wan-Teh,
  Made the changes in the following CL. PTAL.

https://codereview.chromium.org/257123002/

thanks
raman

https://codereview.chromium.org/213473003/diff/120001/net/quic/crypto/crypto_...
File net/quic/crypto/crypto_secret_boxer.h (right):

https://codereview.chromium.org/213473003/diff/120001/net/quic/crypto/crypto_...
net/quic/crypto/crypto_secret_boxer.h:15: #include
"net/quic/crypto/quic_encrypter.h"
On 2014/04/28 18:44:58, wtc wrote:
> 
> On 2014/04/25 23:40:58, ramant wrote:
> >
> > Was running into compilation errors 
> > ../../net/quic/crypto/crypto_secret_boxer.h:51:17: error: field has
incomplete
> > type 'net::QuicEncrypter'
> >   QuicEncrypter encrypter_;
> 
> Now the |encrypter_| member is a scoped_ptr:
> 
>   scoped_ptr<QuicEncrypter> encrypter_;
> 
> a forward declaration of QuicEncrypter may be enough. In any case, you don't
> need to change this.

Deleted the include files.

Done.

https://codereview.chromium.org/213473003/diff/120001/net/quic/crypto/crypto_...
net/quic/crypto/crypto_secret_boxer.h:52: std::string key_;
On 2014/04/28 18:44:58, wtc wrote:
> 
> On 2014/04/25 23:40:58, ramant wrote:
> >
> > nit/small concern: this file is diverging from internal source tree.
> 
> That's true. I think we can keep the .h files in sync, but the .cc files will
be
> different, and we will need to change encrypter_ and decrypter_ back to local
> variables in the Box and Unbox methods.

Done.

https://codereview.chromium.org/213473003/diff/160001/net/quic/crypto/crypto_...
File net/quic/crypto/crypto_secret_boxer.cc (right):

https://codereview.chromium.org/213473003/diff/160001/net/quic/crypto/crypto_...
net/quic/crypto/crypto_secret_boxer.cc:43:
DCHECK_EQ(static_cast<size_t>(kKeySize), key.size());
On 2014/04/28 18:44:58, wtc wrote:
> 
> Please remove the static_cast. kKeySize is already defined as a size_t.

Done.

https://codereview.chromium.org/213473003/diff/160001/net/quic/crypto/crypto_...
net/quic/crypto/crypto_secret_boxer.cc:44: string key_string = key.as_string();
On 2014/04/28 18:44:58, wtc wrote:
> 
> It is not necessary to convert |key| to a string. encrypter_->SetKey() and
> decrypter_->SetKey() both take a StringPiece, so we can just pass |key| to
them.

Done.

https://codereview.chromium.org/213473003/diff/160001/net/quic/crypto/crypto_...
net/quic/crypto/crypto_secret_boxer.cc:57: DCHECK_EQ(kKeySize,
encrypter_->GetKeySize());
On 2014/04/28 18:44:58, wtc wrote:
> 
> I think this DCHECK can be deleted. Alternatively, it should be moved to the
> SetKey method, where we call encrypter_->SetKey. But encrypter_->SetKey will
> check the key size, which is why I think this DCHECK can be removed.

Done.

Deleted the DECHEK_EQ. 

Wanted to make sure SetKey was called before calling Box.

Powered by Google App Engine
This is Rietveld 408576698