guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

148/197: installer: Support WEP encrypted wireless.


From: Danny Milosavljevic
Subject: 148/197: installer: Support WEP encrypted wireless.
Date: Mon, 3 Jul 2017 20:37:16 -0400 (EDT)

dannym pushed a commit to branch wip-installer-2
in repository guix.

commit b67aa1974f6d9c9475f63805364be4483fd11059
Author: John Darrington <address@hidden>
Date:   Fri Jan 27 13:36:41 2017 +0100

    installer: Support WEP encrypted wireless.
    
    * gnu/system/installer/wireless.scm (wireless-connect): Pass an AP
    instead of essid.
    * gnu/system/installer/passphrase.scm (passphrase-key-handler): Adjust
    the call appropriately.
---
 gnu/system/installer/passphrase.scm |  2 +-
 gnu/system/installer/wireless.scm   | 24 ++++++++++++++++++------
 2 files changed, 19 insertions(+), 7 deletions(-)

diff --git a/gnu/system/installer/passphrase.scm 
b/gnu/system/installer/passphrase.scm
index 491ac8c..b5b5170 100644
--- a/gnu/system/installer/passphrase.scm
+++ b/gnu/system/installer/passphrase.scm
@@ -93,7 +93,7 @@
      ((select-key? ch)
       (wireless-connect
        (page-datum page 'ifce)
-       (assq-ref access-point 'essid)
+       access-point
        (form-get-value form 'passphrase))
       (page-leave (cdr (cdr page-stack))))
 
diff --git a/gnu/system/installer/wireless.scm 
b/gnu/system/installer/wireless.scm
index a6e3b71..a10d2b9 100644
--- a/gnu/system/installer/wireless.scm
+++ b/gnu/system/installer/wireless.scm
@@ -247,21 +247,33 @@
 
 
 
-(define (wireless-connect ifce essid passphrase)
-  "Connect the wireless interface IFCE to the network advertising ESSID using
-the key PASSPHRASE."
+(define (wireless-connect ifce access-point passphrase)
+  "Connect the wireless interface IFCE to ACCESS-POINT using the key 
PASSPHRASE."
+
+  (let ((essid (assq-ref access-point 'essid))
+        (encr (assq-ref access-point 'encryption)))
+
   (call-with-temporary-output-file
    (lambda (filename port)
-     (format port "
+
+     (format port
+             (if (eq? encr 'wep) "
+network={
+\tssid=\"~a\"
+\tkey_mgmt=NONE
+\twep_key0=\"~a\"
+}
+"
+"
 network={
 \tssid=\"~a\"
 \tkey_mgmt=WPA-PSK
 \tpsk=\"~a\"
 }
-"
+")
              essid
              passphrase)
      (force-output port)
 
      (and (zero? (system* "wpa_supplicant" "-c" filename "-i" ifce "-B"))
-          (zero? (system* "dhclient" ifce))))))
+          (zero? (system* "dhclient" ifce)))))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]