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

Unified Diff: components/policy/core/common/cloud/policy_header_service.cc

Issue 116273002: Added support for signed policy blobs on desktop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix for ios. Created 6 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
Index: components/policy/core/common/cloud/policy_header_service.cc
diff --git a/components/policy/core/common/cloud/policy_header_service.cc b/components/policy/core/common/cloud/policy_header_service.cc
index 7953f561a5837b69d396050a51c97f4e0bf0ae8f..3ba5b03c4a28ac3f2e2275badb5a5c72f1a48b1d 100644
--- a/components/policy/core/common/cloud/policy_header_service.cc
+++ b/components/policy/core/common/cloud/policy_header_service.cc
@@ -12,14 +12,19 @@
namespace {
const char kUserDMTokenKey[] = "user_dmtoken";
+const char kUserPolicyTokenKey[] = "user_policy_token";
+const char kVerificationKeyHashKey[] = "verification_key_hash";
}
namespace policy {
-PolicyHeaderService::PolicyHeaderService(const std::string& server_url,
- CloudPolicyStore* user_policy_store,
- CloudPolicyStore* device_policy_store)
+PolicyHeaderService::PolicyHeaderService(
+ const std::string& server_url,
+ const std::string& verification_key_hash,
+ CloudPolicyStore* user_policy_store,
+ CloudPolicyStore* device_policy_store)
: server_url_(server_url),
+ verification_key_hash_(verification_key_hash),
user_policy_store_(user_policy_store),
device_policy_store_(device_policy_store) {
user_policy_store_->AddObserver(this);
@@ -54,10 +59,20 @@ std::string PolicyHeaderService::CreateHeaderValue() {
// {
// user_dmtoken: <dm_token>
// user_policy_token: <policy_token>
+ // verification_key_hash: <key_hash>
// }
std::string user_dm_token = user_policy_store_->policy()->request_token();
base::DictionaryValue value;
value.SetString(kUserDMTokenKey, user_dm_token);
+ // TODO(atwilson): Enable this once policy token is available.
+ //if (user_policy_store_->policy()->has_policy_token()) {
+ // value.SetString(kUserPolicyTokenKey,
+ // user_policy_store_->policy()->policy_token());
+ //}
+ value.SetString(kUserPolicyTokenKey, "");
+ if (!verification_key_hash_.empty())
+ value.SetString(kVerificationKeyHashKey, verification_key_hash_);
+
// TODO(atwilson): add user_policy_token once the server starts sending it
// down (http://crbug.com/326799).
std::string json;

Powered by Google App Engine
This is Rietveld 408576698