aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/sme.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2011-11-24 22:46:14 +0200
committerJouni Malinen <j@w1.fi>2011-11-24 22:47:46 +0200
commit0bf927a03ed080fe50400382e0c9538762f9b903 (patch)
tree9c275c98f5680aa4dbea80d441ee27161962dfff /wpa_supplicant/sme.c
parent8e8280bd5e6d2a7144b468a47f8c5b8bd4791400 (diff)
downloadexternal_wpa_supplicant_8_ti-0bf927a03ed080fe50400382e0c9538762f9b903.zip
external_wpa_supplicant_8_ti-0bf927a03ed080fe50400382e0c9538762f9b903.tar.gz
external_wpa_supplicant_8_ti-0bf927a03ed080fe50400382e0c9538762f9b903.tar.bz2
Use wpa_key_mgmt_*() helpers
This cleans up the source code and makes it less likely that new AKM addition misses some needed changes in the future. Signed-hostap: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wpa_supplicant/sme.c')
-rw-r--r--wpa_supplicant/sme.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/wpa_supplicant/sme.c b/wpa_supplicant/sme.c
index 3416d68..b63f4bb 100644
--- a/wpa_supplicant/sme.c
+++ b/wpa_supplicant/sme.c
@@ -115,11 +115,7 @@ void sme_authenticate(struct wpa_supplicant *wpa_s,
if ((wpa_bss_get_vendor_ie(bss, WPA_IE_VENDOR_TYPE) ||
wpa_bss_get_ie(bss, WLAN_EID_RSN)) &&
- (ssid->key_mgmt & (WPA_KEY_MGMT_IEEE8021X | WPA_KEY_MGMT_PSK |
- WPA_KEY_MGMT_FT_IEEE8021X |
- WPA_KEY_MGMT_FT_PSK |
- WPA_KEY_MGMT_IEEE8021X_SHA256 |
- WPA_KEY_MGMT_PSK_SHA256))) {
+ wpa_key_mgmt_wpa(ssid->key_mgmt)) {
int try_opportunistic;
try_opportunistic = ssid->proactive_key_caching &&
(ssid->proto & WPA_PROTO_RSN);
@@ -135,11 +131,7 @@ void sme_authenticate(struct wpa_supplicant *wpa_s,
"key management and encryption suites");
return;
}
- } else if (ssid->key_mgmt &
- (WPA_KEY_MGMT_PSK | WPA_KEY_MGMT_IEEE8021X |
- WPA_KEY_MGMT_WPA_NONE | WPA_KEY_MGMT_FT_PSK |
- WPA_KEY_MGMT_FT_IEEE8021X | WPA_KEY_MGMT_PSK_SHA256 |
- WPA_KEY_MGMT_IEEE8021X_SHA256)) {
+ } else if (wpa_key_mgmt_wpa_any(ssid->key_mgmt)) {
wpa_s->sme.assoc_req_ie_len = sizeof(wpa_s->sme.assoc_req_ie);
if (wpa_supplicant_set_suites(wpa_s, NULL, ssid,
wpa_s->sme.assoc_req_ie,
@@ -178,8 +170,7 @@ void sme_authenticate(struct wpa_supplicant *wpa_s,
wpa_ft_prepare_auth_request(wpa_s->wpa, ie);
}
- if (md && ssid->key_mgmt & (WPA_KEY_MGMT_FT_PSK |
- WPA_KEY_MGMT_FT_IEEE8021X)) {
+ if (md && wpa_key_mgmt_ft(ssid->key_mgmt)) {
if (wpa_s->sme.assoc_req_ie_len + 5 <
sizeof(wpa_s->sme.assoc_req_ie)) {
struct rsn_mdie *mdie;