static int ibss_rsn_process_rx_eapol(struct ibss_rsn *ibss_rsn, struct ibss_rsn_peer *peer, const u8 *buf, size_t len) { int supp; u8 *tmp; supp = ibss_rsn_eapol_dst_supp(buf, len); if (supp < 0) return -1; tmp = os_malloc(len); if (tmp == NULL) return -1; os_memcpy(tmp, buf, len); if (supp) { wpa_printf(MSG_DEBUG, "RSN: IBSS RX EAPOL for Supplicant"); wpa_sm_rx_eapol(peer->supp, peer->addr, tmp, len); } else { wpa_printf(MSG_DEBUG, "RSN: IBSS RX EAPOL for Authenticator"); wpa_receive(ibss_rsn->auth_group, peer->auth, tmp, len); } os_free(tmp); return 1; }
static void supp_eapol_rx(void *eloop_data, void *user_ctx) { struct wpa *wpa = eloop_data; wpa_printf(MSG_DEBUG, "SUPP: RX EAPOL frame"); wpa_sm_rx_eapol(wpa->supp, wpa->auth_addr, wpa->auth_eapol, wpa->auth_eapol_len); }
static int ibss_rsn_process_rx_eapol(struct ibss_rsn *ibss_rsn, struct ibss_rsn_peer *peer, const u8 *buf, size_t len) { int supp; u8 *tmp; supp = ibss_rsn_eapol_dst_supp(buf, len); if (supp < 0) return -1; tmp = os_malloc(len); if (tmp == NULL) return -1; os_memcpy(tmp, buf, len); if (supp) { peer->authentication_status |= IBSS_RSN_AUTH_EAPOL_BY_PEER; wpa_printf(MSG_DEBUG, "RSN: IBSS RX EAPOL for Supplicant from " MACSTR, MAC2STR(peer->addr)); wpa_sm_rx_eapol(peer->supp, peer->addr, tmp, len); } else { if (ibss_rsn_is_auth_started(peer) == 0) { wpa_printf(MSG_DEBUG, "RSN: IBSS EAPOL for " "Authenticator dropped as " MACSTR " is not " "authenticated", MAC2STR(peer->addr)); os_free(tmp); return -1; } wpa_printf(MSG_DEBUG, "RSN: IBSS RX EAPOL for Authenticator " "from "MACSTR, MAC2STR(peer->addr)); wpa_receive(ibss_rsn->auth_group, peer->auth, tmp, len); } os_free(tmp); return 1; }