diff options
author | Daniil Baturin <daniil@vyos.io> | 2024-09-19 16:29:49 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-19 16:29:49 +0100 |
commit | 1909f2df8017b084dd28e8e05cc266076b2a9980 (patch) | |
tree | 4cc2a37f8a4d390ff5b8095cf289169a9182e599 /src | |
parent | 0444795e3798f2ec51e40bef67a0920f892769b8 (diff) | |
parent | b76a5c94cfeb1a7bad8ac5c818ed3065a4d32210 (diff) | |
download | vyos-1x-1909f2df8017b084dd28e8e05cc266076b2a9980.tar.gz vyos-1x-1909f2df8017b084dd28e8e05cc266076b2a9980.zip |
Merge pull request #4085 from vyos/mergify/bp/circinus/pr-3711
T6496: Added support for WPA-Enterprise client-mode (backport #3711)
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 aa65adc10..d24675ee6 100755 --- a/src/conf_mode/interfaces_wireless.py +++ b/src/conf_mode/interfaces_wireless.py @@ -193,11 +193,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'] |