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

Unified Diff: chrome/browser/signin/local_auth.h

Issue 862103002: Only store leading 13 bits of password hash. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make LocalAuth a class so methods can be private and exposed only to tests. Created 5 years, 11 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 | « chrome/browser/signin/chrome_signin_client.cc ('k') | chrome/browser/signin/local_auth.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/signin/local_auth.h
diff --git a/chrome/browser/signin/local_auth.h b/chrome/browser/signin/local_auth.h
index 2342a8142a2da6591238c44e2bba0a85401cd6b0..570b5bc345a81e5ea9aeedc551fb9e183b7e1f96 100644
--- a/chrome/browser/signin/local_auth.h
+++ b/chrome/browser/signin/local_auth.h
@@ -11,28 +11,46 @@
#include <string>
+#include "base/gtest_prod_util.h"
+
+class LocalAuthTest;
class Profile;
namespace user_prefs {
class PrefRegistrySyncable;
}
-namespace chrome {
+class LocalAuth {
+ public:
+ static void RegisterLocalAuthPrefs(
+ user_prefs::PrefRegistrySyncable* registry);
+
+ static void SetLocalAuthCredentials(size_t profile_info_index,
+ const std::string& password);
+
-void RegisterLocalAuthPrefs(user_prefs::PrefRegistrySyncable* registry);
+ static void SetLocalAuthCredentials(const Profile* profile,
+ const std::string& password);
-void SetLocalAuthCredentials(size_t profile_info_index,
- const std::string& password);
+ static bool ValidateLocalAuthCredentials(size_t profile_info_index,
+ const std::string& password);
-void SetLocalAuthCredentials(const Profile* profile,
- const std::string& password);
+ static bool ValidateLocalAuthCredentials(const Profile* profile,
+ const std::string& password);
-bool ValidateLocalAuthCredentials(size_t profile_info_index,
- const std::string& password);
+ private:
+ FRIEND_TEST_ALL_PREFIXES(LocalAuthTest, SetUpgradeAndCheckCredentials);
+ FRIEND_TEST_ALL_PREFIXES(LocalAuthTest, TruncateStringEvenly);
+ FRIEND_TEST_ALL_PREFIXES(LocalAuthTest, TruncateStringUnevenly);
-bool ValidateLocalAuthCredentials(const Profile* profile,
- const std::string& password);
+ // Return only the first |len_bits| bits of the string |str|. Defined here for
+ // testing.
+ static std::string TruncateStringByBits(const std::string& str,
+ const size_t len_bits);
-} // namespace chrome
+ static void SetLocalAuthCredentialsWithEncoding(size_t profile_info_index,
+ const std::string& password,
+ char encoding_version);
+};
#endif // CHROME_BROWSER_SIGNIN_LOCAL_AUTH_H_
« no previous file with comments | « chrome/browser/signin/chrome_signin_client.cc ('k') | chrome/browser/signin/local_auth.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698