hostapd: only advertise a single encryption type via WPS if multiple are supported...
[openwrt/svn-archive/archive.git] / package / hostapd / patches / 750-wps_single_auth_enc_type.patch
1 --- a/src/ap/wps_hostapd.c
2 +++ b/src/ap/wps_hostapd.c
3 @@ -773,11 +773,9 @@ int hostapd_init_wps(struct hostapd_data
4
5 if (conf->rsn_pairwise & WPA_CIPHER_CCMP)
6 wps->encr_types |= WPS_ENCR_AES;
7 - if (conf->rsn_pairwise & WPA_CIPHER_TKIP)
8 + else if (conf->rsn_pairwise & WPA_CIPHER_TKIP)
9 wps->encr_types |= WPS_ENCR_TKIP;
10 - }
11 -
12 - if (conf->wpa & WPA_PROTO_WPA) {
13 + } else if (conf->wpa & WPA_PROTO_WPA) {
14 if (conf->wpa_key_mgmt & WPA_KEY_MGMT_PSK)
15 wps->auth_types |= WPS_AUTH_WPAPSK;
16 if (conf->wpa_key_mgmt & WPA_KEY_MGMT_IEEE8021X)
17 @@ -785,7 +783,7 @@ int hostapd_init_wps(struct hostapd_data
18
19 if (conf->wpa_pairwise & WPA_CIPHER_CCMP)
20 wps->encr_types |= WPS_ENCR_AES;
21 - if (conf->wpa_pairwise & WPA_CIPHER_TKIP)
22 + else if (conf->wpa_pairwise & WPA_CIPHER_TKIP)
23 wps->encr_types |= WPS_ENCR_TKIP;
24 }
25