summaryrefslogtreecommitdiffstats
path: root/chromeos/cryptohome
diff options
context:
space:
mode:
authorstevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-06 19:51:56 +0000
committerstevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-06 19:51:56 +0000
commit75d93a876b019d2b55ed127350f515f29661beca (patch)
treed80a223360c76d9214d56523a5c73835de9b911f /chromeos/cryptohome
parentccc1722eae2c4f93e519007dbfd5c78ce73c6d71 (diff)
downloadchromium_src-75d93a876b019d2b55ed127350f515f29661beca.zip
chromium_src-75d93a876b019d2b55ed127350f515f29661beca.tar.gz
chromium_src-75d93a876b019d2b55ed127350f515f29661beca.tar.bz2
Separate cert loading code from CertLibrary and move to src/chromeos.
The intention of this CL is to move certificate loading code without chrome/i18n dependencies into src/chromeos. This is so that networking code that needs access to certificates can also be moved to src/chromeos. This also extracts CertLibrary from CrosLibrary. BUG=133752 R=gspencer@chromium.org, pneubeck@chromium.org Review URL: https://codereview.chromium.org/14522013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@198511 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos/cryptohome')
-rw-r--r--chromeos/cryptohome/cryptohome_library.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/chromeos/cryptohome/cryptohome_library.cc b/chromeos/cryptohome/cryptohome_library.cc
index 684fcae..9529836 100644
--- a/chromeos/cryptohome/cryptohome_library.cc
+++ b/chromeos/cryptohome/cryptohome_library.cc
@@ -23,7 +23,7 @@ namespace chromeos {
namespace {
const char kStubSystemSalt[] = "stub_system_salt";
-const size_t kKeySize = 16;
+const size_t kNonceSize = 16;
// Does nothing. Used as a Cryptohome::VoidMethodCallback.
void DoNothing(DBusMethodCallStatus call_status) {}
@@ -169,10 +169,10 @@ class CryptohomeLibraryImpl : public CryptohomeLibrary {
return system_salt_key_.get();
}
- crypto::SymmetricKey* PassphraseToKey(const std::string& passprhase,
+ crypto::SymmetricKey* PassphraseToKey(const std::string& passphrase,
const std::string& salt) {
return crypto::SymmetricKey::DeriveKeyFromPassword(
- crypto::SymmetricKey::AES, passprhase, salt, 1000, 256);
+ crypto::SymmetricKey::AES, passphrase, salt, 1000, 256);
}
@@ -185,7 +185,7 @@ class CryptohomeLibraryImpl : public CryptohomeLibrary {
LOG(WARNING) << "Failed to initialize Encryptor.";
return std::string();
}
- std::string nonce = salt.substr(0, kKeySize);
+ std::string nonce = salt.substr(0, kNonceSize);
std::string encoded_token;
CHECK(encryptor.SetCounter(nonce));
if (!encryptor.Encrypt(token, &encoded_token)) {
@@ -217,7 +217,7 @@ class CryptohomeLibraryImpl : public CryptohomeLibrary {
return std::string();
}
- std::string nonce = salt.substr(0, kKeySize);
+ std::string nonce = salt.substr(0, kNonceSize);
std::string token;
CHECK(encryptor.SetCounter(nonce));
if (!encryptor.Decrypt(encrypted_token, &token)) {