OLD | NEW |
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 #include "net/quic/core/crypto/crypto_utils.h" | 5 #include "net/quic/core/crypto/crypto_utils.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "crypto/hkdf.h" | 9 #include "crypto/hkdf.h" |
10 #include "crypto/secure_hash.h" | 10 #include "crypto/secure_hash.h" |
11 #include "net/base/url_util.h" | 11 #include "net/base/url_util.h" |
12 #include "net/quic/core/crypto/crypto_handshake.h" | 12 #include "net/quic/core/crypto/crypto_handshake.h" |
13 #include "net/quic/core/crypto/crypto_protocol.h" | 13 #include "net/quic/core/crypto/crypto_protocol.h" |
14 #include "net/quic/core/crypto/quic_decrypter.h" | 14 #include "net/quic/core/crypto/quic_decrypter.h" |
15 #include "net/quic/core/crypto/quic_encrypter.h" | 15 #include "net/quic/core/crypto/quic_encrypter.h" |
16 #include "net/quic/core/crypto/quic_random.h" | 16 #include "net/quic/core/crypto/quic_random.h" |
17 #include "net/quic/core/quic_bug_tracker.h" | |
18 #include "net/quic/core/quic_time.h" | 17 #include "net/quic/core/quic_time.h" |
19 #include "net/quic/core/quic_utils.h" | 18 #include "net/quic/core/quic_utils.h" |
| 19 #include "net/quic/platform/api/quic_bug_tracker.h" |
20 #include "url/url_canon.h" | 20 #include "url/url_canon.h" |
21 | 21 |
22 using base::StringPiece; | 22 using base::StringPiece; |
23 using std::string; | 23 using std::string; |
24 | 24 |
25 namespace net { | 25 namespace net { |
26 | 26 |
27 // static | 27 // static |
28 void CryptoUtils::GenerateNonce(QuicWallTime now, | 28 void CryptoUtils::GenerateNonce(QuicWallTime now, |
29 QuicRandom* random_generator, | 29 QuicRandom* random_generator, |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 const QuicData& serialized = message.GetSerialized(); | 330 const QuicData& serialized = message.GetSerialized(); |
331 std::unique_ptr<crypto::SecureHash> hash( | 331 std::unique_ptr<crypto::SecureHash> hash( |
332 crypto::SecureHash::Create(crypto::SecureHash::SHA256)); | 332 crypto::SecureHash::Create(crypto::SecureHash::SHA256)); |
333 hash->Update(serialized.data(), serialized.length()); | 333 hash->Update(serialized.data(), serialized.length()); |
334 uint8_t digest[32]; | 334 uint8_t digest[32]; |
335 hash->Finish(digest, sizeof(digest)); | 335 hash->Finish(digest, sizeof(digest)); |
336 output->assign(reinterpret_cast<const char*>(&digest), sizeof(digest)); | 336 output->assign(reinterpret_cast<const char*>(&digest), sizeof(digest)); |
337 } | 337 } |
338 | 338 |
339 } // namespace net | 339 } // namespace net |
OLD | NEW |