summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristopher <root@teritum.dev>2024-06-10 19:52:48 +0100
committerChristian Breunig <christian@breunig.cc>2024-07-05 08:48:31 +0200
commitfc4263021acb72d2d8afb165922d9cb7e11b2bf1 (patch)
treec0c3ae2a07264f02c5d339323ffe14e4a8f01e90 /src
parent9cddfd9fde5504cd5e42ed75560f21619aca646b (diff)
downloadvyos-1x-fc4263021acb72d2d8afb165922d9cb7e11b2bf1.tar.gz
vyos-1x-fc4263021acb72d2d8afb165922d9cb7e11b2bf1.zip
wireless: T6496: support for EAP-MSCHAPv2 client over wifi
fix: attempt to fix indentation on `wpa_supplicant.conf.j2` fix: attempt to fix indentation on `wpa_supplicant.conf.j2` fix: incorrect bssid mapping fix: use the correct jinja templating (I think) fix: “remote blank space fix: attempt to fix the formatting in j2 fix: attempt to fix the formatting in j2 feat: rename enterprise username and password + add checks in conf mode. fix: move around `bssid` config option on `wpa_supplicant.conf.j2` and fix the security config part fix: fix indentation on `wpa_supplicant.conf.j2`
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/interfaces_wireless.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/conf_mode/interfaces_wireless.py b/src/conf_mode/interfaces_wireless.py
index 73944dc8b..5fd7ab6e9 100755
--- a/src/conf_mode/interfaces_wireless.py
+++ b/src/conf_mode/interfaces_wireless.py
@@ -184,11 +184,18 @@ def verify(wifi):
if not any(i in ['passphrase', 'radius'] for i in wpa):
raise ConfigError('Misssing WPA key or RADIUS server')
+ if 'username' in wpa:
+ if 'passphrase' not in wpa:
+ raise ConfigError('WPA-Enterprise configured - missing passphrase!')
+ elif 'passphrase' in wpa:
+ # check if passphrase meets the regex .{8,63}
+ if len(wpa['passphrase']) < 8 or len(wpa['passphrase']) > 63:
+ raise ConfigError('WPA passphrase must be between 8 and 63 characters long')
if 'radius' in wpa:
if 'server' in wpa['radius']:
for server in wpa['radius']['server']:
if 'key' not in wpa['radius']['server'][server]:
- raise ConfigError(f'Misssing RADIUS shared secret key for server: {server}')
+ raise ConfigError(f'Missing RADIUS shared secret key for server: {server}')
if 'capabilities' in wifi:
capabilities = wifi['capabilities']