| Index: chrome/browser/password_manager/encryptor_linux.cc
|
| ===================================================================
|
| --- chrome/browser/password_manager/encryptor_linux.cc (revision 81350)
|
| +++ chrome/browser/password_manager/encryptor_linux.cc (working copy)
|
| @@ -4,11 +4,11 @@
|
|
|
| #include "chrome/browser/password_manager/encryptor.h"
|
|
|
| -#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"
|
|
|
| namespace {
|
|
|
| @@ -32,7 +32,7 @@
|
| // Generates a newly allocated SymmetricKey object based a hard-coded password.
|
| // Ownership of the key is passed to the caller. Returns NULL key if a key
|
| // generation error occurs.
|
| -base::SymmetricKey* GetEncryptionKey() {
|
| +crypto::SymmetricKey* GetEncryptionKey() {
|
| // We currently "obfuscate" by encrypting and decrypting with hard-coded
|
| // password. We need to improve this password situation by moving a secure
|
| // password into a system-level key store.
|
| @@ -41,12 +41,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();
|
| @@ -81,13 +81,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(kIVBlockSizeAES128, ' ');
|
| - 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))
|
| @@ -123,13 +123,13 @@
|
| // Strip off the versioning prefix before decrypting.
|
| std::string raw_ciphertext = ciphertext.substr(strlen(kObfuscationPrefix));
|
|
|
| - scoped_ptr<base::SymmetricKey> encryption_key(GetEncryptionKey());
|
| + scoped_ptr<crypto::SymmetricKey> encryption_key(GetEncryptionKey());
|
| if (!encryption_key.get())
|
| return false;
|
|
|
| std::string iv(kIVBlockSizeAES128, ' ');
|
| - 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))
|
|
|