forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix IPsec configuration update using UI
Currently on network configuration updates through UI, there are some empty fields populated and not omitted before being validated by the ONC validator. One of these fields is the client certificate type. This CL ignores this field if it is empty and adds tests with client certificate type set to empty to make sure that the ONC validator will not complain and that the VPN configurations will get updated as expected. Bug: chromium:1043126 Test: chromeos_unittests -gtest_filter=ManagedNetworkConfigurationHandlerTest.* Change-Id: Ic84e4250e2c01744c6d4632108427d2478f64e16 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2035974 Reviewed-by: Steven Bennetts <stevenjb@chromium.org> Reviewed-by: Pavol Marko <pmarko@chromium.org> Commit-Queue: Omar Morsi <omorsi@google.com> Cr-Commit-Position: refs/heads/master@{#740593}
- Loading branch information
Showing
6 changed files
with
131 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"NetworkConfigurations": [ | ||
{ | ||
"GUID": "{a3860e83-f03d-4cb1-bafa-b22c9e746950}", | ||
"Name": "my vpn", | ||
"Type": "VPN", | ||
"VPN": { | ||
"AutoConnect": false, | ||
"Host": "vpn.my.domain.com", | ||
"Type": "L2TP-IPsec", | ||
"IPsec": { | ||
"AuthenticationType": "PSK", | ||
"IKEVersion": 1, | ||
"PSK": "my_psk", | ||
"Recommended": [ | ||
"PSK" | ||
] | ||
}, | ||
"L2TP": { | ||
"Username": "my_username", | ||
"Password": "my_password", | ||
"Recommended": [ | ||
"Password" | ||
], | ||
"SaveCredentials": true | ||
} | ||
} | ||
} | ||
], | ||
"Type": "UnencryptedConfiguration" | ||
} |
20 changes: 20 additions & 0 deletions
20
chromeos/test/data/network/policy/policy_vpn_ipsec_ui.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"GUID": "{a3860e83-f03d-4cb1-bafa-b22c9e746950}", | ||
"Name": "my vpn", | ||
"Type": "VPN", | ||
"VPN": { | ||
"AutoConnect": false, | ||
"Host": "vpn.my.domain.com", | ||
"Type": "L2TP-IPsec", | ||
"IPsec": { | ||
"AuthenticationType": "PSK", | ||
"PSK": "my_updated_psk", | ||
// ClientCertType Should be ignored if the AuthenticationType is PSK | ||
// (see onc_spec.md). | ||
"ClientCertType": "" | ||
}, | ||
"L2TP": { | ||
"Password": "my_updated_password" | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
chromeos/test/data/network/policy/shill_managed_vpn_ipsec.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"AutoConnect": false, | ||
"GUID": "{a3860e83-f03d-4cb1-bafa-b22c9e746950}", | ||
"Name": "my vpn", | ||
"Provider": { | ||
"Host": "vpn.my.domain.com", | ||
"Type": "l2tpipsec" | ||
}, | ||
"UIData": "{\"onc_source\":\"user_policy\",\"user_settings\":{}}", | ||
"Type": "vpn" | ||
} |
22 changes: 22 additions & 0 deletions
22
chromeos/test/data/network/policy/shill_policy_on_managed_vpn_ipsec_plus_ui.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"AutoConnect": false, | ||
"Device": "", | ||
"GUID": "{a3860e83-f03d-4cb1-bafa-b22c9e746950}", | ||
"Name": "my vpn", | ||
"Profile": "/profile/user1/shill", | ||
"Provider": { | ||
"Host": "vpn.my.domain.com", | ||
"L2TPIPsec.ClientCertID": "", | ||
"L2TPIPsec.ClientCertSlot": "", | ||
"L2TPIPsec.PIN": "", | ||
"L2TPIPsec.PSK": "my_updated_psk", | ||
"L2TPIPsec.Password": "my_updated_password", | ||
"L2TPIPsec.User": "my_username", | ||
"Type": "l2tpipsec" | ||
}, | ||
"SaveCredentials": true, | ||
"State": "idle", | ||
"Type": "vpn", | ||
"UIData": "{\"onc_source\":\"user_policy\",\"user_settings\":{\"GUID\":\"{a3860e83-f03d-4cb1-bafa-b22c9e746950}\",\"Name\":\"my vpn\",\"Type\":\"VPN\",\"VPN\":{\"AutoConnect\":false,\"Host\":\"vpn.my.domain.com\",\"IPsec\":{\"AuthenticationType\":\"PSK\",\"ClientCertType\":\"\",\"PSK\":\"FAKE_CREDENTIAL_VPaJDV9x\"},\"L2TP\":{\"Password\":\"FAKE_CREDENTIAL_VPaJDV9x\"},\"Type\":\"L2TP-IPsec\"}}}", | ||
"Visible": true | ||
} |