Chromium Code Reviews| 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 |