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

Side by Side Diff: chrome/browser/password_manager/encryptor_mac.mm

Issue 9699112: Move *keychain_mac* files to crypto/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Made another pass Created 8 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/password_manager/encryptor.h" 5 #include "chrome/browser/password_manager/encryptor.h"
6 6
7 #include <CommonCrypto/CommonCryptor.h> // for kCCBlockSizeAES128 7 #include <CommonCrypto/CommonCryptor.h> // for kCCBlockSizeAES128
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "base/utf_string_conversions.h" 11 #include "base/utf_string_conversions.h"
12 #include "chrome/browser/password_manager/encryptor_password_mac.h"
12 #include "crypto/encryptor.h" 13 #include "crypto/encryptor.h"
14 #include "crypto/keychain_mac.h"
13 #include "crypto/symmetric_key.h" 15 #include "crypto/symmetric_key.h"
14 #include "chrome/browser/password_manager/encryptor_password_mac.h" 16
15 #include "chrome/browser/keychain_mac.h" 17 using crypto::MacKeychain;
16 18
17 namespace { 19 namespace {
18 20
19 // Salt for Symmetric key derivation. 21 // Salt for Symmetric key derivation.
20 const char kSalt[] = "saltysalt"; 22 const char kSalt[] = "saltysalt";
21 23
22 // Key size required for 128 bit AES. 24 // Key size required for 128 bit AES.
23 const size_t kDerivedKeySizeInBits = 128; 25 const size_t kDerivedKeySizeInBits = 128;
24 26
25 // Constant for Symmetic key derivation. 27 // Constant for Symmetic key derivation.
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 if (!encryptor.Decrypt(raw_ciphertext, plaintext)) 141 if (!encryptor.Decrypt(raw_ciphertext, plaintext))
140 return false; 142 return false;
141 143
142 return true; 144 return true;
143 } 145 }
144 146
145 void Encryptor::UseMockKeychain(bool use_mock) { 147 void Encryptor::UseMockKeychain(bool use_mock) {
146 use_mock_keychain = use_mock; 148 use_mock_keychain = use_mock;
147 } 149 }
148 150
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698