summaryrefslogtreecommitdiffstats
path: root/components/onc
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 /components/onc
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 'components/onc')
-rw-r--r--components/onc/docs/onc_spec.html29
-rw-r--r--components/onc/onc_constants.cc1
-rw-r--r--components/onc/onc_constants.h1
3 files changed, 29 insertions, 2 deletions
diff --git a/components/onc/docs/onc_spec.html b/components/onc/docs/onc_spec.html
index f4e70c8..a5e27eb 100644
--- a/components/onc/docs/onc_spec.html
+++ b/components/onc/docs/onc_spec.html
@@ -669,6 +669,21 @@
EAP settings.
</dd>
+ <dt class="field">HexSSID</dt>
+ <dd>
+ <span class="field_meta">
+ (optional if <span class="field">SSID</span> is set, if so defaults to
+ a hex representation of <span class="field">SSID</span>)
+ <span class="type">string</span>
+ </span>
+ Hex representation of the network's SSID. If the
+ <span class="field">SSID</span> field is set, but
+ <span class="field">HexSSID</span> is not, converts the contents of the
+ <span class="field">SSID</span> field to UTF-8 encoding,
+ creates the hex representation and assigns the result to
+ <span class="field">HexSSID</span>.
+ </dd>
+
<dt class="field">HiddenSSID</dt>
<dd>
<span class="field_meta">
@@ -711,10 +726,12 @@
<dt class="field">SSID</dt>
<dd>
<span class="field_meta">
- (required)
+ (optional if <span class="field">HexSSID</span> is set)
<span class="type">string</span>
</span>
- SSID of the network.
+ SSID of the network. This field can only used for unicode strings in the
+ UTF-8 encoding. For non-UTF-8 encodings the
+ <span class="field">HexSSID</span> field must be used.
</dd>
<dt class="field">SignalStrength</dt>
@@ -728,6 +745,14 @@
be set to '0' or not present.
</dd>
</dl>
+ <span class="rule">
+ <span class="rule_id"></span>
+ At least one of the fields <span class="field">HexSSID</span> or
+ <span class="field">SSID</span> must be present. If both
+ <span class="field">HexSSID</span> and <span class="field">SSID</span>
+ are set, the values must be consistent.
+ </span>
+ </span>
</section>
<section>
diff --git a/components/onc/onc_constants.cc b/components/onc/onc_constants.cc
index e9d1905..51dfbc5 100644
--- a/components/onc/onc_constants.cc
+++ b/components/onc/onc_constants.cc
@@ -183,6 +183,7 @@ const char kBSSID[] = "BSSID";
const char kEAP[] = "EAP";
const char kFrequency[] = "Frequency";
const char kFrequencyList[] = "FrequencyList";
+const char kHexSSID[] = "HexSSID";
const char kHiddenSSID[] = "HiddenSSID";
const char kPassphrase[] = "Passphrase";
const char kSSID[] = "SSID";
diff --git a/components/onc/onc_constants.h b/components/onc/onc_constants.h
index 89b193b..9b9d1ad 100644
--- a/components/onc/onc_constants.h
+++ b/components/onc/onc_constants.h
@@ -201,6 +201,7 @@ ONC_EXPORT extern const char kBSSID[];
ONC_EXPORT extern const char kEAP[];
ONC_EXPORT extern const char kFrequency[];
ONC_EXPORT extern const char kFrequencyList[];
+ONC_EXPORT extern const char kHexSSID[];
ONC_EXPORT extern const char kHiddenSSID[];
ONC_EXPORT extern const char kPassphrase[];
ONC_EXPORT extern const char kSSID[];