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

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

Issue 11125002: Add QuicFramer and friends. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix final comments. Created 8 years, 2 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
« no previous file with comments | « net/quic/crypto/crypto_framer_test.cc ('k') | net/quic/crypto/crypto_protocol.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef NET_QUIC_CRYPTO_CRYPTO_PROTOCOL_H_
6 #define NET_QUIC_CRYPTO_CRYPTO_PROTOCOL_H_
7
8 #include <map>
9
10 #include "base/basictypes.h"
11 #include "base/logging.h"
12 #include "base/string_piece.h"
13 #include "net/base/net_export.h"
14
15 namespace net {
16
17 typedef uint32 CryptoTag;
18 typedef std::map<CryptoTag, base::StringPiece> CryptoTagValueMap;
19 struct NET_EXPORT_PRIVATE CryptoHandshakeMessage {
20 CryptoHandshakeMessage();
21 ~CryptoHandshakeMessage();
22 CryptoTag tag;
23 CryptoTagValueMap tag_value_map;
24 };
25
26 // Crypto tags are written to the wire with a big-endian
27 // representation of the name of the tag. For example
28 // the client hello tag (CHLO) will be written as the
29 // following 4 bytes: 'C' 'H' 'L' 'O'. Since it is
30 // stored in memory as a little endian uint32, we need
31 // to reverse the order of the bytes.
32 #define MAKE_TAG(a,b,c,d) (d << 24) + (c << 16) + (b << 8) + a
33
34 const CryptoTag kCHLO = MAKE_TAG('C', 'H', 'L', 'O'); // Client hello
35 const CryptoTag kSHLO = MAKE_TAG('S', 'H', 'L', 'O'); // Server hello
36
37 // AEAD algorithms
38 const CryptoTag kNULL = MAKE_TAG('N', 'U', 'L', 'L'); // null algorithm
39 const CryptoTag kAESH = MAKE_TAG('A', 'E', 'S', 'H'); // AES128 + SHA256
40
41 const size_t kMaxEntries = 16; // Max number of entries in a message.
42
43 } // namespace net
44
45 #endif // NET_QUIC_CRYPTO_CRYPTO_PROTOCOL_H_
OLDNEW
« no previous file with comments | « net/quic/crypto/crypto_framer_test.cc ('k') | net/quic/crypto/crypto_protocol.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698