diff options
author | rtenneti@chromium.org <rtenneti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-26 08:26:14 +0000 |
---|---|---|
committer | rtenneti@chromium.org <rtenneti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-26 08:26:14 +0000 |
commit | ccc66e8acadcd816e3f9ca19ce34a64bcb83a48d (patch) | |
tree | 0dd228a4fb3666bd5b5d4400594bb4c1ebe0b20c /net/quic/crypto/crypto_utils.h | |
parent | e8e49bf53386d069ea5097370f881c41a0d703f7 (diff) | |
download | chromium_src-ccc66e8acadcd816e3f9ca19ce34a64bcb83a48d.zip chromium_src-ccc66e8acadcd816e3f9ca19ce34a64bcb83a48d.tar.gz chromium_src-ccc66e8acadcd816e3f9ca19ce34a64bcb83a48d.tar.bz2 |
Land Recent QUIC Changes
Removed the tab characters.
Fixed review comments from rch.
R=rch@chromium.org
QUIC - pending changelist - Use static for congestion manager constants.
Merger internal change: 43867480
R=rch@chromium.org
QUIC - cleanup of stats
Merge internal change: 43864412
R=rch@chromium.org
QUIC - Add two new methods to QuicConnectionHelper to abstarct away differences between server and chromium.
Merge internal change: 43850438
R=rch@chromium.org
QUIC - Start tracking number of rejected connections and connection close.
Merge internal change: 43846131
R=rch@chromium.org
QUIC - Temporary work around for bug with server tests.
Merge internal change: 43845688
R=rch@chromium.org
QUIC - Bugfix; don't queue ConnectionClosePackets and don't process incoming packets if the connection is closed.
Merge internal change: 43813759
R=rch@chromium.org
QUIC - More cleanups
Merge internal change: 43805954
R=rch@chromium.org
QUIC Crypto - Change CryptoHandshakeMessage to a class.
Merge internal change: 43798895
R=rch@chromium.org, wtc@chromium.org
QUIC crypto: cleanup between steps 4 and 5.
Merge internal change: 43791096
R=rch@chromium.org, agl@chromium.org
QUIC crypto: steps 3 and 4 from the plan.
Merge internal change: 43787806
R=rch@chromium.org, agl@chromium.org
QUIC - Improved sendalarm accuracy
Merge internal change: 43785455
R=rch@chromium.org
Review URL: https://chromiumcodereview.appspot.com/12863007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@190594 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/quic/crypto/crypto_utils.h')
-rw-r--r-- | net/quic/crypto/crypto_utils.h | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/net/quic/crypto/crypto_utils.h b/net/quic/crypto/crypto_utils.h index 1fe4934..058a1ab 100644 --- a/net/quic/crypto/crypto_utils.h +++ b/net/quic/crypto/crypto_utils.h @@ -9,13 +9,16 @@ #include <string> +#include "base/string_piece.h" #include "net/base/net_export.h" +#include "net/quic/crypto/crypto_handshake.h" #include "net/quic/crypto/crypto_protocol.h" namespace net { class QuicClock; class QuicRandom; +struct QuicCryptoNegotiatedParameters; class NET_EXPORT_PRIVATE CryptoUtils { public: @@ -24,6 +27,11 @@ class NET_EXPORT_PRIVATE CryptoUtils { PEER_PRIORITY, }; + enum Perspective { + SERVER, + CLIENT, + }; + // FindMutualTag sets |out_result| to the first tag in the priority list that // is also in the other list and returns true. If there is no intersection it // returns false. @@ -39,10 +47,23 @@ class NET_EXPORT_PRIVATE CryptoUtils { CryptoTag* out_result, size_t* out_index); - // Generates the connection nonce. + // Generates the connection nonce. The nonce is formed as: + // <4 bytes> current time + // <8 bytes> |orbit| (or random if |orbit| is empty) + // <20 bytes> random static void GenerateNonce(const QuicClock* clock, QuicRandom* random_generator, + const std::string& orbit, std::string* nonce); + + // DeriveKeys populates the |encrypter| and |decrypter| members of |params| + // given the contents of |premaster_secret|, |nonce| and |hkdf_input|. + // |perspective| controls whether the server's keys are assigned to + // |encrypter| or |decrypter|. + static void DeriveKeys(QuicCryptoNegotiatedParameters* params, + base::StringPiece nonce, + const std::string& hkdf_input, + Perspective perspective); }; } // namespace net |