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

Unified Diff: components/encryptor/encryptor_mac.mm

Issue 176583002: [OS X] Wire up --use-mock-keychain command line flag to encryptor module (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix license header Created 6 years, 10 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
« no previous file with comments | « components/encryptor.gypi ('k') | components/encryptor/encryptor_switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/encryptor/encryptor_mac.mm
diff --git a/components/encryptor/encryptor_mac.mm b/components/encryptor/encryptor_mac.mm
index f044c8424f0078199ca1fbb61c7d5b08045c62e5..583f18af62618a4b33f06edd70bc6979b29c043e 100644
--- a/components/encryptor/encryptor_mac.mm
+++ b/components/encryptor/encryptor_mac.mm
@@ -6,10 +6,12 @@
#include <CommonCrypto/CommonCryptor.h> // for kCCBlockSizeAES128
+#include "base/command_line.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "base/strings/utf_string_conversions.h"
#include "components/encryptor/encryptor_password_mac.h"
+#include "components/encryptor/encryptor_switches.h"
#include "crypto/apple_keychain.h"
#include "crypto/encryptor.h"
#include "crypto/symmetric_key.h"
@@ -40,9 +42,12 @@ const char kEncryptionVersionPrefix[] = "v10";
// key is passed to the caller. Returns NULL key in the case password access
// is denied or key generation error occurs.
crypto::SymmetricKey* GetEncryptionKey() {
+ static bool mock_keychain_command_line_flag =
+ CommandLine::ForCurrentProcess()->HasSwitch(
+ encryptor::switches::kUseMockKeychain);
std::string password;
- if (use_mock_keychain) {
+ if (use_mock_keychain || mock_keychain_command_line_flag) {
password = "mock_password";
} else {
AppleKeychain keychain;
« no previous file with comments | « components/encryptor.gypi ('k') | components/encryptor/encryptor_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698