OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "chrome/browser/chromeos/arc/policy/arc_policy_bridge.h" | 5 #include "chrome/browser/chromeos/arc/policy/arc_policy_bridge.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 "" /* no passphrase */, &unused_network_configs, | 140 "" /* no passphrase */, &unused_network_configs, |
141 &unused_global_network_config, &certificates)) { | 141 &unused_global_network_config, &certificates)) { |
142 LOG(ERROR) << "Value of onc policy has invalid format =" << onc_blob; | 142 LOG(ERROR) << "Value of onc policy has invalid format =" << onc_blob; |
143 } | 143 } |
144 } | 144 } |
145 | 145 |
146 std::unique_ptr<base::ListValue> ca_certs( | 146 std::unique_ptr<base::ListValue> ca_certs( |
147 base::MakeUnique<base::ListValue>()); | 147 base::MakeUnique<base::ListValue>()); |
148 for (const auto& entry : certificates) { | 148 for (const auto& entry : certificates) { |
149 const base::DictionaryValue* certificate = nullptr; | 149 const base::DictionaryValue* certificate = nullptr; |
150 if (!entry->GetAsDictionary(&certificate)) { | 150 if (!entry.GetAsDictionary(&certificate)) { |
151 DLOG(FATAL) << "Value of a certificate entry is not a dictionary " | 151 DLOG(FATAL) << "Value of a certificate entry is not a dictionary " |
152 << "value."; | 152 << "value."; |
153 continue; | 153 continue; |
154 } | 154 } |
155 | 155 |
156 std::string cert_type; | 156 std::string cert_type; |
157 certificate->GetStringWithoutPathExpansion(::onc::certificate::kType, | 157 certificate->GetStringWithoutPathExpansion(::onc::certificate::kType, |
158 &cert_type); | 158 &cert_type); |
159 if (cert_type != ::onc::certificate::kAuthority) | 159 if (cert_type != ::onc::certificate::kAuthority) |
160 continue; | 160 continue; |
161 | 161 |
162 const base::ListValue* trust_list = nullptr; | 162 const base::ListValue* trust_list = nullptr; |
163 if (!certificate->GetListWithoutPathExpansion( | 163 if (!certificate->GetListWithoutPathExpansion( |
164 ::onc::certificate::kTrustBits, &trust_list)) { | 164 ::onc::certificate::kTrustBits, &trust_list)) { |
165 continue; | 165 continue; |
166 } | 166 } |
167 | 167 |
168 bool web_trust_flag = false; | 168 bool web_trust_flag = false; |
169 for (const auto& list_val : *trust_list) { | 169 for (const auto& list_val : *trust_list) { |
170 std::string trust_type; | 170 std::string trust_type; |
171 if (!list_val->GetAsString(&trust_type)) | 171 if (!list_val.GetAsString(&trust_type)) |
172 NOTREACHED(); | 172 NOTREACHED(); |
173 | 173 |
174 if (trust_type == ::onc::certificate::kWeb) { | 174 if (trust_type == ::onc::certificate::kWeb) { |
175 // "Web" implies that the certificate is to be trusted for SSL | 175 // "Web" implies that the certificate is to be trusted for SSL |
176 // identification. | 176 // identification. |
177 web_trust_flag = true; | 177 web_trust_flag = true; |
178 break; | 178 break; |
179 } | 179 } |
180 } | 180 } |
181 if (!web_trust_flag) | 181 if (!web_trust_flag) |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 } | 424 } |
425 | 425 |
426 if (reported_policies_hash == update_notification_policies_hash_ && | 426 if (reported_policies_hash == update_notification_policies_hash_ && |
427 !compliance_since_update_timing_reported_) { | 427 !compliance_since_update_timing_reported_) { |
428 UpdateComplianceSinceUpdateTiming(now - update_notification_time_); | 428 UpdateComplianceSinceUpdateTiming(now - update_notification_time_); |
429 compliance_since_update_timing_reported_ = true; | 429 compliance_since_update_timing_reported_ = true; |
430 } | 430 } |
431 } | 431 } |
432 | 432 |
433 } // namespace arc | 433 } // namespace arc |
OLD | NEW |