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

Side by Side Diff: crypto/hmac.cc

Issue 2449873005: include boringssl headers from third_party explicitly (Closed)
Patch Set: review comments Created 4 years, 1 month 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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 "crypto/hmac.h" 5 #include "crypto/hmac.h"
6 6
7 #include <openssl/hmac.h>
8 #include <stddef.h> 7 #include <stddef.h>
9 8
10 #include <algorithm> 9 #include <algorithm>
11 10
12 #include "base/logging.h" 11 #include "base/logging.h"
13 #include "base/stl_util.h" 12 #include "base/stl_util.h"
14 #include "crypto/openssl_util.h" 13 #include "crypto/openssl_util.h"
15 #include "crypto/secure_util.h" 14 #include "crypto/secure_util.h"
16 #include "crypto/symmetric_key.h" 15 #include "crypto/symmetric_key.h"
16 #include "third_party/boringssl/src/include/openssl/hmac.h"
17 17
18 namespace crypto { 18 namespace crypto {
19 19
20 HMAC::HMAC(HashAlgorithm hash_alg) : hash_alg_(hash_alg), initialized_(false) { 20 HMAC::HMAC(HashAlgorithm hash_alg) : hash_alg_(hash_alg), initialized_(false) {
21 // Only SHA-1 and SHA-256 hash algorithms are supported now. 21 // Only SHA-1 and SHA-256 hash algorithms are supported now.
22 DCHECK(hash_alg_ == SHA1 || hash_alg_ == SHA256); 22 DCHECK(hash_alg_ == SHA1 || hash_alg_ == SHA256);
23 } 23 }
24 24
25 HMAC::~HMAC() { 25 HMAC::~HMAC() {
26 // Zero out key copy. 26 // Zero out key copy.
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 std::unique_ptr<unsigned char[]> computed_digest( 84 std::unique_ptr<unsigned char[]> computed_digest(
85 new unsigned char[digest_length]); 85 new unsigned char[digest_length]);
86 if (!Sign(data, computed_digest.get(), digest_length)) 86 if (!Sign(data, computed_digest.get(), digest_length))
87 return false; 87 return false;
88 88
89 return SecureMemEqual(digest.data(), computed_digest.get(), 89 return SecureMemEqual(digest.data(), computed_digest.get(),
90 std::min(digest.size(), digest_length)); 90 std::min(digest.size(), digest_length));
91 } 91 }
92 92
93 } // namespace crypto 93 } // namespace crypto
OLDNEW
« chrome/common/DEPS ('K') | « crypto/encryptor.cc ('k') | crypto/openssl_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698