]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Use correct WPA_ALG_* values to compare for enum wpa_alg
authorPurushottam Kushwaha <pkushwah@codeaurora.org>
Mon, 12 Mar 2018 14:44:48 +0000 (20:14 +0530)
committerJouni Malinen <j@w1.fi>
Mon, 12 Mar 2018 22:32:43 +0000 (00:32 +0200)
enum wpa_alg was being compared with WPA_CIPHER_* values. That does not
work here and strict compilers will report this as an error. Fix the
comparision to use proper WPA_ALG_* values. This fixes testing
capability for resetting IPN for BIP.

Fixes: 16579769ff7b ("Add testing functionality for resetting PN/IPN for configured keys")
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
src/ap/wpa_auth_glue.c

index e2a42016d40f8c99a532b0fcb1f4a073bcdac38b..afc10f9808d3e1e5efac88f7c4826c55dbc6173e 100644 (file)
@@ -365,10 +365,10 @@ static int hostapd_wpa_auth_set_key(void *ctx, int vlan_id, enum wpa_alg alg,
                        sta->last_tk_len = key_len;
                }
 #ifdef CONFIG_IEEE80211W
-       } else if (alg == WPA_CIPHER_AES_128_CMAC ||
-                  alg == WPA_CIPHER_BIP_GMAC_128 ||
-                  alg == WPA_CIPHER_BIP_GMAC_256 ||
-                  alg == WPA_CIPHER_BIP_CMAC_256) {
+       } else if (alg == WPA_ALG_IGTK ||
+                  alg == WPA_ALG_BIP_GMAC_128 ||
+                  alg == WPA_ALG_BIP_GMAC_256 ||
+                  alg == WPA_ALG_BIP_CMAC_256) {
                hapd->last_igtk_alg = alg;
                hapd->last_igtk_key_idx = idx;
                if (key)