mirror of https://github.com/hak5/openwrt.git
hostapd: allow multiple key management algorithms
To enable 802.11r, wpa_key_mgmt should contain FT-EAP or FT-PSK. Allow multiple key management algorithms to make this possible. Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be> SVN-Revision: 45050lede-17.01
parent
4482d10a04
commit
07b17c6b25
|
@ -1,7 +1,7 @@
|
||||||
hostapd_set_bss_options() {
|
hostapd_set_bss_options() {
|
||||||
local var="$1"
|
local var="$1"
|
||||||
local vif="$2"
|
local vif="$2"
|
||||||
local enc wep_rekey wpa_group_rekey wpa_pair_rekey wpa_master_rekey wps_possible
|
local enc wep_rekey wpa_group_rekey wpa_pair_rekey wpa_master_rekey wps_possible wpa_key_mgmt
|
||||||
|
|
||||||
config_get enc "$vif" encryption "none"
|
config_get enc "$vif" encryption "none"
|
||||||
config_get wep_rekey "$vif" wep_rekey # 300
|
config_get wep_rekey "$vif" wep_rekey # 300
|
||||||
|
@ -92,6 +92,7 @@ hostapd_set_bss_options() {
|
||||||
[ -n "$wpa_group_rekey" ] && append "$var" "wpa_group_rekey=$wpa_group_rekey" "$N"
|
[ -n "$wpa_group_rekey" ] && append "$var" "wpa_group_rekey=$wpa_group_rekey" "$N"
|
||||||
[ -n "$wpa_pair_rekey" ] && append "$var" "wpa_ptk_rekey=$wpa_pair_rekey" "$N"
|
[ -n "$wpa_pair_rekey" ] && append "$var" "wpa_ptk_rekey=$wpa_pair_rekey" "$N"
|
||||||
[ -n "$wpa_master_rekey" ] && append "$var" "wpa_gmk_rekey=$wpa_master_rekey" "$N"
|
[ -n "$wpa_master_rekey" ] && append "$var" "wpa_gmk_rekey=$wpa_master_rekey" "$N"
|
||||||
|
append wpa_key_mgmt "WPA-PSK"
|
||||||
;;
|
;;
|
||||||
*wpa*|*8021x*)
|
*wpa*|*8021x*)
|
||||||
# required fields? formats?
|
# required fields? formats?
|
||||||
|
@ -133,7 +134,7 @@ hostapd_set_bss_options() {
|
||||||
append "$var" "own_ip_addr=$ownip" "$N"
|
append "$var" "own_ip_addr=$ownip" "$N"
|
||||||
append "$var" "eapol_key_index_workaround=1" "$N"
|
append "$var" "eapol_key_index_workaround=1" "$N"
|
||||||
append "$var" "ieee8021x=1" "$N"
|
append "$var" "ieee8021x=1" "$N"
|
||||||
append "$var" "wpa_key_mgmt=WPA-EAP" "$N"
|
append wpa_key_mgmt "WPA-EAP"
|
||||||
[ -n "$wpa_group_rekey" ] && append "$var" "wpa_group_rekey=$wpa_group_rekey" "$N"
|
[ -n "$wpa_group_rekey" ] && append "$var" "wpa_group_rekey=$wpa_group_rekey" "$N"
|
||||||
[ -n "$wpa_pair_rekey" ] && append "$var" "wpa_ptk_rekey=$wpa_pair_rekey" "$N"
|
[ -n "$wpa_pair_rekey" ] && append "$var" "wpa_ptk_rekey=$wpa_pair_rekey" "$N"
|
||||||
[ -n "$wpa_master_rekey" ] && append "$var" "wpa_gmk_rekey=$wpa_master_rekey" "$N"
|
[ -n "$wpa_master_rekey" ] && append "$var" "wpa_gmk_rekey=$wpa_master_rekey" "$N"
|
||||||
|
@ -218,6 +219,7 @@ hostapd_set_bss_options() {
|
||||||
then
|
then
|
||||||
config_get nasid "$vif" nasid
|
config_get nasid "$vif" nasid
|
||||||
[ -n "$nasid" ] && append "$var" "nas_identifier=$nasid" "$N"
|
[ -n "$nasid" ] && append "$var" "nas_identifier=$nasid" "$N"
|
||||||
|
[ -n "wpa_key_mgmt" ] && append "$var" "wpa_key_mgmt=$wpa_key_mgmt"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$wpa" -ge "2" ]
|
if [ "$wpa" -ge "2" ]
|
||||||
|
|
|
@ -169,7 +169,7 @@ hostapd_set_bss_options() {
|
||||||
wireless_vif_parse_encryption
|
wireless_vif_parse_encryption
|
||||||
|
|
||||||
local bss_conf
|
local bss_conf
|
||||||
local wep_rekey wpa_group_rekey wpa_pair_rekey wpa_master_rekey
|
local wep_rekey wpa_group_rekey wpa_pair_rekey wpa_master_rekey wpa_key_mgmt
|
||||||
|
|
||||||
json_get_vars \
|
json_get_vars \
|
||||||
wep_rekey wpa_group_rekey wpa_pair_rekey wpa_master_rekey \
|
wep_rekey wpa_group_rekey wpa_pair_rekey wpa_master_rekey \
|
||||||
|
@ -233,6 +233,7 @@ hostapd_set_bss_options() {
|
||||||
append bss_conf "wpa_psk_file=$wpa_psk_file" "$N"
|
append bss_conf "wpa_psk_file=$wpa_psk_file" "$N"
|
||||||
}
|
}
|
||||||
wps_possible=1
|
wps_possible=1
|
||||||
|
append wpa_key_mgmt "WPA-PSK"
|
||||||
;;
|
;;
|
||||||
eap)
|
eap)
|
||||||
json_get_vars \
|
json_get_vars \
|
||||||
|
@ -276,7 +277,7 @@ hostapd_set_bss_options() {
|
||||||
[ -n "$ownip" ] && append bss_conf "own_ip_addr=$ownip" "$N"
|
[ -n "$ownip" ] && append bss_conf "own_ip_addr=$ownip" "$N"
|
||||||
append bss_conf "eapol_key_index_workaround=1" "$N"
|
append bss_conf "eapol_key_index_workaround=1" "$N"
|
||||||
append bss_conf "ieee8021x=1" "$N"
|
append bss_conf "ieee8021x=1" "$N"
|
||||||
append bss_conf "wpa_key_mgmt=WPA-EAP" "$N"
|
append wpa_key_mgmt "WPA-EAP"
|
||||||
|
|
||||||
[ -n "$dynamic_vlan" ] && {
|
[ -n "$dynamic_vlan" ] && {
|
||||||
append bss_conf "dynamic_vlan=$dynamic_vlan" "$N"
|
append bss_conf "dynamic_vlan=$dynamic_vlan" "$N"
|
||||||
|
@ -341,6 +342,7 @@ hostapd_set_bss_options() {
|
||||||
if [ "$wpa" -ge "1" ]; then
|
if [ "$wpa" -ge "1" ]; then
|
||||||
json_get_vars nasid
|
json_get_vars nasid
|
||||||
[ -n "$nasid" ] && append bss_conf "nas_identifier=$nasid" "$N"
|
[ -n "$nasid" ] && append bss_conf "nas_identifier=$nasid" "$N"
|
||||||
|
[ -n "$wpa_key_mgmt" ] && append bss_conf "wpa_key_mgmt=$wpa_key_mgmt" "$N"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$wpa" -ge "2" ]; then
|
if [ "$wpa" -ge "2" ]; then
|
||||||
|
|
Loading…
Reference in New Issue