chore: tested hostapd wpa2 and wpa3-transition modes

This commit is contained in:
oddlama 2023-03-21 01:29:18 +01:00
parent 32f1474d3f
commit 8545dff4e7
No known key found for this signature in database
GPG key ID: 14EFE510775FE39A

View file

@ -23,6 +23,7 @@
optional optional
optionals optionals
optionalString optionalString
stringLength
toLower toLower
types types
; ;
@ -851,7 +852,7 @@ in {
wifi7 = { wifi7 = {
enable = mkOption { enable = mkOption {
# FIXME: Change this to true once WiFi 7 is stable # FIXME: Change this to true once WiFi 7 is stable and hostapd is built with CONFIG_IEEE80211BE by default
default = false; default = false;
type = types.bool; type = types.bool;
description = mdDoc '' description = mdDoc ''
@ -921,6 +922,10 @@ in {
assertion = countWpaPasswordDefinitions <= 1; assertion = countWpaPasswordDefinitions <= 1;
message = ''hostapd interface ${interface} must use at most one WPA password option (wpaPassword, wpaPasswordFile, wpaPskFile)''; message = ''hostapd interface ${interface} must use at most one WPA password option (wpaPassword, wpaPasswordFile, wpaPskFile)'';
} }
{
assertion = ifcfg.authentication.wpaPassword != null -> (stringLength ifcfg.authentication.wpaPassword >= 8 && stringLength ifcfg.authentication.wpaPassword <= 63);
message = ''hostapd interface ${interface} uses a wpaPassword of invalid length (must be in [8,63]).'';
}
{ {
assertion = ifcfg.authentication.saePasswords == [] || ifcfg.authentication.saePasswordsFile == null; assertion = ifcfg.authentication.saePasswords == [] || ifcfg.authentication.saePasswordsFile == null;
message = ''hostapd interface ${interface} must use only one SAE password option (saePasswords or saePasswordsFile)''; message = ''hostapd interface ${interface} must use only one SAE password option (saePasswords or saePasswordsFile)'';
@ -945,7 +950,7 @@ in {
services.udev.packages = optionals (any (i: i.countryCode != null) (attrValues cfg.interfaces)) [pkgs.crda]; services.udev.packages = optionals (any (i: i.countryCode != null) (attrValues cfg.interfaces)) [pkgs.crda];
systemd.services.hostapd = { systemd.services.hostapd = {
description = "Hostapd IEEE 802.11 AP"; description = "Hostapd IEEE 802.11 AP Daemon";
path = [pkgs.hostapd]; path = [pkgs.hostapd];
after = mapAttrsToList (interface: _: "sys-subsystem-net-devices-${utils.escapeSystemdPath interface}.device") cfg.interfaces; after = mapAttrsToList (interface: _: "sys-subsystem-net-devices-${utils.escapeSystemdPath interface}.device") cfg.interfaces;