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

Side by Side Diff: chromeos/network/onc/onc_validator_unittest.cc

Issue 2859123003: Don't reject server and CA certs during device ONC validation (Closed)
Patch Set: Created 3 years, 7 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 unified diff | Download patch
OLDNEW
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_validator.h" 5 #include "chromeos/network/onc/onc_validator.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 true, 156 true,
157 ::onc::ONC_SOURCE_DEVICE_POLICY), 157 ::onc::ONC_SOURCE_DEVICE_POLICY),
158 // AllowOnlyPolicyNetworksToConnect is only allowed for device policies. 158 // AllowOnlyPolicyNetworksToConnect is only allowed for device policies.
159 OncParams("managed_toplevel_with_only_managed.onc", 159 OncParams("managed_toplevel_with_only_managed.onc",
160 &kToplevelConfigurationSignature, 160 &kToplevelConfigurationSignature,
161 true, 161 true,
162 ::onc::ONC_SOURCE_DEVICE_POLICY), 162 ::onc::ONC_SOURCE_DEVICE_POLICY),
163 OncParams("managed_toplevel_l2tpipsec.onc", 163 OncParams("managed_toplevel_l2tpipsec.onc",
164 &kToplevelConfigurationSignature, 164 &kToplevelConfigurationSignature,
165 true), 165 true),
166 OncParams("managed_toplevel_with_server_and_ca_cert.onc",
167 &kToplevelConfigurationSignature,
168 true),
166 OncParams("toplevel_wifi_hexssid.onc", 169 OncParams("toplevel_wifi_hexssid.onc",
167 &kToplevelConfigurationSignature, 170 &kToplevelConfigurationSignature,
168 false), 171 false),
169 OncParams("toplevel_wifi_ssid_and_hexssid.onc", 172 OncParams("toplevel_wifi_ssid_and_hexssid.onc",
170 &kToplevelConfigurationSignature, 173 &kToplevelConfigurationSignature,
171 false), 174 false),
172 OncParams("toplevel_wifi_wpa_psk.onc", 175 OncParams("toplevel_wifi_wpa_psk.onc",
173 &kToplevelConfigurationSignature, 176 &kToplevelConfigurationSignature,
174 false), 177 false),
175 OncParams("toplevel_wifi_wep_proxy.onc", 178 OncParams("toplevel_wifi_wep_proxy.onc",
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 ExpectBothNotValid("toplevel-empty", "toplevel-empty")), 458 ExpectBothNotValid("toplevel-empty", "toplevel-empty")),
456 std::make_pair(OncParams("wifi-ssid-and-hexssid-inconsistent", 459 std::make_pair(OncParams("wifi-ssid-and-hexssid-inconsistent",
457 &kNetworkConfigurationSignature, 460 &kNetworkConfigurationSignature,
458 false), 461 false),
459 ExpectBothNotValid("wifi-ssid-and-hexssid-repaired", 462 ExpectBothNotValid("wifi-ssid-and-hexssid-repaired",
460 "wifi-ssid-and-hexssid-repaired")), 463 "wifi-ssid-and-hexssid-repaired")),
461 std::make_pair(OncParams("wifi-ssid-and-hexssid-partially-invalid", 464 std::make_pair(OncParams("wifi-ssid-and-hexssid-partially-invalid",
462 &kNetworkConfigurationSignature, 465 &kNetworkConfigurationSignature,
463 false), 466 false),
464 ExpectBothNotValid("wifi-ssid-and-hexssid-repaired", 467 ExpectBothNotValid("wifi-ssid-and-hexssid-repaired",
465 "wifi-ssid-and-hexssid-repaired")), 468 "wifi-ssid-and-hexssid-repaired"))));
466 std::make_pair(
467 OncParams("toplevel-with-server-and-ca-cert",
468 &kToplevelConfigurationSignature,
469 true,
470 ::onc::ONC_SOURCE_DEVICE_POLICY),
471 ExpectBothNotValid("toplevel-server-and-ca-cert-dropped",
472 "toplevel-server-and-ca-cert-dropped"))));
473 469
474 // Strict and liberal validator both repair, but with different results. 470 // Strict and liberal validator both repair, but with different results.
475 INSTANTIATE_TEST_CASE_P( 471 INSTANTIATE_TEST_CASE_P(
476 StrictAndLiberalRepairDifferently, 472 StrictAndLiberalRepairDifferently,
477 ONCValidatorTestRepairable, 473 ONCValidatorTestRepairable,
478 ::testing::Values(std::make_pair(OncParams("toplevel-with-nested-warning", 474 ::testing::Values(std::make_pair(OncParams("toplevel-with-nested-warning",
479 &kToplevelConfigurationSignature, 475 &kToplevelConfigurationSignature,
480 false), 476 false),
481 ExpectBothNotValid("toplevel-empty", 477 ExpectBothNotValid("toplevel-empty",
482 "toplevel-repaired")))); 478 "toplevel-repaired"))));
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 &kNetworkWithStateSignature, 572 &kNetworkWithStateSignature,
577 true), 573 true),
578 ExpectBothNotValid("", "")), 574 ExpectBothNotValid("", "")),
579 std::make_pair(OncParams("tether-signal-strength-over-100", 575 std::make_pair(OncParams("tether-signal-strength-over-100",
580 &kNetworkWithStateSignature, 576 &kNetworkWithStateSignature,
581 true), 577 true),
582 ExpectBothNotValid("", "")))); 578 ExpectBothNotValid("", ""))));
583 579
584 } // namespace onc 580 } // namespace onc
585 } // namespace chromeos 581 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698