Skip to content

Commit

Permalink
wifi-scripts: fix roaming setup with ucode scripts
Browse files Browse the repository at this point in the history
- fix variable references for ft key
- add r0kh and r1kh if ft_generate_local is not set (logic inversion bug)

Signed-off-by: Felix Fietkau <[email protected]>
  • Loading branch information
nbd168 committed Dec 5, 2024
1 parent b4cc574 commit 1aa2695
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -334,15 +334,15 @@ function iface_roaming(config) {
set_default(config, 'ft_psk_generate_local', config.auth_type == 'psk');
set_default(config, 'ft_iface', config.network_ifname);

if (config.ft_psk_generate_local) {
if (!config.ft_psk_generate_local) {
if (!config.r0kh || !config.r1kh) {
if (!config.auth_secret && !config.key)
netifd.setup_failed('FT_KEY_CANT_BE_DERIVED');

let ft_key = md5(`${mobility_domain}/${auth_secret ?? key}`);
let ft_key = md5(`${config.mobility_domain}/${config.auth_secret ?? config.key}`);

set_default(config, 'r0kh', 'ff:ff:ff:ff:ff:ff,*,' + ft_key);
set_default(config, 'r1kh', '00:00:00:00:00:00,00:00:00:00:00:00,' + ft_key);
set_default(config, 'r0kh', 'ff:ff:ff:ff:ff:ff * ' + ft_key);
set_default(config, 'r1kh', '00:00:00:00:00:00 00:00:00:00:00:00 ' + ft_key);
}

append_vars(config, [
Expand Down

0 comments on commit 1aa2695

Please sign in to comment.