Bug 775499 - 0002. Handle subject match setting. r=vchang
authorChuck Lee <chulee@mozilla.com>
Mon, 19 May 2014 14:41:08 +0800
changeset 207236 a131319faac2444e8dd1ce4b26df51a784ba1768
parent 207235 f75b8fff6effcb01363f39e34bba3aecc0e46a40
child 207237 e982377e39a3b41771a5d12ef121107cd543bfcf
push id494
push userraliiev@mozilla.com
push dateMon, 25 Aug 2014 18:42:16 +0000
treeherdermozilla-release@a3cc3e46b571 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvchang
bugs775499
milestone32.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 775499 - 0002. Handle subject match setting. r=vchang
dom/wifi/WifiWorker.js
--- a/dom/wifi/WifiWorker.js
+++ b/dom/wifi/WifiWorker.js
@@ -1148,17 +1148,17 @@ var WifiManager = (function() {
   manager.disconnect = wifiCommand.disconnect;
   manager.reconnect = wifiCommand.reconnect;
   manager.reassociate = wifiCommand.reassociate;
 
   var networkConfigurationFields = [
     "ssid", "bssid", "psk", "wep_key0", "wep_key1", "wep_key2", "wep_key3",
     "wep_tx_keyidx", "priority", "key_mgmt", "scan_ssid", "disabled",
     "identity", "password", "auth_alg", "phase1", "phase2", "eap", "pin",
-    "pcsc", "ca_cert"
+    "pcsc", "ca_cert", "subject_match"
   ];
 
   manager.getNetworkConfiguration = function(config, callback) {
     var netId = config.netId;
     var done = 0;
     for (var n = 0; n < networkConfigurationFields.length; ++n) {
       let fieldName = networkConfigurationFields[n];
       wifiCommand.getNetworkVariable(netId, fieldName, function(value) {
@@ -1855,16 +1855,19 @@ function WifiWorker() {
     if (net.netId)
       pub.known = true;
     if (net.scan_ssid === 1)
       pub.hidden = true;
     if ("ca_cert" in net && net.ca_cert &&
         net.ca_cert.indexOf("keystore://WIFI_SERVERCERT_" === 0)) {
       pub.serverCertificate = net.ca_cert.substr(27);
     }
+    if(net.subject_match) {
+      pub.subjectMatch = net.subject_match;
+    }
     return pub;
   };
 
   netFromDOM = function(net, configured) {
     // Takes a network from the DOM and makes it suitable for insertion into
     // self.configuredNetworks (that is calling addNetwork will do the right
     // thing).
     // NB: Modifies net in place: safe since we don't share objects between
@@ -1939,16 +1942,19 @@ function WifiWorker() {
           net.phase2 = quote("auth=" + net.phase2);
         } else {  // TLS, TTLS
           net.phase2 = quote("autheap=" + net.phase2);
         }
       }
 
       if (hasValidProperty("serverCertificate"))
         net.ca_cert = quote("keystore://WIFI_SERVERCERT_" + net.serverCertificate);
+
+      if (hasValidProperty("subjectMatch"))
+        net.subject_match = quote(net.subjectMatch);
     }
 
     return net;
   };
 
   WifiManager.onsupplicantconnection = function() {
     debug("Connected to supplicant");
     WifiManager.enabled = true;