diff options
author | Christian Breunig <christian@breunig.cc> | 2024-07-05 09:00:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-05 09:00:13 +0200 |
commit | 262dd9a972260dfab340367cbb40ba064bb2a1aa (patch) | |
tree | b9f834937d27b15617177c7058011de31206c37c /src | |
parent | 0e70cea1daf2abf9c9074bb5da4f3de5c1aca833 (diff) | |
parent | 0c9499c5b3f7cc053c1f29ecf28d679c1a3156e2 (diff) | |
download | vyos-1x-262dd9a972260dfab340367cbb40ba064bb2a1aa.tar.gz vyos-1x-262dd9a972260dfab340367cbb40ba064bb2a1aa.zip |
Merge pull request #3711 from part1cleth1ef/current
T6496: Added support for WPA-Enterprise client-mode
Diffstat (limited to 'src')
-rwxr-xr-x | src/conf_mode/interfaces_wireless.py | 9 |
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'] |