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

Unified Diff: chrome/browser/chromeos/cros/cryptohome_library.cc

Issue 10701075: Remove chromeos::CryptohomeLibrary::HashPassword (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Clarify comment in HashPassword() Created 8 years, 5 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: chrome/browser/chromeos/cros/cryptohome_library.cc
diff --git a/chrome/browser/chromeos/cros/cryptohome_library.cc b/chrome/browser/chromeos/cros/cryptohome_library.cc
index 8655f3650d6846b7ff21e110168e6d99d68887fa..19b799a5737330ee7a220f16786844432f7002e7 100644
--- a/chrome/browser/chromeos/cros/cryptohome_library.cc
+++ b/chrome/browser/chromeos/cros/cryptohome_library.cc
@@ -11,12 +11,10 @@
#include "base/string_util.h"
#include "chromeos/dbus/cryptohome_client.h"
#include "chromeos/dbus/dbus_thread_manager.h"
-#include "crypto/sha2.h"
namespace {
const char kStubSystemSalt[] = "stub_system_salt";
-const int kPassHashLen = 32;
}
@@ -127,21 +125,6 @@ class CryptohomeLibraryImpl : public CryptohomeLibrary {
return result;
}
- virtual std::string HashPassword(const std::string& password) OVERRIDE {
- // Get salt, ascii encode, update sha with that, then update with ascii
- // of password, then end.
- std::string ascii_salt = GetSystemSalt();
- char passhash_buf[kPassHashLen];
-
- // Hash salt and password
- crypto::SHA256HashString(ascii_salt + password,
- &passhash_buf, sizeof(passhash_buf));
-
- return StringToLowerASCII(base::HexEncode(
- reinterpret_cast<const void*>(passhash_buf),
- sizeof(passhash_buf) / 2));
- }
-
virtual std::string GetSystemSalt() OVERRIDE {
LoadSystemSalt(); // no-op if it's already loaded.
return StringToLowerASCII(base::HexEncode(
@@ -234,12 +217,6 @@ class CryptohomeLibraryStubImpl : public CryptohomeLibrary {
return !locked_;
}
- virtual std::string HashPassword(const std::string& password) OVERRIDE {
- return StringToLowerASCII(base::HexEncode(
- reinterpret_cast<const void*>(password.data()),
- password.length()));
- }
-
virtual std::string GetSystemSalt() OVERRIDE {
return kStubSystemSalt;
}
« no previous file with comments | « chrome/browser/chromeos/cros/cryptohome_library.h ('k') | chrome/browser/chromeos/cros/mock_cryptohome_library.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698