diff options
author | dhollowa@chromium.org <dhollowa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-16 01:51:45 +0000 |
---|---|---|
committer | dhollowa@chromium.org <dhollowa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-16 01:51:45 +0000 |
commit | ecbf289873708bcbaa35780063570e346faafd57 (patch) | |
tree | 524953253f35fb0c095f90aaff16a6103b5e8a18 /chrome/browser/password_manager/encryptor.h | |
parent | d5975c6b5d408767db7934347b7d4d137c657d30 (diff) | |
download | chromium_src-ecbf289873708bcbaa35780063570e346faafd57.zip chromium_src-ecbf289873708bcbaa35780063570e346faafd57.tar.gz chromium_src-ecbf289873708bcbaa35780063570e346faafd57.tar.bz2 |
AutoFill credit cards should be encrypted on the Mac
These changes add encryption support on Mac for the Encryptor class. AES 128 bit is used for the encryption, and the auto-generated password is stored now in the Mac Keychain. This implies the Encryptor class on Mac can now block for user input, and can fail if access is denied.
BUG=42038, 49131
TEST=EncryptorTest.CypherTextDiffers, EncryptorTest.DecryptError, EncryptorPasswordTest.*
Review URL: http://codereview.chromium.org/2943014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52590 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/password_manager/encryptor.h')
-rw-r--r-- | chrome/browser/password_manager/encryptor.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/chrome/browser/password_manager/encryptor.h b/chrome/browser/password_manager/encryptor.h index 8170892..480477c 100644 --- a/chrome/browser/password_manager/encryptor.h +++ b/chrome/browser/password_manager/encryptor.h @@ -1,7 +1,6 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// A class for encrypting/decrypting strings #ifndef CHROME_BROWSER_PASSWORD_MANAGER_ENCRYPTOR_H__ #define CHROME_BROWSER_PASSWORD_MANAGER_ENCRYPTOR_H__ @@ -11,6 +10,9 @@ #include "base/values.h" #include "base/string16.h" +// The Encryptor class gives access to simple encryption and decryption of +// strings. Note that on Mac, access to the system Keychain is required and +// these calls can block the current thread to collect user input. class Encryptor { public: // Encrypt a string16. The output (second argument) is @@ -37,6 +39,12 @@ class Encryptor { static bool DecryptString(const std::string& ciphertext, std::string* plaintext); +#if defined(OS_MACOSX) + // For unit testing purposes we instruct the Encryptor to use a mock Keychain + // on the Mac. The default is to use the real Keychain. + static void UseMockKeychain(bool use_mock); +#endif + private: DISALLOW_IMPLICIT_CONSTRUCTORS(Encryptor); }; |