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

Unified Diff: chrome/browser/protector/protector.cc

Issue 8430027: Added histogram on successful check. Safe verification (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 2 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/protector/protector.cc
diff --git a/chrome/browser/protector/protector.cc b/chrome/browser/protector/protector.cc
index e26fe18b8eea59a542401231c2675f1164139366..474374095d9df08ee5d6945b3d1f7449f500a5d4 100644
--- a/chrome/browser/protector/protector.cc
+++ b/chrome/browser/protector/protector.cc
@@ -77,4 +77,10 @@ std::string SignSetting(const std::string& value) {
return std::string(&digest[0], &digest[0] + digest.size());
}
+bool IsSettingValid(const std::string& value, const std::string& signature) {
+ crypto::HMAC hmac(crypto::HMAC::SHA256);
+ DCHECK(hmac.Init(kProtectorSigningKey));
Ivan Korotkov 2011/11/01 14:18:39 Init should be called outside of DCHECK.
+ return hmac.Verify(value, signature);
+}
+
} // namespace protector

Powered by Google App Engine
This is Rietveld 408576698