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

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

Issue 11493003: Remove the protector service. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix implicit ExtensionSystem -> TemplateURLService dependency Created 8 years 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_utils.h ('k') | chrome/browser/protector/session_startup_change.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/protector/protector_utils.cc
diff --git a/chrome/browser/protector/protector_utils.cc b/chrome/browser/protector/protector_utils.cc
deleted file mode 100644
index 80adc399f241028c9854ecfbaba09fda7ccd4efa..0000000000000000000000000000000000000000
--- a/chrome/browser/protector/protector_utils.cc
+++ /dev/null
@@ -1,47 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/protector/protector_utils.h"
-
-#include <vector>
-
-#include "base/command_line.h"
-#include "base/logging.h"
-#include "chrome/browser/browser_process.h"
-#include "chrome/browser/protector/keys.h"
-#include "chrome/common/chrome_switches.h"
-#include "crypto/hmac.h"
-
-namespace protector {
-
-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::kProtector);
-}
-
-} // namespace protector
« no previous file with comments | « chrome/browser/protector/protector_utils.h ('k') | chrome/browser/protector/session_startup_change.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698