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

Unified Diff: chrome/browser/password_manager/encryptor_mac.mm

Issue 6805019: Move crypto files out of base, to a top level directory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Fixes comments by eroman Created 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/password_manager/encryptor_mac.mm
===================================================================
--- chrome/browser/password_manager/encryptor_mac.mm (revision 81350)
+++ chrome/browser/password_manager/encryptor_mac.mm (working copy)
@@ -6,11 +6,11 @@
#include <CommonCrypto/CommonCryptor.h> // for kCCBlockSizeAES128
-#include "base/crypto/encryptor.h"
-#include "base/crypto/symmetric_key.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "base/utf_string_conversions.h"
+#include "crypto/encryptor.h"
+#include "crypto/symmetric_key.h"
#include "chrome/browser/password_manager/encryptor_password_mac.h"
#include "chrome/browser/keychain_mac.h"
@@ -37,7 +37,7 @@
// in the Keychain. The generated key is for AES encryption. Ownership of the
// key is passed to the caller. Returns NULL key in the case password access
// is denied or key generation error occurs.
-base::SymmetricKey* GetEncryptionKey() {
+crypto::SymmetricKey* GetEncryptionKey() {
std::string password;
if (use_mock_keychain) {
@@ -54,12 +54,12 @@
std::string salt(kSalt);
// Create an encryption key from our password and salt.
- scoped_ptr<base::SymmetricKey> encryption_key(
- base::SymmetricKey::DeriveKeyFromPassword(base::SymmetricKey::AES,
- password,
- salt,
- kEncryptionIterations,
- kDerivedKeySizeInBits));
+ scoped_ptr<crypto::SymmetricKey> encryption_key(
+ crypto::SymmetricKey::DeriveKeyFromPassword(crypto::SymmetricKey::AES,
+ password,
+ salt,
+ kEncryptionIterations,
+ kDerivedKeySizeInBits));
DCHECK(encryption_key.get());
return encryption_key.release();
@@ -89,13 +89,13 @@
return true;
}
- scoped_ptr<base::SymmetricKey> encryption_key(GetEncryptionKey());
+ scoped_ptr<crypto::SymmetricKey> encryption_key(GetEncryptionKey());
if (!encryption_key.get())
return false;
std::string iv(kCCBlockSizeAES128, ' ');
- base::Encryptor encryptor;
- if (!encryptor.Init(encryption_key.get(), base::Encryptor::CBC, iv))
+ crypto::Encryptor encryptor;
+ if (!encryptor.Init(encryption_key.get(), crypto::Encryptor::CBC, iv))
return false;
if (!encryptor.Encrypt(plaintext, ciphertext))
@@ -127,13 +127,13 @@
std::string raw_ciphertext =
ciphertext.substr(strlen(kEncryptionVersionPrefix));
- scoped_ptr<base::SymmetricKey> encryption_key(GetEncryptionKey());
+ scoped_ptr<crypto::SymmetricKey> encryption_key(GetEncryptionKey());
if (!encryption_key.get())
return false;
std::string iv(kCCBlockSizeAES128, ' ');
- base::Encryptor encryptor;
- if (!encryptor.Init(encryption_key.get(), base::Encryptor::CBC, iv))
+ crypto::Encryptor encryptor;
+ if (!encryptor.Init(encryption_key.get(), crypto::Encryptor::CBC, iv))
return false;
if (!encryptor.Decrypt(raw_ciphertext, plaintext))
« no previous file with comments | « chrome/browser/password_manager/encryptor_linux.cc ('k') | chrome/browser/safe_browsing/filter_false_positive_perftest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698