1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-15 03:51:51 +00:00

Update wireless from upstream

This commit is contained in:
Ycarus (Yannick Chabanois) 2020-11-27 18:13:04 +01:00 committed by suyuan
parent de06c50310
commit 5d52e7b297
2 changed files with 16 additions and 6 deletions

View file

@ -4,7 +4,7 @@
#
# This is free software, licensed under the Apache License, Version 2.0 .
#
# From https://github.com/openwrt/luci/commit/5ca328440b3a41ab6d415ec96f9db4339715de67
# From https://github.com/openwrt/luci/commit/83c912716e482000e92443cffc3202726314f480
include $(TOPDIR)/rules.mk

View file

@ -1634,7 +1634,7 @@ return view.extend({
o = ss.taboption('encryption', form.Flag, 'wpa_disable_eapol_key_retries', _('Enable key reinstallation (KRACK) countermeasures'), _('Complicates key reinstallation attacks on the client side by disabling retransmission of EAPOL-Key frames that are used to install keys. This workaround might cause interoperability issues and reduced robustness of key negotiation especially in environments with heavy traffic load.'));
add_dependency_permutations(o, { mode: ['ap', 'ap-wds'], encryption: ['psk2', 'psk-mixed', 'sae', 'sae-mixed', 'wpa2', 'wpa3', 'wpa3-mixed'] });
if (L.hasSystemFeature('hostapd', 'cli') && L.hasSystemFeature('wpasupplicant')) {
if (L.hasSystemFeature('hostapd', 'wps') && L.hasSystemFeature('wpasupplicant')) {
o = ss.taboption('encryption', form.Flag, 'wps_pushbutton', _('Enable WPS pushbutton, requires WPA(2)-PSK/WPA3-SAE'))
o.enabled = '1';
o.disabled = '0';
@ -1742,7 +1742,7 @@ return view.extend({
E('span', { 'style': s }, '%h'.format(network.formatWifiEncryption(res.encryption))),
E('div', { 'class': 'right' }, E('button', {
'class': 'cbi-button cbi-button-action important',
'click': L.bind(this.handleJoin, this, radioDev, res)
'click': ui.createHandlerFn(this, 'handleJoin', radioDev, res)
}, _('Join Network')))
]);
@ -1790,17 +1790,19 @@ return view.extend({
s.handleJoinConfirm = function(radioDev, bss, form, ev) {
var nameopt = L.toArray(form.lookupOption('name', '_new_'))[0],
passopt = L.toArray(form.lookupOption('password', '_new_'))[0],
ssidopt = L.toArray(form.lookupOption('ssid', '_new_'))[0],
bssidopt = L.toArray(form.lookupOption('bssid', '_new_'))[0],
zoneopt = L.toArray(form.lookupOption('zone', '_new_'))[0],
replopt = L.toArray(form.lookupOption('replace', '_new_'))[0],
nameval = (nameopt && nameopt.isValid('_new_')) ? nameopt.formvalue('_new_') : null,
passval = (passopt && passopt.isValid('_new_')) ? passopt.formvalue('_new_') : null,
ssidval = (ssidopt && ssidopt.isValid('_new_')) ? ssidopt.formvalue('_new_') : null,
bssidval = (bssidopt && bssidopt.isValid('_new_')) ? bssidopt.formvalue('_new_') : null,
zoneval = zoneopt ? zoneopt.formvalue('_new_') : null,
enc = L.isObject(bss.encryption) ? bss.encryption : null,
is_wep = (enc && Array.isArray(enc.wep)),
is_psk = (enc && Array.isArray(enc.wpa) && L.toArray(enc.authentication).filter(function(a) { return a == 'psk' })),
is_sae = (enc && Array.isArray(enc.wpa) && L.toArray(enc.authentication).filter(function(a) { return a == 'sae' }));
is_psk = (enc && Array.isArray(enc.wpa) && L.toArray(enc.authentication).filter(function(a) { return a == 'psk' }).length > 0),
is_sae = (enc && Array.isArray(enc.wpa) && L.toArray(enc.authentication).filter(function(a) { return a == 'sae' }).length > 0);
if (nameval == null || (passopt && passval == null))
return;
@ -1841,6 +1843,9 @@ return view.extend({
uci.set('wireless', section_id, 'bssid', bss.bssid);
}
if (ssidval != null)
uci.set('wireless', section_id, 'ssid', ssidval);
if (is_sae) {
uci.set('wireless', section_id, 'encryption', 'sae');
uci.set('wireless', section_id, 'key', passval);
@ -1886,7 +1891,7 @@ return view.extend({
};
s.handleJoin = function(radioDev, bss, ev) {
this.handleScanAbort(ev);
poll.remove(this.pollFn);
var m2 = new form.Map('wireless'),
s2 = m2.section(form.NamedSection, '_new_'),
@ -1911,6 +1916,11 @@ return view.extend({
]).then(this.renderContents.bind(this));
};
if (bss.ssid == null) {
name = s2.option(form.Value, 'ssid', _('Network SSID'), _('The correct SSID must be manually specified when joining a hidden wireless network'));
name.rmempty = false;
};
replace = s2.option(form.Flag, 'replace', _('Replace wireless configuration'), _('Check this option to delete the existing networks from this radio.'));
name = s2.option(form.Value, 'name', _('Name of the new network'), _('The allowed characters are: <code>A-Z</code>, <code>a-z</code>, <code>0-9</code> and <code>_</code>'));