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

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: narrowing in 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
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
14 namespace net {
15
16 typedef uint32 CryptoTag;
17 typedef std::map<CryptoTag, base::StringPiece> CryptoTagValueMap;
18 struct CryptoHandshakeMessage {
19 CryptoHandshakeMessage();
20 ~CryptoHandshakeMessage();
21 CryptoTag tag;
22 CryptoTagValueMap tag_value_map;
23 };
24
25 // Crypto tags are written to the wire with a big-endian
26 // representation of the name of the tag. For example
27 // the client hello tag (CHLO) will be written as the
28 // following 4 bytes: 'C' 'H' 'L' 'O'. Since it is
29 // stored in memory as a little endian uint32, we need
30 // to reverse the order of the bytes.
31 #define MAKE_TAG(a,b,c,d) (d << 24) + (c << 16) + (b << 8) + a
32
33 const CryptoTag kCHLO = MAKE_TAG('C', 'H', 'L', 'O'); // Client hello
34 const CryptoTag kSHLO = MAKE_TAG('S', 'H', 'L', 'O'); // Server hello
35
36 // AEAD algorithms
37 const CryptoTag kNULL = MAKE_TAG('N', 'U', 'L', 'L'); // null algorithm
38 const CryptoTag kAESH = MAKE_TAG('A', 'E', 'S', 'H'); // AES128 + SHA256
39
40 const size_t kMaxEntries = 16; // Max number of entries in a message.
41
42 } // namespace net
43
44 #endif // NET_QUIC_CRYPTO_CRYPTO_PROTOCOL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698