| 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 "chromeos/network/onc/onc_normalizer.h" | 5 #include "chromeos/network/onc/onc_normalizer.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 void Normalizer::NormalizeCertificate(base::DictionaryValue* cert) { | 81 void Normalizer::NormalizeCertificate(base::DictionaryValue* cert) { |
| 82 using namespace certificate; | 82 using namespace certificate; |
| 83 | 83 |
| 84 bool remove = false; | 84 bool remove = false; |
| 85 cert->GetBooleanWithoutPathExpansion(kRemove, &remove); | 85 cert->GetBooleanWithoutPathExpansion(kRemove, &remove); |
| 86 RemoveEntryUnless(cert, certificate::kType, !remove); | 86 RemoveEntryUnless(cert, certificate::kType, !remove); |
| 87 | 87 |
| 88 std::string type; | 88 std::string type; |
| 89 cert->GetStringWithoutPathExpansion(certificate::kType, &type); | 89 cert->GetStringWithoutPathExpansion(certificate::kType, &type); |
| 90 RemoveEntryUnless(cert, kPKCS12, type == kClient); | 90 RemoveEntryUnless(cert, kPKCS12, type == kClient); |
| 91 RemoveEntryUnless(cert, kTrust, type == kServer || type == kAuthority); | 91 RemoveEntryUnless(cert, kTrustBits, type == kServer || type == kAuthority); |
| 92 RemoveEntryUnless(cert, kX509, type == kServer || type == kAuthority); | 92 RemoveEntryUnless(cert, kX509, type == kServer || type == kAuthority); |
| 93 } | 93 } |
| 94 | 94 |
| 95 void Normalizer::NormalizeEthernet(base::DictionaryValue* ethernet) { | 95 void Normalizer::NormalizeEthernet(base::DictionaryValue* ethernet) { |
| 96 using namespace ethernet; | 96 using namespace ethernet; |
| 97 | 97 |
| 98 std::string auth; | 98 std::string auth; |
| 99 ethernet->GetStringWithoutPathExpansion(kAuthentication, &auth); | 99 ethernet->GetStringWithoutPathExpansion(kAuthentication, &auth); |
| 100 RemoveEntryUnless(ethernet, kEAP, auth == k8021X); | 100 RemoveEntryUnless(ethernet, kEAP, auth == k8021X); |
| 101 } | 101 } |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 | 199 |
| 200 std::string security; | 200 std::string security; |
| 201 wifi->GetStringWithoutPathExpansion(wifi::kSecurity, &security); | 201 wifi->GetStringWithoutPathExpansion(wifi::kSecurity, &security); |
| 202 RemoveEntryUnless(wifi, kEAP, security == kWEP_8021X || security == kWPA_EAP); | 202 RemoveEntryUnless(wifi, kEAP, security == kWEP_8021X || security == kWPA_EAP); |
| 203 RemoveEntryUnless(wifi, kPassphrase, | 203 RemoveEntryUnless(wifi, kPassphrase, |
| 204 security == kWEP_PSK || security == kWPA_PSK); | 204 security == kWEP_PSK || security == kWPA_PSK); |
| 205 } | 205 } |
| 206 | 206 |
| 207 } // namespace onc | 207 } // namespace onc |
| 208 } // namespace chromeos | 208 } // namespace chromeos |
| OLD | NEW |