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

Unified Diff: chromeos/cryptohome/cryptohome_library.cc

Issue 14522013: Separate cert loading code from CertLibrary and move to src/chromeos (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix browser tests Created 7 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: chromeos/cryptohome/cryptohome_library.cc
diff --git a/chromeos/cryptohome/cryptohome_library.cc b/chromeos/cryptohome/cryptohome_library.cc
index 684fcaef8ee2011ac9830c3bde3fdf908104b2d6..9529836538636edd821bd8661f91fcf76777e717 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);
Ryan Sleevi 2013/05/01 18:16:18 seems like unrelated cleanups from your local tree
std::string token;
CHECK(encryptor.SetCounter(nonce));
if (!encryptor.Decrypt(encrypted_token, &token)) {

Powered by Google App Engine
This is Rietveld 408576698