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

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

Issue 9863047: Exclude ProtectorService code from Android build. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 9 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/protector/protector_service.h ('k') | chrome/browser/protector/protector_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/protector/protector_service.cc
diff --git a/chrome/browser/protector/protector_service.cc b/chrome/browser/protector/protector_service.cc
index b35c294130a5bbcfdedbdc884a816a85c6c2f508..ce8b20a85cb2e331655130d13bba30920718fad4 100644
--- a/chrome/browser/protector/protector_service.cc
+++ b/chrome/browser/protector/protector_service.cc
@@ -4,19 +4,14 @@
#include "chrome/browser/protector/protector_service.h"
-#include "base/command_line.h"
#include "base/logging.h"
-#include "chrome/browser/browser_process.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/protector/settings_change_global_error.h"
-#include "chrome/browser/protector/keys.h"
#include "chrome/browser/protector/protected_prefs_watcher.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/common/chrome_notification_types.h"
-#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "content/public/browser/notification_source.h"
-#include "crypto/hmac.h"
namespace protector {
@@ -151,34 +146,4 @@ bool ProtectorService::MatchItemByError::operator()(
return other_ == item.error.get();
}
-
-std::string SignSetting(const std::string& value) {
- crypto::HMAC hmac(crypto::HMAC::SHA256);
- if (!hmac.Init(kProtectorSigningKey)) {
- LOG(WARNING) << "Failed to initialize HMAC algorithm for signing";
- return std::string();
- }
-
- std::vector<unsigned char> digest(hmac.DigestLength());
- if (!hmac.Sign(value, &digest[0], digest.size())) {
- LOG(WARNING) << "Failed to sign setting";
- return std::string();
- }
-
- 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);
- if (!hmac.Init(kProtectorSigningKey)) {
- LOG(WARNING) << "Failed to initialize HMAC algorithm for verification.";
- return false;
- }
- return hmac.Verify(value, signature);
-}
-
-bool IsEnabled() {
- return !CommandLine::ForCurrentProcess()->HasSwitch(switches::kNoProtector);
-}
-
} // namespace protector
« no previous file with comments | « chrome/browser/protector/protector_service.h ('k') | chrome/browser/protector/protector_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698