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

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

Issue 1535363003: Switch to standard integer types in net/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: stddef Created 5 years 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
« no previous file with comments | « net/quic/crypto/crypto_server_test.cc ('k') | net/quic/crypto/crypto_utils.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // Some helpers for quic crypto 5 // Some helpers for quic crypto
6 6
7 #ifndef NET_QUIC_CRYPTO_CRYPTO_UTILS_H_ 7 #ifndef NET_QUIC_CRYPTO_CRYPTO_UTILS_H_
8 #define NET_QUIC_CRYPTO_CRYPTO_UTILS_H_ 8 #define NET_QUIC_CRYPTO_CRYPTO_UTILS_H_
9 9
10 #include <stddef.h>
11 #include <stdint.h>
12
10 #include <string> 13 #include <string>
11 14
15 #include "base/macros.h"
12 #include "base/strings/string_piece.h" 16 #include "base/strings/string_piece.h"
13 #include "net/base/net_export.h" 17 #include "net/base/net_export.h"
14 #include "net/quic/crypto/crypto_handshake.h" 18 #include "net/quic/crypto/crypto_handshake.h"
15 #include "net/quic/crypto/crypto_handshake_message.h" 19 #include "net/quic/crypto/crypto_handshake_message.h"
16 #include "net/quic/crypto/crypto_protocol.h" 20 #include "net/quic/crypto/crypto_protocol.h"
17 #include "net/quic/quic_protocol.h" 21 #include "net/quic/quic_protocol.h"
18 #include "net/quic/quic_time.h" 22 #include "net/quic/quic_time.h"
19 23
20 namespace net { 24 namespace net {
21 25
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 // parameters are invalid (e.g. |label| contains null bytes); returns true on 70 // parameters are invalid (e.g. |label| contains null bytes); returns true on
67 // success. 71 // success.
68 static bool ExportKeyingMaterial(base::StringPiece subkey_secret, 72 static bool ExportKeyingMaterial(base::StringPiece subkey_secret,
69 base::StringPiece label, 73 base::StringPiece label,
70 base::StringPiece context, 74 base::StringPiece context,
71 size_t result_len, 75 size_t result_len,
72 std::string* result); 76 std::string* result);
73 77
74 // Computes the FNV-1a hash of the provided DER-encoded cert for use in the 78 // Computes the FNV-1a hash of the provided DER-encoded cert for use in the
75 // XLCT tag. 79 // XLCT tag.
76 static uint64 ComputeLeafCertHash(const std::string& cert); 80 static uint64_t ComputeLeafCertHash(const std::string& cert);
77 81
78 // Validates that |server_hello| is actually an SHLO message and that it is 82 // Validates that |server_hello| is actually an SHLO message and that it is
79 // not part of a downgrade attack. 83 // not part of a downgrade attack.
80 // 84 //
81 // Returns QUIC_NO_ERROR if this is the case or returns the appropriate error 85 // Returns QUIC_NO_ERROR if this is the case or returns the appropriate error
82 // code and sets |error_details|. 86 // code and sets |error_details|.
83 static QuicErrorCode ValidateServerHello( 87 static QuicErrorCode ValidateServerHello(
84 const CryptoHandshakeMessage& server_hello, 88 const CryptoHandshakeMessage& server_hello,
85 const QuicVersionVector& negotiated_versions, 89 const QuicVersionVector& negotiated_versions,
86 std::string* error_details); 90 std::string* error_details);
(...skipping 14 matching lines...) Expand all
101 static const char* HandshakeFailureReasonToString( 105 static const char* HandshakeFailureReasonToString(
102 HandshakeFailureReason reason); 106 HandshakeFailureReason reason);
103 107
104 private: 108 private:
105 DISALLOW_COPY_AND_ASSIGN(CryptoUtils); 109 DISALLOW_COPY_AND_ASSIGN(CryptoUtils);
106 }; 110 };
107 111
108 } // namespace net 112 } // namespace net
109 113
110 #endif // NET_QUIC_CRYPTO_CRYPTO_UTILS_H_ 114 #endif // NET_QUIC_CRYPTO_CRYPTO_UTILS_H_
OLDNEW
« no previous file with comments | « net/quic/crypto/crypto_server_test.cc ('k') | net/quic/crypto/crypto_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698