config.start_disabled = data.ap_start_disabled;
iface_setup(config);
- iface.parse_encryption(config, data.config);
+ iface.parse_encryption(config, data.config, phy_features);
if (data.config.band == '6g') {
if (config.auth_type == 'psk-sae')
config.auth_type = 'sae';
const NL80211_EXT_FEATURE_ENABLE_FTM_RESPONDER = 33;
const NL80211_EXT_FEATURE_RADAR_BACKGROUND = 61;
+const WLAN_CIPHER_SUITE_GCMP_256 = 0x000fac09;
+
let phy_features = {};
let phy_capabilities = {};
phy_features.ftm_responder = device_extended_features(phy.extended_features, NL80211_EXT_FEATURE_ENABLE_FTM_RESPONDER);
phy_features.radar_background = device_extended_features(phy.extended_features, NL80211_EXT_FEATURE_RADAR_BACKGROUND);
+ phy_features.cipher_gcmp256 = WLAN_CIPHER_SUITE_GCMP_256 in (phy.cipher_suites ?? []);
}
function generate(config) {
import { append_value, log } from 'wifi.common';
import * as fs from 'fs';
-export function parse_encryption(config, dev_config) {
+export function parse_encryption(config, dev_config, phy_features) {
if (!config.encryption)
return;
config.wpa_pairwise = 'CCMP';
if (dev_config.band != '6g')
config.rsn_override_pairwise = 'CCMP';
- if (wildcard(dev_config.htmode ?? '', 'EHT*'))
+ if (phy_features?.cipher_gcmp256 && wildcard(dev_config.htmode ?? '', 'EHT*'))
config.rsn_override_pairwise_2 = 'GCMP-256';
break;
config.wpa_pairwise ??= null;
else if (config.hw_mode == 'ad')
config.wpa_pairwise ??= 'GCMP';
- else if (wildcard(dev_config?.htmode, 'EHT*') || wildcard(dev_config?.htmode, 'HE*'))
+ else if (phy_features?.cipher_gcmp256)
config.wpa_pairwise ??= 'GCMP-256 CCMP';
else
config.wpa_pairwise ??= 'CCMP';