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

Side by Side Diff: base/crypto/symmetric_key_unittest.cc

Issue 3845002: Convert LOG(INFO) to VLOG(1) - base/. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 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
« no previous file with comments | « no previous file | base/debug_util_unittest.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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "base/crypto/symmetric_key.h" 5 #include "base/crypto/symmetric_key.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/scoped_ptr.h" 9 #include "base/scoped_ptr.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 } 193 }
194 }; 194 };
195 195
196 TEST(SymmetricKeyTest, DeriveKeyFromPassword) { 196 TEST(SymmetricKeyTest, DeriveKeyFromPassword) {
197 for (unsigned int i = 0; i < ARRAYSIZE_UNSAFE(test_vectors); ++i) { 197 for (unsigned int i = 0; i < ARRAYSIZE_UNSAFE(test_vectors); ++i) {
198 SCOPED_TRACE(StringPrintf("Test[%u]", i)); 198 SCOPED_TRACE(StringPrintf("Test[%u]", i));
199 #if defined(OS_MACOSX) 199 #if defined(OS_MACOSX)
200 // The OS X crypto libraries have minimum salt and iteration requirements 200 // The OS X crypto libraries have minimum salt and iteration requirements
201 // so some of the above tests will cause them to barf. Skip these. 201 // so some of the above tests will cause them to barf. Skip these.
202 if (strlen(test_vectors[i].salt) < 8 || test_vectors[i].rounds < 1000) { 202 if (strlen(test_vectors[i].salt) < 8 || test_vectors[i].rounds < 1000) {
203 LOG(INFO) << "Skipped test vector #" << i; 203 VLOG(1) << "Skipped test vector #" << i;
204 continue; 204 continue;
205 } 205 }
206 #endif // OS_MACOSX 206 #endif // OS_MACOSX
207 scoped_ptr<base::SymmetricKey> key( 207 scoped_ptr<base::SymmetricKey> key(
208 base::SymmetricKey::DeriveKeyFromPassword( 208 base::SymmetricKey::DeriveKeyFromPassword(
209 base::SymmetricKey::HMAC_SHA1, 209 base::SymmetricKey::HMAC_SHA1,
210 test_vectors[i].password, test_vectors[i].salt, 210 test_vectors[i].password, test_vectors[i].salt,
211 test_vectors[i].rounds, test_vectors[i].key_size_in_bits)); 211 test_vectors[i].rounds, test_vectors[i].key_size_in_bits));
212 ASSERT_TRUE(NULL != key.get()); 212 ASSERT_TRUE(NULL != key.get());
213 213
214 std::string raw_key; 214 std::string raw_key;
215 key->GetRawKey(&raw_key); 215 key->GetRawKey(&raw_key);
216 EXPECT_EQ(test_vectors[i].key_size_in_bits / 8, raw_key.size()); 216 EXPECT_EQ(test_vectors[i].key_size_in_bits / 8, raw_key.size());
217 EXPECT_EQ(0, memcmp(test_vectors[i].expected, 217 EXPECT_EQ(0, memcmp(test_vectors[i].expected,
218 raw_key.data(), 218 raw_key.data(),
219 raw_key.size())); 219 raw_key.size()));
220 } 220 }
221 } 221 }
OLDNEW
« no previous file with comments | « no previous file | base/debug_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698