#include "common.h"
#include "l2_packet/l2_packet.h"
-#include "wpa_supplicant_i.h"
#include "rsn_supp/wpa.h"
#include "rsn_supp/wpa_ie.h"
+#include "ap/wpa_auth.h"
+#include "wpa_supplicant_i.h"
#include "driver_i.h"
-#include "../hostapd/wpa.h"
#include "ibss_rsn.h"
}
-static void supp_set_state(void *ctx, wpa_states state)
+static void supp_set_state(void *ctx, enum wpa_states state)
{
struct ibss_rsn_peer *peer = ctx;
peer->supp_state = state;
}
-static int supp_set_key(void *ctx, wpa_alg alg,
+static int supp_set_key(void *ctx, enum wpa_alg alg,
const u8 *addr, int key_idx, int set_tx,
const u8 *seq, size_t seq_len,
const u8 *key, size_t key_len)
}
-static int auth_set_key(void *ctx, int vlan_id, wpa_alg alg, const u8 *addr,
- int idx, u8 *key, size_t key_len)
+static int auth_set_key(void *ctx, int vlan_id, enum wpa_alg alg,
+ const u8 *addr, int idx, u8 *key, size_t key_len)
{
struct ibss_rsn *ibss_rsn = ctx;
u8 seq[6];
* In IBSS RSN, the pairwise key from the 4-way handshake
* initiated by the peer with highest MAC address is used.
*/
- if (os_memcmp(ibss_rsn->wpa_s->own_addr, addr, ETH_ALEN) < 0) {
+ if (addr == NULL ||
+ os_memcmp(ibss_rsn->wpa_s->own_addr, addr, ETH_ALEN) < 0) {
wpa_printf(MSG_DEBUG, "AUTH: Do not use this PTK");
return 0;
}
return -1;
}
- wpa_auth_sm_event(peer->auth, WPA_ASSOC);
+ if (wpa_auth_sm_event(peer->auth, WPA_ASSOC))
+ return -1;
- wpa_auth_sta_associated(ibss_rsn->auth_group, peer->auth);
+ if (wpa_auth_sta_associated(ibss_rsn->auth_group, peer->auth))
+ return -1;
return 0;
}