[libnma/lr/no-wep-by-default: 2/2] wifi-dialog: don't offer WEP when creating hidden networks




commit 728cec59bb97fe3d4eea10ce3a0acb2b0ebbfad6
Author: Lubomir Rintel <lkundrak v3 sk>
Date:   Tue Jun 7 16:16:56 2022 +0200

    wifi-dialog: don't offer WEP when creating hidden networks
    
    Assume WEP is not going to work if we're constructing a security
    combo without an AP object -- connecting to a hidden network.
    
    WEP is being disabled everywhere these days and chances it's not going
    to work are increasing. It's also known not to be secure these days.

 src/nma-wifi-dialog.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
---
diff --git a/src/nma-wifi-dialog.c b/src/nma-wifi-dialog.c
index 33181a93..d2802b27 100644
--- a/src/nma-wifi-dialog.c
+++ b/src/nma-wifi-dialog.c
@@ -825,6 +825,13 @@ out:
        g_free (info);
 }
 
+static gboolean
+allow_wep (void)
+{
+       /* Note to whoever uses this: this might go away! */
+       return !!getenv ("NM_ALLOW_INSECURE_WEP");
+}
+
 static gboolean
 security_valid (NMUtilsSecurityType sectype,
                 NM80211Mode mode,
@@ -834,6 +841,11 @@ security_valid (NMUtilsSecurityType sectype,
                 NM80211ApSecurityFlags ap_wpa,
                 NM80211ApSecurityFlags ap_rsn)
 {
+       if (   !have_ap && !allow_wep()
+           && (sectype == NMU_SEC_STATIC_WEP || sectype == NMU_SEC_DYNAMIC_WEP)) {
+               return FALSE;
+       }
+
        switch (mode) {
        case NM_802_11_MODE_AP:
                if (sectype == NMU_SEC_SAE)


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