mirror of
https://github.com/gryf/wicd.git
synced 2025-12-20 21:08:06 +01:00
Fixed problems with passphrases using non-alphanumeric characters.
This commit is contained in:
@@ -674,6 +674,10 @@ class WirelessConnectThread(ConnectThread):
|
|||||||
process if encryption is on.
|
process if encryption is on.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
def _sanitize(key):
|
||||||
|
""" Escapes characters wpa_supplicant doesn't handle properly. """
|
||||||
|
return key.replace("$", "\$").replace("`", "\`").replace("\"",
|
||||||
|
"\\\"")
|
||||||
# Check to see if we need to generate a PSK (only for non-ralink
|
# Check to see if we need to generate a PSK (only for non-ralink
|
||||||
# cards).
|
# cards).
|
||||||
if self.network.get('key'):
|
if self.network.get('key'):
|
||||||
@@ -685,7 +689,7 @@ class WirelessConnectThread(ConnectThread):
|
|||||||
self.network['psk'] = misc.RunRegex(key_pattern,
|
self.network['psk'] = misc.RunRegex(key_pattern,
|
||||||
misc.Run(''.join(['wpa_passphrase "',
|
misc.Run(''.join(['wpa_passphrase "',
|
||||||
self.network['essid'], '" "',
|
self.network['essid'], '" "',
|
||||||
re.escape(self.network['key']), '"'])))
|
_sanitize(self.network['key']), '"'])))
|
||||||
# Generate the wpa_supplicant file...
|
# Generate the wpa_supplicant file...
|
||||||
if self.network.get('enctype'):
|
if self.network.get('enctype'):
|
||||||
self.SetStatus('generating_wpa_config')
|
self.SetStatus('generating_wpa_config')
|
||||||
|
|||||||
Reference in New Issue
Block a user