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

Side by Side Diff: components/user_prefs/tracked/pref_hash_calculator.cc

Issue 1870233002: Convert crypto to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment Created 4 years, 8 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
« no previous file with comments | « components/nacl/loader/nacl_validation_query_unittest.cc ('k') | crypto/ec_private_key_nss.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 "components/user_prefs/tracked/pref_hash_calculator.h" 5 #include "components/user_prefs/tracked/pref_hash_calculator.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "base/json/json_string_value_serializer.h" 12 #include "base/json/json_string_value_serializer.h"
13 #include "base/logging.h" 13 #include "base/logging.h"
14 #include "base/memory/scoped_ptr.h"
14 #include "base/strings/string_number_conversions.h" 15 #include "base/strings/string_number_conversions.h"
15 #include "base/strings/string_util.h" 16 #include "base/strings/string_util.h"
16 #include "base/values.h" 17 #include "base/values.h"
17 #include "crypto/hmac.h" 18 #include "crypto/hmac.h"
18 19
19 namespace { 20 namespace {
20 21
21 // Calculates an HMAC of |message| using |key|, encoded as a hexadecimal string. 22 // Calculates an HMAC of |message| using |key|, encoded as a hexadecimal string.
22 std::string GetDigestString(const std::string& key, 23 std::string GetDigestString(const std::string& key,
23 const std::string& message) { 24 const std::string& message) {
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 digest_string)) { 119 digest_string)) {
119 return VALID; 120 return VALID;
120 } 121 }
121 if (VerifyDigestString(seed_, 122 if (VerifyDigestString(seed_,
122 GetMessage(legacy_device_id_, path, value_as_string), 123 GetMessage(legacy_device_id_, path, value_as_string),
123 digest_string)) { 124 digest_string)) {
124 return VALID_SECURE_LEGACY; 125 return VALID_SECURE_LEGACY;
125 } 126 }
126 return INVALID; 127 return INVALID;
127 } 128 }
OLDNEW
« no previous file with comments | « components/nacl/loader/nacl_validation_query_unittest.cc ('k') | crypto/ec_private_key_nss.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698