mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-22 08:50:09 +00:00
driver/wifi: fix invalid network check
This commit alignes the implementation to the intention of dismissing invalid '<network>' entries. We only accept entries when they contain a valid SSID and additionally a valid PSK if the network is protected. Issue #5356.
This commit is contained in:
committed by
Christian Helmuth
parent
8094b1ee01
commit
fe93df27d1
@ -1518,22 +1518,26 @@ struct Wifi::Manager : Wifi::Rfkill_notification_handler
|
|||||||
|
|
||||||
Accesspoint const ap = Accesspoint::from_xml(node);
|
Accesspoint const ap = Accesspoint::from_xml(node);
|
||||||
|
|
||||||
bool const ssid_invalid = !Accesspoint::valid(ap.ssid);
|
|
||||||
if (ssid_invalid)
|
|
||||||
warning("accesspoint has invalid ssid: '", ap.ssid, "'");
|
|
||||||
|
|
||||||
bool const pass_invalid = ap.wpa() && !Accesspoint::valid(ap.pass);
|
|
||||||
if (pass_invalid)
|
|
||||||
warning("accesspoint '", ap.ssid, "' has invalid psk");
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Only make the supplicant acquainted with the network
|
* Only make the supplicant acquainted with the network
|
||||||
* when it is usable but created the Network object nonetheless
|
* when it is usable, it always needs a valid SSID and
|
||||||
* to satisfy the List_model requirements.
|
* in case it is protected also a valid PSK, but create
|
||||||
|
* the Network object nonetheless to satisfy the List_model
|
||||||
|
* requirements.
|
||||||
*/
|
*/
|
||||||
if (!ssid_invalid || !pass_invalid)
|
|
||||||
_queue_action(*new (_actions_alloc)
|
bool const ssid_valid = Accesspoint::valid(ap.ssid);
|
||||||
Add_network_cmd(_msg, ap), _config.verbose);
|
if (!ssid_valid)
|
||||||
|
warning("accesspoint has invalid ssid: '", ap.ssid, "'");
|
||||||
|
|
||||||
|
bool const pass_valid = ap.wpa() ? Accesspoint::valid(ap.pass)
|
||||||
|
: true;
|
||||||
|
if (!pass_valid)
|
||||||
|
warning("accesspoint '", ap.ssid, "' has invalid psk");
|
||||||
|
|
||||||
|
if (ssid_valid && pass_valid)
|
||||||
|
_queue_action(*new (_actions_alloc)
|
||||||
|
Add_network_cmd(_msg, ap), _config.verbose);
|
||||||
|
|
||||||
return *new (_network_allocator) Network(ap);
|
return *new (_network_allocator) Network(ap);
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user