summaryrefslogtreecommitdiffstats
path: root/chromeos/test
diff options
context:
space:
mode:
authorcschuet <cschuet@chromium.org>2014-12-04 08:58:24 -0800
committerCommit bot <commit-bot@chromium.org>2014-12-04 16:58:58 +0000
commitdecce902f12dde8b6abdbfe625905be8fcb27ab0 (patch)
tree852ecc8de0d537d8065df755f647ac01ea9d29ff /chromeos/test
parentb3ad90b31caa593a4018c1f4c1aae44f4c4885f2 (diff)
downloadchromium_src-decce902f12dde8b6abdbfe625905be8fcb27ab0.zip
chromium_src-decce902f12dde8b6abdbfe625905be8fcb27ab0.tar.gz
chromium_src-decce902f12dde8b6abdbfe625905be8fcb27ab0.tar.bz2
ONC: add support for non-utf-8 SSIDs
ONC currently uses strings to represent SSIDs. Since JSON-Schema strings are restricted to Unicode and ONC is encoding these as UTF-8, this means that ONC cannot be used to represent SSIDs that include non-UTF-8 strings. This change adds a separate HexSSID field to the WiFi section of the ONC that expects an SSID byte sequence encoded in hex. At least one of the fields HexSSID or SSID must be present. If both HexSSID and SSID are set, the values must be consistent. BUG=432546 Review URL: https://codereview.chromium.org/759663004 Cr-Commit-Position: refs/heads/master@{#306838}
Diffstat (limited to 'chromeos/test')
-rw-r--r--chromeos/test/data/network/invalid_settings_with_repairs.json31
-rw-r--r--chromeos/test/data/network/settings_with_normalization.json20
-rw-r--r--chromeos/test/data/network/toplevel_wifi_hexssid.onc16
-rw-r--r--chromeos/test/data/network/toplevel_wifi_ssid_and_hexssid.onc17
4 files changed, 84 insertions, 0 deletions
diff --git a/chromeos/test/data/network/invalid_settings_with_repairs.json b/chromeos/test/data/network/invalid_settings_with_repairs.json
index a26a8aa..5022c05 100644
--- a/chromeos/test/data/network/invalid_settings_with_repairs.json
+++ b/chromeos/test/data/network/invalid_settings_with_repairs.json
@@ -158,6 +158,37 @@
},
"ConnectionState": "NotConnected"
},
+ "network-wifi-hexssid-invalid-length": {
+ "GUID": "guid",
+ "Type": "WiFi",
+ "Name": "name",
+ "WiFi": {
+ "Passphrase": "some passphrase",
+ "HexSSID": "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEFAB",
+ "Security": "WPA-PSK"
+ }
+ },
+ "network-wifi-invalid-hexssid": {
+ "GUID": "guid",
+ "Type": "WiFi",
+ "Name": "name",
+ "WiFi": {
+ "Passphrase": "some passphrase",
+ "HexSSID": "invalidhex",
+ "Security": "WPA-PSK"
+ }
+ },
+ "network-wifi-ssid-and-hexssid-inconsistent": {
+ "GUID": "guid",
+ "Type": "WiFi",
+ "Name": "name",
+ "WiFi": {
+ "Passphrase": "some passphrase",
+ "SSID": "ssid",
+ "HexSSID": "FFFFFF",
+ "Security": "WPA-PSK"
+ }
+ },
"network-unknown-value": {
"GUID": "guid",
"Type": "LTE",
diff --git a/chromeos/test/data/network/settings_with_normalization.json b/chromeos/test/data/network/settings_with_normalization.json
index 08a78a4..7038e59 100644
--- a/chromeos/test/data/network/settings_with_normalization.json
+++ b/chromeos/test/data/network/settings_with_normalization.json
@@ -30,4 +30,24 @@
"Authentication": "None"
}
},
+ "wifi": {
+ "GUID": "{77db0089-0bc8-4358-929c-123xcv}",
+ "Type": "WiFi",
+ "Name": "SomeWifi-XY",
+ "WiFi": {
+ "SSID": "SomeWifi-XY",
+ "Security": "None",
+ "Recommended": [ "AutoConnect" ]
+ }
+ },
+ "wifi-normalized": {
+ "GUID": "{77db0089-0bc8-4358-929c-123xcv}",
+ "Type": "WiFi",
+ "Name": "SomeWifi-XY",
+ "WiFi": {
+ "SSID": "SomeWifi-XY",
+ "HexSSID": "536F6D65576966692D5859",
+ "Security": "None"
+ }
+ }
}
diff --git a/chromeos/test/data/network/toplevel_wifi_hexssid.onc b/chromeos/test/data/network/toplevel_wifi_hexssid.onc
new file mode 100644
index 0000000..471a0bb
--- /dev/null
+++ b/chromeos/test/data/network/toplevel_wifi_hexssid.onc
@@ -0,0 +1,16 @@
+// Test ONC file for importing an open network.
+{
+ "NetworkConfigurations": [
+ {
+ "GUID": "{485d6076-dd44-6b6d-69787465725f5040}",
+ "Type": "WiFi",
+ "Name": "My WiFi Network",
+ "WiFi": {
+ "HexSSID": "476F6F676C65",
+ "Security": "None"
+ }
+ }
+ ],
+ "Certificates": [],
+ "Type": "UnencryptedConfiguration"
+}
diff --git a/chromeos/test/data/network/toplevel_wifi_ssid_and_hexssid.onc b/chromeos/test/data/network/toplevel_wifi_ssid_and_hexssid.onc
new file mode 100644
index 0000000..99be5bc
--- /dev/null
+++ b/chromeos/test/data/network/toplevel_wifi_ssid_and_hexssid.onc
@@ -0,0 +1,17 @@
+// Test ONC file for importing an open network.
+{
+ "NetworkConfigurations": [
+ {
+ "GUID": "{485d6076-dd44-6b6d-69787465725f5040}",
+ "Type": "WiFi",
+ "Name": "My WiFi Network",
+ "WiFi": {
+ "SSID": "Google",
+ "HexSSID": "476F6F676C65",
+ "Security": "None"
+ }
+ }
+ ],
+ "Certificates": [],
+ "Type": "UnencryptedConfiguration"
+}