From 7aceb21123b401b960ee157b5fbfb32c6a53b0e6 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Tue, 10 Nov 2020 18:07:20 +0100 Subject: [PATCH] Fix auth mode WEP (#2235) * Fix auth mode WEP * fix mapping --- supervisor/dbus/payloads/interface_update.tmpl | 2 +- supervisor/host/const.py | 2 +- supervisor/host/network.py | 4 ++-- tests/dbus/payloads/test_interface_update_payload.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/supervisor/dbus/payloads/interface_update.tmpl b/supervisor/dbus/payloads/interface_update.tmpl index 2423d5d1e..63dbaa981 100644 --- a/supervisor/dbus/payloads/interface_update.tmpl +++ b/supervisor/dbus/payloads/interface_update.tmpl @@ -85,7 +85,7 @@ }, '802-11-wireless-security': { - {% if interface.wifi.auth == "web" %} + {% if interface.wifi.auth == "wep" %} 'auth-alg': <'none'>, 'key-mgmt': <'none'> {% elif interface.wifi.auth == "wpa-psk" %} diff --git a/supervisor/host/const.py b/supervisor/host/const.py index c455a8a14..81eda44fb 100644 --- a/supervisor/host/const.py +++ b/supervisor/host/const.py @@ -22,7 +22,7 @@ class AuthMethod(str, Enum): """Authentication method.""" OPEN = "open" - WEB = "web" + WEP = "wep" WPA_PSK = "wpa-psk" diff --git a/supervisor/host/network.py b/supervisor/host/network.py index eac11f51b..bfbf34e6f 100644 --- a/supervisor/host/network.py +++ b/supervisor/host/network.py @@ -287,8 +287,8 @@ class Interface: return None # Authentication - if inet.settings.wireless_security.key_mgmt == "none": - auth = AuthMethod.WEB + if inet.settings.wireless_security.auth_alg == "none": + auth = AuthMethod.WEP elif inet.settings.wireless_security.key_mgmt == "wpa-psk": auth = AuthMethod.WPA_PSK else: diff --git a/tests/dbus/payloads/test_interface_update_payload.py b/tests/dbus/payloads/test_interface_update_payload.py index de7099d30..f4a874f6e 100644 --- a/tests/dbus/payloads/test_interface_update_payload.py +++ b/tests/dbus/payloads/test_interface_update_payload.py @@ -124,7 +124,7 @@ async def test_interface_update_payload_wireless_web(coresys): interface.type = InterfaceType.WIRELESS interface.wifi = WifiConfig( - WifiMode.INFRASTRUCTURE, "Test", AuthMethod.WEB, "password", 0 + WifiMode.INFRASTRUCTURE, "Test", AuthMethod.WEP, "password", 0 ) data = interface_update_payload(interface)