diff options
author | Ajay Garg <ajay@activitycentral.com> | 2011-12-15 14:55:13 (GMT) |
---|---|---|
committer | Anish Mangal <anish@activitycentral.com> | 2012-02-01 12:33:31 (GMT) |
commit | c07c229b041c77fa1546f7bed91a02319ae24743 (patch) | |
tree | a6e2c55ebff4e3cf1a766d36c41c0ff98163ffae /src/jarabe/model/network.py | |
parent | fac510face3a03d43b758e1c1fce0eece053279b (diff) |
Add capability to connect to WPA/WPA2-Enterprise Networks.
(Note that this is a consolidated patch, to be applied in full;
and NOT OVER version-4, version-3, version-2, and version-1 patches).
Enhancements/Fixes of current version (version-5), over version-4 ::
--------------------------------------------------------------------
a. Fixed the regression - Unable to connect to Unprotected-Wireless-Networks.
Catcher :: Anish.
For the record.
----------------
Enhancements/Fixes of version-4, over version-3 ::
--------------------------------------------------
a. Fixing logging statements, and some formatting-changes (Thanks Sascha).
b. Not passing parameters to NetworkManager, that are not entered (required),
as in TTLS- and PEAP-configuration (Thanks Anish).
For the record.
----------------
Enhancements/Fixes of version-3, over version-2 ::
--------------------------------------------------------------------
a. Now, TLS-based-authentication is also supported.
-----------------------------------------------
Thus, now, the following three authentication types are supported :
(i) TTLS
(ii) PEAP
(iii) TLS
Following authentication types are still not supported :
(i) LEAP (actually this may work, but the set-up has not been
able to be worked out, and hence, this has not been
verified, even with nm-applet).
b. Journal-Chooser integration.
----------------------------
This is useful in picking up chooser-entries (especially in case
of certificates requirements, like in TLS and TTLS).
For the record.
----------------
Enhancements/Fixes of version-2, over version-1 ::
--------------------------------------------------
a. Network-Autoconnect-Upon-Hibernate-Resume
------------------------------------------
Fixing the case, when network wouldn't (auto-)come-up,
when the XO resumed from hibernation. (Thanks Anish for
catching that :-) ).
However, there wasn't a problem with auto-connect-on-reboot;
it's working fine.
Signed-off-by: Ajay Garg <ajay@activitycentral.com>
Diffstat (limited to 'src/jarabe/model/network.py')
-rw-r--r-- | src/jarabe/model/network.py | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/src/jarabe/model/network.py b/src/jarabe/model/network.py index f265ae4..84e3666 100644 --- a/src/jarabe/model/network.py +++ b/src/jarabe/model/network.py @@ -418,6 +418,7 @@ class Settings(object): self.connection = Connection() self.ip4_config = None self.wireless_security = None + self.wpa_eap_setting = None if wireless_cfg is not None: self.wireless = wireless_cfg @@ -433,6 +434,10 @@ class Settings(object): self.wireless_security.get_dict() if self.ip4_config is not None: settings['ipv4'] = self.ip4_config.get_dict() + if self.wpa_eap_setting is not None: + settings['802-1x'] = self.wpa_eap_setting + + return settings @@ -653,6 +658,9 @@ class NMSettingsConnection(dbus.service.Object): if self._settings.wireless.security is not None: config.set(identifier, 'security', self._settings.wireless.security) + if self._settings.wpa_eap_setting is not None: + config.set(identifier, 'wpa_eap_setting', + self._settings.wpa_eap_setting) if self._secrets is not None: if self._settings.wireless_security.key_mgmt == 'none': config.set(identifier, 'key', self._secrets.wep_key) @@ -895,21 +903,29 @@ def load_wifi_connections(): settings.wireless_security.key_mgmt = mgmt security = config.get(section, 'security') settings.wireless.security = security - key = config.get(section, 'key') if mgmt == 'none': + key = config.get(section, 'key') secrets.wep_key = key auth_alg = config.get(section, 'auth-alg') secrets.auth_alg = auth_alg - elif mgmt == 'wpa-psk': - secrets.psk = key + elif (mgmt == 'wpa-psk') or (mgmt == 'wpa-eap'): + if mgmt == 'wpa-psk': + key = config.get(section, 'key') + secrets.psk = key + elif mgmt == 'wpa-eap': + if config.has_option(section, + 'wpa_eap_setting'): + value = eval(config.get(section, + 'wpa_eap_setting')) + settings.wpa_eap_setting = value if config.has_option(section, 'proto'): - value = config.get(section, 'proto') + value = eval(config.get(section, 'proto')) settings.wireless_security.proto = value if config.has_option(section, 'group'): - value = config.get(section, 'group') + value = eval(config.get(section, 'group')) settings.wireless_security.group = value if config.has_option(section, 'pairwise'): - value = config.get(section, 'pairwise') + value = eval(config.get(section, 'pairwise')) settings.wireless_security.pairwise = value except ConfigParser.Error: logging.exception('Error reading section') |