OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/policy/core/common/cloud/cloud_policy_constants.h" | 5 #include "components/policy/core/common/cloud/cloud_policy_constants.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "components/policy/core/common/policy_switches.h" | 9 #include "components/policy/core/common/policy_switches.h" |
10 | 10 |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 #if defined(OS_CHROMEOS) | 84 #if defined(OS_CHROMEOS) |
85 // TODO(atwilson): Enable this for ChromeOS. We don't verify the extra | 85 // TODO(atwilson): Enable this for ChromeOS. We don't verify the extra |
86 // verification signatures on ChromeOS to simplify testing, and because | 86 // verification signatures on ChromeOS to simplify testing, and because |
87 // ChromeOS doesn't need the extra verification because it already stores | 87 // ChromeOS doesn't need the extra verification because it already stores |
88 // the policy blob securely. | 88 // the policy blob securely. |
89 return std::string(); | 89 return std::string(); |
90 #else | 90 #else |
91 // Disable key verification by default until production servers generate | 91 // Disable key verification by default until production servers generate |
92 // the proper signatures. | 92 // the proper signatures. |
93 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 93 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
94 if (!command_line->HasSwitch(switches::kEnablePolicyKeyVerification)) { | 94 if (command_line->HasSwitch(switches::kDisablePolicyKeyVerification)) { |
95 return std::string(); | 95 return std::string(); |
96 } else { | 96 } else { |
97 return std::string(reinterpret_cast<const char*>(kPolicyVerificationKey), | 97 return std::string(reinterpret_cast<const char*>(kPolicyVerificationKey), |
98 sizeof(kPolicyVerificationKey)); | 98 sizeof(kPolicyVerificationKey)); |
99 } | 99 } |
100 #endif | 100 #endif |
101 } | 101 } |
102 | 102 |
103 const char* GetChromeUserPolicyType() { | 103 const char* GetChromeUserPolicyType() { |
104 #if defined(OS_ANDROID) || defined(OS_IOS) | 104 #if defined(OS_ANDROID) || defined(OS_IOS) |
105 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 105 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
106 if (command_line->HasSwitch(switches::kFakeCloudPolicyType)) | 106 if (command_line->HasSwitch(switches::kFakeCloudPolicyType)) |
107 return "google/chrome/user"; | 107 return "google/chrome/user"; |
108 #endif | 108 #endif |
109 return dm_protocol::kChromeUserPolicyType; | 109 return dm_protocol::kChromeUserPolicyType; |
110 } | 110 } |
111 | 111 |
112 } // namespace policy | 112 } // namespace policy |
OLD | NEW |