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

Unified Diff: chrome/browser/password_manager/encryptor_linux.cc

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_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))
« no previous file with comments | « chrome/browser/importer/nss_decryptor_system_nss.cc ('k') | chrome/browser/password_manager/encryptor_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698