mirror of
https://github.com/openwrt/openwrt.git
synced 2026-07-17 16:41:56 +04:00
wifi-scripts: fix EAP STA support in supplicant config generation
The supplicant config generator read eap_type and auth from UCI for internal logic but never wrote the corresponding eap= and phase2= directives to the wpa_supplicant config. Fix by: - Generating eap= and phase2= from eap_type/auth for PEAP/TTLS/FAST/TLS - Adding eap and phase2 to the network_append_vars output list Signed-off-by: John Crispin <john@phrozen.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
committed by
Felix Fietkau
parent
87f5376eb7
commit
c92ded2f6e
@@ -155,11 +155,16 @@ function setup_sta(data, config) {
|
||||
if (config.ca_cert_usesystem && fs.stat('/etc/ssl/certs/ca-certificates.crt'))
|
||||
config.ca_cert = '/etc/ssl/certs/ca-certificates.crt';
|
||||
|
||||
const eap_method_map = { fast: 'FAST', peap: 'PEAP', ttls: 'TTLS', tls: 'TLS' };
|
||||
if (eap_method_map[config.eap_type])
|
||||
config.eap = eap_method_map[config.eap_type];
|
||||
|
||||
switch(config.eap_type) {
|
||||
case 'fast':
|
||||
case 'peap':
|
||||
case 'ttls':
|
||||
set_default(config, 'auth', 'MSCHAPV2');
|
||||
config.phase2 = `"auth=${config.auth}"`;
|
||||
if (config.auth == 'EAP-TLS') {
|
||||
if (config.ca_cert2_usesystem && fs.stat('/etc/ssl/certs/ca-certificates.crt'))
|
||||
config.ca_cert2 = '/etc/ssl/certs/ca-certificates.crt';
|
||||
@@ -205,7 +210,7 @@ function setup_sta(data, config) {
|
||||
'disable_ht', 'disable_ht40', 'disable_vht', 'vht', 'max_oper_chwidth',
|
||||
'ht40', 'beacon_int', 'ieee80211w', 'rates', 'mesh_basic_rates', 'mcast_rate',
|
||||
'altsubject_match', 'domain_match', 'domain_suffix_match',
|
||||
'bssid_blacklist', 'bssid_whitelist', 'erp',
|
||||
'bssid_blacklist', 'bssid_whitelist', 'erp', 'eap', 'phase2',
|
||||
'dpp_connector', 'dpp_csign', 'dpp_netaccesskey',
|
||||
]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user