aboutsummaryrefslogtreecommitdiffstats
path: root/hostapd
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2011-09-15 12:02:59 (GMT)
committerJouni Malinen <j@w1.fi>2011-09-15 12:02:59 (GMT)
commit697cd03fc28bdcd24434347930854f2f3d5789b4 (patch)
tree3f2b7162e9bbeac3e2e1221b3106a2f8472debb2 /hostapd
parent633d4469e8e0fa54f671fca831cdd66e62605329 (diff)
downloadhostap-697cd03fc28bdcd24434347930854f2f3d5789b4.zip
hostap-697cd03fc28bdcd24434347930854f2f3d5789b4.tar.gz
hostap-697cd03fc28bdcd24434347930854f2f3d5789b4.tar.bz2
AP: Set pairwise/group cipher for non-WPA modes
This is needed to avoid confusing configuration in some nl80211 drivers that the new AP mode configuration alternatives for setting security policy.
Diffstat (limited to 'hostapd')
-rw-r--r--hostapd/config_file.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/hostapd/config_file.c b/hostapd/config_file.c
index bfd4809..6ffa981 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
@@ -2099,12 +2099,29 @@ struct hostapd_config * hostapd_config_read(const char *fname)
} else if (bss->wpa) {
bss->ssid.security_policy = SECURITY_WPA_PSK;
} else if (bss->ieee802_1x) {
+ int cipher = WPA_CIPHER_NONE;
bss->ssid.security_policy = SECURITY_IEEE_802_1X;
bss->ssid.wep.default_len = bss->default_wep_key_len;
- } else if (bss->ssid.wep.keys_set)
+ if (bss->default_wep_key_len)
+ cipher = bss->default_wep_key_len >= 13 ?
+ WPA_CIPHER_WEP104 : WPA_CIPHER_WEP40;
+ bss->wpa_group = cipher;
+ bss->wpa_pairwise = cipher;
+ bss->rsn_pairwise = cipher;
+ } else if (bss->ssid.wep.keys_set) {
+ int cipher = WPA_CIPHER_WEP40;
+ if (bss->ssid.wep.len[0] >= 13)
+ cipher = WPA_CIPHER_WEP104;
bss->ssid.security_policy = SECURITY_STATIC_WEP;
- else
+ bss->wpa_group = cipher;
+ bss->wpa_pairwise = cipher;
+ bss->rsn_pairwise = cipher;
+ } else {
bss->ssid.security_policy = SECURITY_PLAINTEXT;
+ bss->wpa_group = WPA_CIPHER_NONE;
+ bss->wpa_pairwise = WPA_CIPHER_NONE;
+ bss->rsn_pairwise = WPA_CIPHER_NONE;
+ }
}
if (hostapd_config_check(conf))