input stringlengths 16 454k | output stringlengths 13 350k | function_name stringlengths 1 100 | repo_name stringlengths 6 43 | category stringclasses 76
values | sample_id stringlengths 22 88 | decompiler stringclasses 1
value | opt_level stringclasses 1
value |
|---|---|---|---|---|---|---|---|
void wpa_ft_rrb_seq_accept(wpa_authenticator *wpa_auth, ft_remote_seq *rkh_seq,
const u8 *src_addr, const u8 *auth, size_t auth_len,
const char *msgtype) {
u32 minidx;
unsigned int i;
u32 msg_seq;
u32 rkh_off;
const u8 *f_seq;
size_t f_seq_len;
const f... | static void wpa_ft_rrb_seq_accept(struct wpa_authenticator *wpa_auth,
struct ft_remote_seq *rkh_seq,
const u8 *src_addr, const u8 *auth,
size_t auth_len, const char *msgtype) {
const u8 *f_seq;
size_t f_seq_len;
... | wpa_ft_rrb_seq_accept | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int wpa_ft_rrb_seq_chk(ft_remote_seq *rkh_seq, const u8 *src_addr,
const u8 *enc, size_t enc_len, const u8 *auth,
size_t auth_len, const char *msgtype, int no_defer) {
unsigned int i;
le32 msg_seq;
u32 msg_off;
const u8 *f_seq;
size_t f_seq_len;
const ft_rrb_seq... | static int wpa_ft_rrb_seq_chk(struct ft_remote_seq *rkh_seq, const u8 *src_addr,
const u8 *enc, size_t enc_len, const u8 *auth,
size_t auth_len, const char *msgtype,
int no_defer) {
const u8 *f_seq;
size_t f_seq_len;
const s... | wpa_ft_rrb_seq_chk | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void wpa_ft_rrb_seq_flush(wpa_authenticator *wpa_auth, ft_remote_seq *rkh_seq,
int cb) {
ft_remote_item *item;
ft_remote_item *n;
item = (ft_remote_item *)rkh_seq->rx.queue.next;
n = (ft_remote_item *)item->list.next;
while (item != (ft_remote_item *)&rkh_seq->rx.queue) {
if (cb... | static void wpa_ft_rrb_seq_flush(struct wpa_authenticator *wpa_auth,
struct ft_remote_seq *rkh_seq, int cb) {
struct ft_remote_item *item, *n;
dl_list_for_each_safe(item, n, &rkh_seq->rx.queue, struct ft_remote_item,
list) {
if (cb && item->cb)
ite... | wpa_ft_rrb_seq_flush | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void wpa_ft_rrb_seq_free(ft_remote_item *item) {
eloop_cancel_timeout((eloop_timeout_handler)wpa_ft_rrb_seq_timeout,
(void *)0xFFFFFFFFFFFFFFFFLL, item);
dl_list_del_8(&item->list);
bin_clear_free(item->enc, item->enc_len);
free(item->auth);
free(item);
} | static void wpa_ft_rrb_seq_free(struct ft_remote_item *item) {
eloop_cancel_timeout(wpa_ft_rrb_seq_timeout, ELOOP_ALL_CTX, item);
dl_list_del(&item->list);
bin_clear_free(item->enc, item->enc_len);
os_free(item->auth);
os_free(item);
} | wpa_ft_rrb_seq_free | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int wpa_ft_rrb_seq_req(wpa_authenticator *wpa_auth, ft_remote_seq *rkh_seq,
const u8 *src_addr, const u8 *f_r0kh_id,
size_t f_r0kh_id_len, const u8 *f_r1kh_id, const u8 *key,
size_t key_len, const u8 *enc, size_t enc_len,
const ... | static int wpa_ft_rrb_seq_req(struct wpa_authenticator *wpa_auth,
struct ft_remote_seq *rkh_seq, const u8 *src_addr,
const u8 *f_r0kh_id, size_t f_r0kh_id_len,
const u8 *f_r1kh_id, const u8 *key,
size... | wpa_ft_rrb_seq_req | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void wpa_ft_rrb_seq_timeout(void *eloop_ctx, void *timeout_ctx) {
wpa_ft_rrb_seq_free((ft_remote_item *)timeout_ctx);
} | static void wpa_ft_rrb_seq_timeout(void *eloop_ctx, void *timeout_ctx) {
struct ft_remote_item *item = timeout_ctx;
wpa_ft_rrb_seq_free(item);
} | wpa_ft_rrb_seq_timeout | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int wpa_ft_send_rrb_auth_resp(wpa_state_machine *sm, const u8 *current_ap,
const u8 *sta_addr, u16 status,
const u8 *resp_ies, size_t resp_ies_len) {
const char *v6;
wpa_authenticator *wpa_auth;
ft_rrb_frame *frame;
wpa_auth = sm->wpa_auth;
v6 = sta... | static int wpa_ft_send_rrb_auth_resp(struct wpa_state_machine *sm,
const u8 *current_ap, const u8 *sta_addr,
u16 status, const u8 *resp_ies,
size_t resp_ies_len) {
struct wpa_authenticator *wpa_auth = sm->wp... | wpa_ft_send_rrb_auth_resp | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int wpa_ft_set_identity(wpa_authenticator *wpa_auth, const u8 *sta_addr,
const u8 *identity, size_t identity_len) {
if (wpa_auth->cb->set_identity)
return wpa_auth->cb->set_identity(wpa_auth->cb_ctx, sta_addr, identity,
identity_len);
else
return... | static int wpa_ft_set_identity(struct wpa_authenticator *wpa_auth,
const u8 *sta_addr, const u8 *identity,
size_t identity_len) {
if (!wpa_auth->cb->set_identity)
return -1;
return wpa_auth->cb->set_identity(wpa_auth->cb_ctx, sta_addr, identity,
... | wpa_ft_set_identity | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int wpa_ft_set_key_mgmt(wpa_state_machine *sm, wpa_ft_ies *parse) {
int key_mgmt;
int ciphers;
if (sm->wpa_key_mgmt)
return 0;
key_mgmt = parse->key_mgmt & sm->wpa_auth->conf.wpa_key_mgmt;
if (key_mgmt) {
if ((key_mgmt & 0x20) != 0) {
sm->wpa_key_mgmt = 32;
} else if ((key_mgmt & 0x1000000)... | static int wpa_ft_set_key_mgmt(struct wpa_state_machine *sm,
struct wpa_ft_ies *parse) {
int key_mgmt, ciphers;
if (sm->wpa_key_mgmt)
return 0;
key_mgmt = parse->key_mgmt & sm->wpa_auth->conf.wpa_key_mgmt;
if (!key_mgmt) {
wpa_printf(MSG_DEBUG, "FT: Invalid key mgmt (0x%... | wpa_ft_set_key_mgmt | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int wpa_ft_set_radius_cui(wpa_authenticator *wpa_auth, const u8 *sta_addr,
const u8 *radius_cui, size_t radius_cui_len) {
if (wpa_auth->cb->set_radius_cui)
return wpa_auth->cb->set_radius_cui(wpa_auth->cb_ctx, sta_addr, radius_cui,
radius_cui_len);... | static int wpa_ft_set_radius_cui(struct wpa_authenticator *wpa_auth,
const u8 *sta_addr, const u8 *radius_cui,
size_t radius_cui_len) {
if (!wpa_auth->cb->set_radius_cui)
return -1;
return wpa_auth->cb->set_radius_cui(wpa_auth->cb_ctx, sta_addr, ... | wpa_ft_set_radius_cui | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void wpa_ft_set_session_timeout(wpa_authenticator *wpa_auth, const u8 *sta_addr,
int session_timeout) {
if (wpa_auth->cb->set_session_timeout)
wpa_auth->cb->set_session_timeout(wpa_auth->cb_ctx, sta_addr,
session_timeout);
} | static void wpa_ft_set_session_timeout(struct wpa_authenticator *wpa_auth,
const u8 *sta_addr,
int session_timeout) {
if (!wpa_auth->cb->set_session_timeout)
return;
wpa_auth->cb->set_session_timeout(wpa_auth->cb_ctx, sta_addr,
... | wpa_ft_set_session_timeout | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int wpa_ft_set_vlan(wpa_authenticator *wpa_auth, const u8 *sta_addr,
vlan_description *vlan) {
if (wpa_auth->cb->set_vlan)
return wpa_auth->cb->set_vlan(wpa_auth->cb_ctx, sta_addr, vlan);
else
return -1;
} | static int wpa_ft_set_vlan(struct wpa_authenticator *wpa_auth,
const u8 *sta_addr, struct vlan_description *vlan) {
if (!wpa_auth->cb->set_vlan)
return -1;
return wpa_auth->cb->set_vlan(wpa_auth->cb_ctx, sta_addr, vlan);
} | wpa_ft_set_vlan | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void wpa_ft_sta_deinit(wpa_state_machine *sm) {
eloop_cancel_timeout((eloop_timeout_handler)wpa_ft_expire_pull, sm, 0);
} | void wpa_ft_sta_deinit(struct wpa_state_machine *sm) {
eloop_cancel_timeout(wpa_ft_expire_pull, sm, NULL);
} | wpa_ft_sta_deinit | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int wpa_ft_store_pmk_fils(wpa_state_machine *sm, const u8 *pmk_r0,
const u8 *pmk_r0_name) {
size_t v3;
u32 expires_in;
int session_timeout;
const u8 *identity;
const u8 *radius_cui;
size_t pmk_r0_len;
size_t identity_len;
size_t radius_cui_len;
vlan_description vlan;
unsign... | int wpa_ft_store_pmk_fils(struct wpa_state_machine *sm, const u8 *pmk_r0,
const u8 *pmk_r0_name) {
int expires_in = sm->wpa_auth->conf.r0_key_lifetime;
struct vlan_description vlan;
const u8 *identity, *radius_cui;
size_t identity_len, radius_cui_len;
int session_timeout;
size_t pm... | wpa_ft_store_pmk_fils | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int wpa_ft_store_pmk_r0(wpa_authenticator *wpa_auth, const u8 *spa,
const u8 *pmk_r0, size_t pmk_r0_len,
const u8 *pmk_r0_name, int pairwise,
const vlan_description *vlan, int expires_in,
int session_timeout, const u8 *ident... | static int wpa_ft_store_pmk_r0(struct wpa_authenticator *wpa_auth,
const u8 *spa, const u8 *pmk_r0,
size_t pmk_r0_len, const u8 *pmk_r0_name,
int pairwise,
const struct vlan_description *vlan,
... | wpa_ft_store_pmk_r0 | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int wpa_ft_store_pmk_r1(wpa_authenticator *wpa_auth, const u8 *spa,
const u8 *pmk_r1, size_t pmk_r1_len,
const u8 *pmk_r1_name, int pairwise,
const vlan_description *vlan, int expires_in,
int session_timeout, const u8 *ident... | static int wpa_ft_store_pmk_r1(struct wpa_authenticator *wpa_auth,
const u8 *spa, const u8 *pmk_r1,
size_t pmk_r1_len, const u8 *pmk_r1_name,
int pairwise,
const struct vlan_description *vlan,
... | wpa_ft_store_pmk_r1 | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
size_t wpa_ft_tlv_len(const tlv_list *tlvs) {
int i;
size_t tlv_len;
tlv_len = 0;
if (!tlvs)
return 0;
for (i = 0; tlvs[i].type; ++i)
tlv_len += tlvs[i].len + 4;
return tlv_len;
} | static size_t wpa_ft_tlv_len(const struct tlv_list *tlvs) {
size_t tlv_len = 0;
int i;
if (!tlvs)
return 0;
for (i = 0; tlvs[i].type != FT_RRB_LAST_EMPTY; i++) {
tlv_len += sizeof(struct ft_rrb_tlv);
tlv_len += tlvs[i].len;
}
return tlv_len;
} | wpa_ft_tlv_len | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
size_t wpa_ft_tlv_lin(const tlv_list *tlvs, u8 *start, u8 *endpos) {
int i;
size_t tlv_len;
u8 *pos;
if (!tlvs)
return 0;
tlv_len = 0;
pos = start;
for (i = 0; tlvs[i].type; ++i) {
if (tlv_len + 4 > endpos - start)
return tlv_len;
tlv_len += 4LL;
*(_WORD *)pos = tlvs[i].type;
*(... | static size_t wpa_ft_tlv_lin(const struct tlv_list *tlvs, u8 *start,
u8 *endpos) {
int i;
size_t tlv_len;
struct ft_rrb_tlv *hdr;
u8 *pos;
if (!tlvs)
return 0;
tlv_len = 0;
pos = start;
for (i = 0; tlvs[i].type != FT_RRB_LAST_EMPTY; i++) {
if (tlv_len + sizeof(*hdr... | wpa_ft_tlv_lin | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int wpa_ft_validate_reassoc(wpa_state_machine *sm, const u8 *ies,
size_t ies_len) {
size_t v4;
const u8 *v5;
size_t v6;
const u8 *v7;
int seg1_idx;
int v9;
u8 fte_elem_count;
int tx_chanwidth;
int tx_seg1_idx;
unsigned int count;
int rsnxe_used;
int use_sha384;
oci_... | int wpa_ft_validate_reassoc(struct wpa_state_machine *sm, const u8 *ies,
size_t ies_len) {
struct wpa_ft_ies parse;
struct rsn_mdie *mdie;
u8 mic[WPA_EAPOL_KEY_MIC_MAX_LEN];
size_t mic_len = 16;
unsigned int count;
const u8 *kck;
size_t kck_len;
int use_sha384;
const u8 *an... | wpa_ft_validate_reassoc | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
size_t wpa_ft_vlan_len(const vlan_description *vlan) {
int i;
size_t tlv_len;
tlv_len = 0;
if (!vlan || !vlan->notempty)
return 0;
if (vlan->untagged)
tlv_len = 6;
if (vlan->tagged[0])
tlv_len += 4LL;
for (i = 0; i <= 31 && vlan->tagged[i]; ++i)
tlv_len += 2LL;
return tlv_len;
} | static size_t wpa_ft_vlan_len(const struct vlan_description *vlan) {
size_t tlv_len = 0;
int i;
if (!vlan || !vlan->notempty)
return 0;
if (vlan->untagged) {
tlv_len += sizeof(struct ft_rrb_tlv);
tlv_len += sizeof(le16);
}
if (vlan->tagged[0])
tlv_len += sizeof(struct ft_rrb_tlv);
for (i... | wpa_ft_vlan_len | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
size_t wpa_ft_vlan_lin(const vlan_description *vlan, u8 *start, u8 *endpos) {
int i;
le16 len;
size_t tlv_len;
size_t tlv_lena;
u8 *pos;
u8 *posa;
ft_rrb_tlv *hdr;
pos = start;
if (!vlan || !vlan->notempty)
return 0;
tlv_len = 0;
if (vlan->untagged) {
if (endpos < start + 4)
return ... | static size_t wpa_ft_vlan_lin(const struct vlan_description *vlan, u8 *start,
u8 *endpos) {
size_t tlv_len;
int i, len;
struct ft_rrb_tlv *hdr;
u8 *pos = start;
if (!vlan || !vlan->notempty)
return 0;
tlv_len = 0;
if (vlan->untagged) {
tlv_len += sizeof(*hdr);
i... | wpa_ft_vlan_lin | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int wpa_get_mib(wpa_authenticator *wpa_auth, char *buf, size_t buflen) {
const char *v4;
const char *v5;
const char *v6;
int v7;
int dot11RSNAAuthenticationSuiteSelected;
int v9;
int v10;
u32 dot11RSNAAuthenticationSuiteSelected_high;
int v12;
u32 dot11RSNAPairwiseCipherSelected_high;
int v14;
i... | int wpa_get_mib(struct wpa_authenticator *wpa_auth, char *buf, size_t buflen) {
struct wpa_auth_config *conf;
int len = 0, ret;
char pmkid_txt[PMKID_LEN * 2 + 1];
#ifdef CONFIG_RSN_PREAUTH
const int preauth = 1;
#else
const int preauth = 0;
#endif
if (!wpa_auth)
return len;
conf = &wpa_auth->conf;
... | wpa_get_mib | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int wpa_get_mib_sta(wpa_state_machine *sm, char *buf, size_t buflen) {
int v4;
wpa_state_machine_$6C1CD23694E0B35F0C75FE0F266E8A4E wpa_ptk_group_state;
wpa_state_machine_$BC864DD4F74E4874D00E222B2DBDB9DA wpa_ptk_state;
int v7;
int v8;
int v9;
u32 v10;
int len;
u32 pairwise;
int ret;
int reta;
i... | int wpa_get_mib_sta(struct wpa_state_machine *sm, char *buf, size_t buflen) {
int len = 0, ret;
u32 pairwise = 0;
if (!sm)
return 0;
pairwise = wpa_cipher_to_suite(sm->wpa == WPA_VERSION_WPA2 ? WPA_PROTO_RSN
: WPA_PROTO_WPA,
... | wpa_get_mib_sta | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void wpa_get_ntp_timestamp(u8 *buf) {
__uint32_t usec;
os_time now;
unsigned long v3;
v3 = __readfsqword(0x28u);
os_get_time(&now);
usec = 4295 * LODWORD(now.usec) - (LODWORD(now.usec) >> 5) -
(LODWORD(now.usec) >> 9);
*(_DWORD *)buf = _bswap_32_0(LODWORD(now.sec) - 2085978496);
*((_DWORD *)bu... | void wpa_get_ntp_timestamp(u8 *buf) {
struct os_time now;
u32 sec, usec;
be32 tmp;
os_get_time(&now);
sec = now.sec + 2208988800U;
usec = now.usec;
usec = 4295 * usec - (usec >> 5) - (usec >> 9);
tmp = host_to_be32(sec);
os_memcpy(buf, (u8 *)&tmp, 4);
tmp = host_to_be32(usec);
os_memcpy(buf + 4,... | wpa_get_ntp_timestamp | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
wowlan_triggers *wpa_get_wowlan_triggers(const char *wowlan_triggers,
const wpa_driver_capa *capa) {
_BOOL4 last;
wowlan_triggers *triggers;
char *start;
char *end;
char *buf;
if (!wowlan_triggers)
return 0;
buf = strdup(wowlan_triggers);
if (!buf)
retur... | struct wowlan_triggers *
wpa_get_wowlan_triggers(const char *wowlan_triggers,
const struct wpa_driver_capa *capa) {
struct wowlan_triggers *triggers;
char *start, *end, *buf;
int last;
if (!wowlan_triggers)
return NULL;
buf = os_strdup(wowlan_triggers);
if (buf == NULL)
ret... | wpa_get_wowlan_triggers | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int wpa_gmk_to_gtk(const u8 *gmk, const char *label, const u8 *addr,
const u8 *gnonce, u8 *gtk, size_t gtk_len) {
int ret;
u8 data[88];
unsigned long v13;
v13 = __readfsqword(0x28u);
ret = 0;
memset(data, 0, 0x4Eu);
memcpy(data, addr, 6u);
memcpy(&data[6], gnonce, 0x20u);
wpa_get_n... | static int wpa_gmk_to_gtk(const u8 *gmk, const char *label, const u8 *addr,
const u8 *gnonce, u8 *gtk, size_t gtk_len) {
u8 data[ETH_ALEN + WPA_NONCE_LEN + 8 + WPA_GTK_MAX_LEN];
u8 *pos;
int ret = 0;
os_memset(data, 0, sizeof(data));
os_memcpy(data, addr, ETH_ALEN);
os_memcpy(data... | wpa_gmk_to_gtk | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int wpa_group_config_group_keys(wpa_authenticator *wpa_auth, wpa_group *group) {
size_t GTK_len;
u8 *v3;
int GN;
wpa_alg v5;
int ret;
wpa_alg alg;
size_t len;
ret = 0;
GTK_len = group->GTK_len;
v3 = &group->GMK[32 * group->GN];
GN = group->GN;
v5 = wpa_cipher_to_alg(wpa_auth->conf.wpa_group);
... | static int wpa_group_config_group_keys(struct wpa_authenticator *wpa_auth,
struct wpa_group *group) {
struct wpa_auth_config *conf = &wpa_auth->conf;
int ret = 0;
if (wpa_auth_set_key(wpa_auth, group->vlan_id,
wpa_cipher_to_alg(conf->wpa_group), broad... | wpa_group_config_group_keys | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int wpa_group_disconnect_cb(wpa_state_machine *sm, void *ctx) {
if (ctx == sm->group) {
wpa_printf(2,
"WPA: Mark STA %02x:%02x:%02x:%02x:%02x:%02x for disconnection "
"due to fatal failure",
sm->addr[0], sm->addr[1], sm->addr[2], sm->addr[3], sm->addr[4],
... | static int wpa_group_disconnect_cb(struct wpa_state_machine *sm, void *ctx) {
if (sm->group == ctx) {
wpa_printf(MSG_DEBUG,
"WPA: Mark STA " MACSTR
" for disconnection due to fatal failure",
MAC2STR(sm->addr));
sm->Disconnect = true;
}
return 0;
} | wpa_group_disconnect_cb | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void wpa_group_ensure_init(wpa_authenticator *wpa_auth, wpa_group *group) {
if (!group->first_sta_seen) {
wpa_printf(2, "WPA: Re-initialize GMK/Counter on first station");
if (random_pool_ready() == 1) {
group->first_sta_seen = 1;
group->reject_4way_hs_for_entropy = 0;
} else {
wpa_print... | static void wpa_group_ensure_init(struct wpa_authenticator *wpa_auth,
struct wpa_group *group) {
if (group->first_sta_seen)
return;
wpa_printf(MSG_DEBUG, "WPA: Re-initialize GMK/Counter on first station");
if (random_pool_ready() != 1) {
wpa_printf(MSG_INFO, "WPA: Not en... | wpa_group_ensure_init | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void wpa_group_fatal_failure(wpa_authenticator *wpa_auth, wpa_group *group) {
wpa_printf(2, "WPA: group state machine entering state FATAL_FAILURE");
group->changed = 1;
group->wpa_group_state = WPA_GROUP_FATAL_FAILURE;
wpa_auth_for_each_sta(
wpa_auth, (int (*)(wpa_state_machine *, void *))wpa_group_disco... | static void wpa_group_fatal_failure(struct wpa_authenticator *wpa_auth,
struct wpa_group *group) {
wpa_printf(MSG_DEBUG,
"WPA: group state machine entering state FATAL_FAILURE");
group->changed = true;
group->wpa_group_state = WPA_GROUP_FATAL_FAILURE;
wpa_auth_fo... | wpa_group_fatal_failure | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void wpa_group_free(wpa_authenticator *wpa_auth, wpa_group *group) {
wpa_group *prev;
prev = wpa_auth->group;
wpa_printf(2, "WPA: Remove group state machine for VLAN-ID %d",
group->vlan_id);
while (prev) {
if (group == prev->next) {
prev->next = group->next;
free(group);
retu... | static void wpa_group_free(struct wpa_authenticator *wpa_auth,
struct wpa_group *group) {
struct wpa_group *prev = wpa_auth->group;
wpa_printf(MSG_DEBUG, "WPA: Remove group state machine for VLAN-ID %d",
group->vlan_id);
while (prev) {
if (prev->next == group) {
... | wpa_group_free | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void wpa_group_get(wpa_authenticator *wpa_auth, wpa_group *group) {
if (group != wpa_auth->group)
++group->references;
} | static void wpa_group_get(struct wpa_authenticator *wpa_auth,
struct wpa_group *group) {
if (wpa_auth->group == group)
return;
group->references++;
} | wpa_group_get | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void wpa_group_gtk_init(wpa_authenticator *wpa_auth, wpa_group *group) {
wpa_printf(2, "WPA: group state machine entering state GTK_INIT (VLAN-ID %d)",
group->vlan_id);
group->changed = 0;
group->wpa_group_state = WPA_GROUP_GTK_INIT;
memset(group->GTK, 0, sizeof(group->GTK));
group->GN = 1;
gro... | static void wpa_group_gtk_init(struct wpa_authenticator *wpa_auth,
struct wpa_group *group) {
wpa_printf(MSG_DEBUG,
"WPA: group state machine entering state GTK_INIT (VLAN-ID %d)",
group->vlan_id);
group->changed = false;
group->wpa_group_state = WPA_GROUP_... | wpa_group_gtk_init | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
wpa_group *wpa_group_init(wpa_authenticator *wpa_auth, int vlan_id,
int delay_init) {
wpa_group *group;
group = (wpa_group *)os_zalloc(0x168u);
if (!group)
return 0;
group->GTKAuthenticator = 1;
group->vlan_id = vlan_id;
group->GTK_len = wpa_cipher_key_len(wpa_auth->conf.wpa_g... | static struct wpa_group *wpa_group_init(struct wpa_authenticator *wpa_auth,
int vlan_id, int delay_init) {
struct wpa_group *group;
group = os_zalloc(sizeof(struct wpa_group));
if (!group)
return NULL;
group->GTKAuthenticator = true;
group->vlan_id = vlan_id;
gr... | wpa_group_init | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int wpa_group_init_gmk_and_counter(wpa_authenticator *wpa_auth,
wpa_group *group) {
u8 buf[32];
u8 rkey[40];
unsigned long v5;
v5 = __readfsqword(0x28u);
if (random_get_bytes(group->GMK, 0x20u) < 0)
return -1;
wpa_hexdump_key(2, "GMK", group->GMK, 0x20u);
memcpy(buf... | static int wpa_group_init_gmk_and_counter(struct wpa_authenticator *wpa_auth,
struct wpa_group *group) {
u8 buf[ETH_ALEN + 8 + sizeof(unsigned long)];
u8 rkey[32];
unsigned long ptr;
if (random_get_bytes(group->GMK, WPA_GMK_LEN) < 0)
return -1;
wpa_hexdump_key(MS... | wpa_group_init_gmk_and_counter | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void wpa_group_put(wpa_authenticator *wpa_auth, wpa_group *group) {
if (group != wpa_auth->group && !--group->references)
wpa_group_free(wpa_auth, group);
} | static void wpa_group_put(struct wpa_authenticator *wpa_auth,
struct wpa_group *group) {
if (wpa_auth->group == group)
return;
group->references--;
if (group->references)
return;
wpa_group_free(wpa_auth, group);
} | wpa_group_put | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void wpa_group_setkeys(wpa_authenticator *wpa_auth, wpa_group *group) {
int tmp;
int tmpa;
int tmpb;
wpa_printf(2, "WPA: group state machine entering state SETKEYS (VLAN-ID %d)",
group->vlan_id);
group->changed = 1;
group->wpa_group_state = WPA_GROUP_SETKEYS;
group->GTKReKey = 0;
tmp = gro... | static void wpa_group_setkeys(struct wpa_authenticator *wpa_auth,
struct wpa_group *group) {
int tmp;
wpa_printf(MSG_DEBUG,
"WPA: group state machine entering state SETKEYS (VLAN-ID %d)",
group->vlan_id);
group->changed = true;
group->wpa_group_state = WP... | wpa_group_setkeys | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int wpa_group_setkeysdone(wpa_authenticator *wpa_auth, wpa_group *group) {
wpa_printf(2,
"WPA: group state machine entering state SETKEYSDONE (VLAN-ID %d)",
group->vlan_id);
group->changed = 1;
group->wpa_group_state = WPA_GROUP_SETKEYSDONE;
if (wpa_group_config_group_keys(wpa_auth, gr... | static int wpa_group_setkeysdone(struct wpa_authenticator *wpa_auth,
struct wpa_group *group) {
wpa_printf(MSG_DEBUG,
"WPA: group state machine entering state SETKEYSDONE (VLAN-ID %d)",
group->vlan_id);
group->changed = true;
group->wpa_group_state = WPA_... | wpa_group_setkeysdone | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void wpa_group_sm_step(wpa_authenticator *wpa_auth, wpa_group *group) {
if (group->GInit) {
wpa_group_gtk_init(wpa_auth, group);
return;
}
if (group->wpa_group_state != WPA_GROUP_FATAL_FAILURE) {
if (group->wpa_group_state == WPA_GROUP_GTK_INIT && group->GTKAuthenticator)
goto LABEL_6;
if (g... | static void wpa_group_sm_step(struct wpa_authenticator *wpa_auth,
struct wpa_group *group) {
if (group->GInit) {
wpa_group_gtk_init(wpa_auth, group);
} else if (group->wpa_group_state == WPA_GROUP_FATAL_FAILURE) {
} else if (group->wpa_group_state == WPA_GROUP_GTK_INIT &&
... | wpa_group_sm_step | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int wpa_group_update_sta(wpa_state_machine *sm, void *ctx) {
if (ctx && ctx != sm->group)
return 0;
if (sm->wpa_ptk_state == WPA_PTK_PTKINITDONE) {
if (sm->GUpdateStationKeys)
wpa_auth_logger(sm->wpa_auth, sm->addr, LOGGER_DEBUG,
"GUpdateStationKeys was already set when marking s... | static int wpa_group_update_sta(struct wpa_state_machine *sm, void *ctx) {
if (ctx != NULL && ctx != sm->group)
return 0;
if (sm->wpa_ptk_state != WPA_PTK_PTKINITDONE) {
wpa_auth_logger(sm->wpa_auth, sm->addr, LOGGER_DEBUG,
"Not in PTKINITDONE; skip Group Key update");
sm->GUpdateSt... | wpa_group_update_sta | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void wpa_gtk_rekey(wpa_authenticator *wpa_auth) {
int i;
int tmp;
int tmpa;
int tmpb;
wpa_group *group;
if (wpa_auth) {
group = wpa_auth->group;
for (i = 0; i <= 1; ++i) {
tmp = group->GM;
group->GM = group->GN;
group->GN = tmp;
tmpa = group->GM_igtk;
group->GM_igtk = ... | void wpa_gtk_rekey(struct wpa_authenticator *wpa_auth) {
int tmp, i;
struct wpa_group *group;
if (!wpa_auth)
return;
group = wpa_auth->group;
for (i = 0; i < 2; i++) {
tmp = group->GM;
group->GM = group->GN;
group->GN = tmp;
tmp = group->GM_igtk;
group->GM_igtk = group->GN_igtk;
... | wpa_gtk_rekey | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int wpa_gtk_update(wpa_authenticator *wpa_auth, wpa_group *group) {
int ret;
size_t len;
size_t lena;
ret = 0;
memcpy(group->GNonce, group->Counter, sizeof(group->GNonce));
inc_byte_array(group->Counter, 0x20u);
if (wpa_gmk_to_gtk(group->GMK, "Group key expansion", wpa_auth->addr,
gr... | static int wpa_gtk_update(struct wpa_authenticator *wpa_auth,
struct wpa_group *group) {
struct wpa_auth_config *conf = &wpa_auth->conf;
int ret = 0;
size_t len;
os_memcpy(group->GNonce, group->Counter, WPA_NONCE_LEN);
inc_byte_array(group->Counter, WPA_NONCE_LEN);
if (wpa_gmk_to_... | wpa_gtk_update | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
wpa_authenticator *wpa_init(const u8 *addr, wpa_auth_config *conf,
const wpa_auth_callbacks *cb, void *cb_ctx) {
wpa_authenticator *wpa_auth;
wpa_auth = (wpa_authenticator *)os_zalloc(0x1C0u);
if (!wpa_auth)
return 0;
memcpy(wpa_auth->addr, addr, sizeof(wpa_auth->addr));
memcp... | struct wpa_authenticator *wpa_init(const u8 *addr, struct wpa_auth_config *conf,
const struct wpa_auth_callbacks *cb,
void *cb_ctx) {
struct wpa_authenticator *wpa_auth;
wpa_auth = os_zalloc(sizeof(struct wpa_authenticator));
if (!wpa_auth)
... | wpa_init | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int wpa_init_keys(wpa_authenticator *wpa_auth) {
wpa_group *group;
group = wpa_auth->group;
wpa_printf(2, "WPA: Start group state machine to set initial keys");
wpa_group_sm_step(wpa_auth, group);
group->GInit = 0;
wpa_group_sm_step(wpa_auth, group);
if (group->wpa_group_state == WPA_GROUP_FATAL_FAILURE)... | int wpa_init_keys(struct wpa_authenticator *wpa_auth) {
struct wpa_group *group = wpa_auth->group;
wpa_printf(MSG_DEBUG, "WPA: Start group state machine to set initial keys");
wpa_group_sm_step(wpa_auth, group);
group->GInit = false;
wpa_group_sm_step(wpa_auth, group);
if (group->wpa_group_state == WPA_GRO... | wpa_init_keys | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int wpa_insert_pmkid(u8 *ies, size_t *ies_len, const u8 *pmkid) {
_BYTE *v4;
long v5;
long v6;
u16 num_pmkid;
int added;
int addeda;
u8 *start;
u8 *rposb;
u8 *rpos;
u8 *rposa;
u8 *rposc;
u8 *rposd;
u8 *rend;
u8 *end;
added = 0;
start = ies;
end = &ies[*ies_len];
while (start < end &... | int wpa_insert_pmkid(u8 *ies, size_t *ies_len, const u8 *pmkid) {
u8 *start, *end, *rpos, *rend;
int added = 0;
start = ies;
end = ies + *ies_len;
while (start < end) {
if (*start == WLAN_EID_RSN)
break;
start += 2 + start[1];
}
if (start >= end) {
wpa_printf(MSG_ERROR, "RSN: Could not... | wpa_insert_pmkid | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
unsigned int wpa_kck2_len(int akmp) {
if (akmp == 0x100000)
return 16;
if (akmp == 0x200000)
return 24;
return 0;
} | static unsigned int wpa_kck2_len(int akmp) {
switch (akmp) {
case WPA_KEY_MGMT_FT_FILS_SHA256:
return 16;
case WPA_KEY_MGMT_FT_FILS_SHA384:
return 24;
default:
return 0;
}
} | wpa_kck2_len | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
unsigned int wpa_kck_len(int akmp, size_t pmk_len) {
long v2;
if (akmp == 0x1000000)
goto LABEL_16;
if (akmp > 0x1000000)
goto LABEL_20;
if (akmp == 0x800000)
return pmk_len >> 1;
if (akmp > 0x800000)
goto LABEL_20;
if (akmp == 0x400000)
return pmk_len >> 1;
if (akmp > 0x400000)
g... | static unsigned int wpa_kck_len(int akmp, size_t pmk_len) {
switch (akmp) {
case WPA_KEY_MGMT_IEEE8021X_SUITE_B_192:
case WPA_KEY_MGMT_FT_IEEE8021X_SHA384:
return 24;
case WPA_KEY_MGMT_FILS_SHA256:
case WPA_KEY_MGMT_FT_FILS_SHA256:
case WPA_KEY_MGMT_FILS_SHA384:
case WPA_KEY_MGMT_FT_FILS_SHA384:
r... | wpa_kck_len | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
unsigned int wpa_kek2_len(int akmp) {
if (akmp == 0x100000)
return 16;
if (akmp == 0x200000)
return 32;
return 0;
} | static unsigned int wpa_kek2_len(int akmp) {
switch (akmp) {
case WPA_KEY_MGMT_FT_FILS_SHA256:
return 16;
case WPA_KEY_MGMT_FT_FILS_SHA384:
return 32;
default:
return 0;
}
} | wpa_kek2_len | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
unsigned int wpa_kek_len(int akmp, size_t pmk_len) {
if (akmp == 0x1000000)
return 32;
if (akmp > 0x1000000)
return 16;
if (akmp == 0x800000) {
if (pmk_len > 0x20)
return 32;
else
return 16;
} else {
if (akmp > 0x800000)
return 16;
if (akmp != 0x400000) {
if (akmp... | static unsigned int wpa_kek_len(int akmp, size_t pmk_len) {
switch (akmp) {
case WPA_KEY_MGMT_FILS_SHA384:
case WPA_KEY_MGMT_FT_FILS_SHA384:
return 64;
case WPA_KEY_MGMT_IEEE8021X_SUITE_B_192:
case WPA_KEY_MGMT_FILS_SHA256:
case WPA_KEY_MGMT_FT_FILS_SHA256:
case WPA_KEY_MGMT_FT_IEEE8021X_SHA384:
r... | wpa_kek_len | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int wpa_key_mgmt_to_bitfield(const u8 *s) {
if (WPA_GET_BE32_1(s) == 5304833)
return 1;
if (WPA_GET_BE32_1(s) == 5304834)
return 2;
if (WPA_GET_BE32_1(s) == 5304832)
return 16;
return 0;
} | static int wpa_key_mgmt_to_bitfield(const u8 *s) {
if (RSN_SELECTOR_GET(s) == WPA_AUTH_KEY_MGMT_UNSPEC_802_1X)
return WPA_KEY_MGMT_IEEE8021X;
if (RSN_SELECTOR_GET(s) == WPA_AUTH_KEY_MGMT_PSK_OVER_802_1X)
return WPA_KEY_MGMT_PSK;
if (RSN_SELECTOR_GET(s) == WPA_AUTH_KEY_MGMT_NONE)
return WPA_KEY_MGMT_WP... | wpa_key_mgmt_to_bitfield | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int wpa_key_mgmt_to_suites(unsigned int key_mgmt_suites, u32 *suites,
int max_suites) {
int v3;
int v4;
int v5;
int v6;
int v7;
int v8;
int v9;
int v10;
int v11;
int v12;
int v13;
int v14;
int v15;
int v16;
int v17;
int v18;
int v19;
int v20;
int num_suit... | static int wpa_key_mgmt_to_suites(unsigned int key_mgmt_suites, u32 suites[],
int max_suites) {
int num_suites = 0;
#define __AKM(a, b) \
if (num_suites < max_suites && (key_mgmt_suites & (WPA_KEY_MGMT_##a))) \
sui... | wpa_key_mgmt_to_suites | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
const char *wpa_key_mgmt_txt(int key_mgmt, int proto) {
const char *result;
if (key_mgmt == 0x2000000)
return "PASN";
if (key_mgmt > 0x2000000)
return "UNKNOWN";
if (key_mgmt == 0x1000000)
return "FT-EAP-SHA384";
if (key_mgmt > 0x1000000)
return "UNKNOWN";
if (key_mgmt == 0x800000)
retu... | const char *wpa_key_mgmt_txt(int key_mgmt, int proto) {
switch (key_mgmt) {
case WPA_KEY_MGMT_IEEE8021X:
if (proto == (WPA_PROTO_RSN | WPA_PROTO_WPA))
return "WPA2+WPA/IEEE 802.1X/EAP";
return proto == WPA_PROTO_RSN ? "WPA2/IEEE 802.1X/EAP"
: "WPA/IEEE 802.1X/EAP";
... | wpa_key_mgmt_txt | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
unsigned int wpa_mic_len(int akmp, size_t pmk_len) {
long v2;
if (akmp == 0x1000000)
goto LABEL_16;
if (akmp > 0x1000000)
goto LABEL_20;
if (akmp == 0x800000)
return pmk_len >> 1;
if (akmp > 0x800000)
goto LABEL_20;
if (akmp == 0x400000)
return pmk_len >> 1;
if (akmp > 0x400000)
g... | unsigned int wpa_mic_len(int akmp, size_t pmk_len) {
switch (akmp) {
case WPA_KEY_MGMT_IEEE8021X_SUITE_B_192:
case WPA_KEY_MGMT_FT_IEEE8021X_SHA384:
return 24;
case WPA_KEY_MGMT_FILS_SHA256:
case WPA_KEY_MGMT_FILS_SHA384:
case WPA_KEY_MGMT_FT_FILS_SHA256:
case WPA_KEY_MGMT_FT_FILS_SHA384:
return 0... | wpa_mic_len | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void wpa_msg(void *ctx, int level, const char *fmt, ...) {
long v3;
long v4;
long v5;
int buflen;
int res;
int len;
char *buf;
const char *ifname;
va_list ap;
char prefix[136];
unsigned long v14;
long v15;
long v16;
long v17;
va_start(ap, fmt);
v3 = va_arg(ap, _QWORD);
v4 = va_arg(ap,... | void wpa_msg(void *ctx, int level, const char *fmt, ...) {
va_list ap;
char *buf;
int buflen;
int len;
char prefix[130];
va_start(ap, fmt);
buflen = vsnprintf(NULL, 0, fmt, ap) + 1;
va_end(ap);
buf = os_malloc(buflen);
if (buf == NULL) {
wpa_printf(MSG_ERROR, "wpa_msg: Failed to allocate messa... | wpa_msg | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
u16 wpa_own_rsn_capab(wpa_auth_config *conf) {
u16 capab;
capab = conf->rsn_preauth != 0;
if (conf->wmm_enabled)
capab |= 0xCu;
if (conf->ieee80211w) {
capab |= 0x80u;
if (conf->ieee80211w == mfp_options_MGMT_FRAME_PROTECTION_REQUIRED)
capab |= 0x40u;
}
if (conf->ocv)
capab |= 0x4000u... | static u16 wpa_own_rsn_capab(struct wpa_auth_config *conf) {
u16 capab = 0;
if (conf->rsn_preauth)
capab |= WPA_CAPABILITY_PREAUTH;
if (conf->wmm_enabled) {
capab |= (RSN_NUM_REPLAY_COUNTERS_16 << 2);
}
if (conf->ieee80211w != NO_MGMT_FRAME_PROTECTION) {
capab |= WPA_CAPABILITY_MFPC;
if (con... | wpa_own_rsn_capab | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int wpa_parse_cipher(const char *value) {
int v2;
int v3;
int v4;
int v5;
int v6;
int v7;
int val;
_BOOL4 last;
char *start;
char *end;
char *buf;
val = 0;
buf = strdup(value);
if (!buf)
return -1;
for (start = buf; *start; start = end + 1) {
while (*start == 32 || *start == 9)
... | int wpa_parse_cipher(const char *value) {
int val = 0, last;
char *start, *end, *buf;
buf = os_strdup(value);
if (buf == NULL)
return -1;
start = buf;
while (*start != '\0') {
while (*start == ' ' || *start == '\t')
start++;
if (*start == '\0')
break;
end = start;
while (*e... | wpa_parse_cipher | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int wpa_parse_generic(const u8 *pos, wpa_eapol_ie_parse *ie) {
if (!pos[1])
return 1;
if (pos[1] > 5u && WPA_GET_BE32_1(pos + 2) == 5304833 && pos[6] == 1 &&
!pos[7]) {
ie->wpa_ie = pos;
ie->wpa_ie_len = pos[1] + 2;
wpa_hexdump(2, "WPA: WPA IE in EAPOL-Key", ie->wpa_ie, ie->wpa_ie_len);
re... | static int wpa_parse_generic(const u8 *pos, struct wpa_eapol_ie_parse *ie) {
if (pos[1] == 0)
return 1;
if (pos[1] >= 6 && RSN_SELECTOR_GET(pos + 2) == WPA_OUI_TYPE &&
pos[2 + WPA_SELECTOR_LEN] == 1 && pos[2 + WPA_SELECTOR_LEN + 1] == 0) {
ie->wpa_ie = pos;
ie->wpa_ie_len = pos[1] + 2;
wpa_he... | wpa_parse_generic | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int wpa_parse_kde_ies(const u8 *buf, size_t len, wpa_eapol_ie_parse *ie) {
int ret;
int reta;
const u8 *pos;
const u8 *end;
ret = 0;
memset(ie, 0, sizeof(wpa_eapol_ie_parse));
pos = buf;
end = &buf[len];
while (end - pos > 1 && (*pos != 0xDD || pos != &buf[len - 1] && pos[1])) {
if (pos[1] + 2 > ... | int wpa_parse_kde_ies(const u8 *buf, size_t len,
struct wpa_eapol_ie_parse *ie) {
const u8 *pos, *end;
int ret = 0;
os_memset(ie, 0, sizeof(*ie));
for (pos = buf, end = pos + len; end - pos > 1; pos += 2 + pos[1]) {
if (pos[0] == 0xdd && ((pos == buf + len - 1) || pos[1] == 0)) {
... | wpa_parse_kde_ies | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void wpa_parse_vendor_specific(const u8 *pos, const u8 *end,
wpa_eapol_ie_parse *ie) {
if (pos[1] > 3u) {
if (WPA_GET_BE24_0(pos + 2) == 20722 && pos[5] == 2 && pos[1] > 4u) {
if (pos[6]) {
if (pos[6] == 1) {
ie->wmm = pos + 2;
ie->wmm_len = pos[1];... | static void wpa_parse_vendor_specific(const u8 *pos, const u8 *end,
struct wpa_eapol_ie_parse *ie) {
unsigned int oui;
if (pos[1] < 4) {
wpa_printf(MSG_MSGDUMP, "Too short vendor specific IE ignored (len=%u)",
pos[1]);
return;
}
oui = WPA_GET_BE24(&... | wpa_parse_vendor_specific | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int wpa_parse_wpa_ie_rsn(const u8 *rsn_ie, size_t rsn_ie_len,
wpa_ie_data *data) {
u32 v4;
u16 v5;
u16 v6;
u32 v7;
u16 num_pmkid;
int left;
unsigned int lefta;
int i;
int ia;
int count;
int counta;
const u8 *pos;
const u8 *posa;
memset(data, 0, sizeof(wpa_ie_data));... | int wpa_parse_wpa_ie_rsn(const u8 *rsn_ie, size_t rsn_ie_len,
struct wpa_ie_data *data) {
const u8 *pos;
int left;
int i, count;
os_memset(data, 0, sizeof(*data));
data->proto = WPA_PROTO_RSN;
data->pairwise_cipher = WPA_CIPHER_CCMP;
data->group_cipher = WPA_CIPHER_CCMP;
data->... | wpa_parse_wpa_ie_rsn | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int wpa_parse_wpa_ie_wpa(const u8 *wpa_ie, size_t wpa_ie_len,
wpa_ie_data *data) {
u16 v4;
u16 v5;
int left;
int i;
int ia;
int count;
int counta;
const u8 *pos;
memset(data, 0, sizeof(wpa_ie_data));
data->proto = 1;
data->pairwise_cipher = 8;
data->group_cipher = 8;
... | int wpa_parse_wpa_ie_wpa(const u8 *wpa_ie, size_t wpa_ie_len,
struct wpa_ie_data *data) {
const struct wpa_ie_hdr *hdr;
const u8 *pos;
int left;
int i, count;
os_memset(data, 0, sizeof(*data));
data->proto = WPA_PROTO_WPA;
data->pairwise_cipher = WPA_CIPHER_TKIP;
data->group_ci... | wpa_parse_wpa_ie_wpa | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int wpa_pick_group_cipher(int ciphers) {
if ((ciphers & 0x200) != 0)
return 512;
if ((ciphers & 0x100) != 0)
return 256;
if ((ciphers & 0x10) != 0)
return 16;
if ((ciphers & 0x40) != 0)
return 64;
if ((ciphers & 0x4000) != 0)
return 0x4000;
if ((ciphers & 8) != 0)
return 8;
return ... | int wpa_pick_group_cipher(int ciphers) {
if (ciphers & WPA_CIPHER_CCMP_256)
return WPA_CIPHER_CCMP_256;
if (ciphers & WPA_CIPHER_GCMP_256)
return WPA_CIPHER_GCMP_256;
if (ciphers & WPA_CIPHER_CCMP)
return WPA_CIPHER_CCMP;
if (ciphers & WPA_CIPHER_GCMP)
return WPA_CIPHER_GCMP;
if (ciphers & WPA... | wpa_pick_group_cipher | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int wpa_pick_pairwise_cipher(int ciphers, int none_allowed) {
if ((ciphers & 0x200) != 0)
return 512;
if ((ciphers & 0x100) != 0)
return 256;
if ((ciphers & 0x10) != 0)
return 16;
if ((ciphers & 0x40) != 0)
return 64;
if ((ciphers & 8) != 0)
return 8;
if (none_allowed && (ciphers & 1) !=... | int wpa_pick_pairwise_cipher(int ciphers, int none_allowed) {
if (ciphers & WPA_CIPHER_CCMP_256)
return WPA_CIPHER_CCMP_256;
if (ciphers & WPA_CIPHER_GCMP_256)
return WPA_CIPHER_GCMP_256;
if (ciphers & WPA_CIPHER_CCMP)
return WPA_CIPHER_CCMP;
if (ciphers & WPA_CIPHER_GCMP)
return WPA_CIPHER_GCMP... | wpa_pick_pairwise_cipher | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int wpa_pmk_r1_to_ptk(const u8 *pmk_r1, size_t pmk_r1_len, const u8 *snonce,
const u8 *anonce, const u8 *sta_addr, const u8 *bssid,
const u8 *pmk_r1_name, wpa_ptk *ptk, u8 *ptk_name,
int akmp, int cipher, size_t kdk_len) {
const char *v13;
long v14;
... | int wpa_pmk_r1_to_ptk(const u8 *pmk_r1, size_t pmk_r1_len, const u8 *snonce,
const u8 *anonce, const u8 *sta_addr, const u8 *bssid,
const u8 *pmk_r1_name, struct wpa_ptk *ptk, u8 *ptk_name,
int akmp, int cipher, size_t kdk_len) {
u8 buf[2 * WPA_NONCE_L... | wpa_pmk_r1_to_ptk | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int wpa_pmk_to_ptk(const u8 *pmk, size_t pmk_len, const char *label,
const u8 *addr1, const u8 *addr2, const u8 *nonce1,
const u8 *nonce2, wpa_ptk *ptk, int akmp, int cipher,
const u8 *z, size_t z_len, size_t kdk_len) {
int owe_ptk_workaround;
size_t data_len... | int wpa_pmk_to_ptk(const u8 *pmk, size_t pmk_len, const char *label,
const u8 *addr1, const u8 *addr2, const u8 *nonce1,
const u8 *nonce2, struct wpa_ptk *ptk, int akmp, int cipher,
const u8 *z, size_t z_len, size_t kdk_len) {
#define MAX_Z_LEN 66
u8 data[2 * E... | wpa_pmk_to_ptk | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void wpa_receive(wpa_authenticator *wpa_auth, wpa_state_machine *sm, u8 *data,
size_t data_len) {
u16 key_info;
u16 key_data_length;
u16 ver;
int msg;
int i;
char *msgtxt;
size_t mic_len;
size_t keyhdrlen;
wpa_eapol_key *key;
wpa_eapol_ie_parse kde;
unsigned long v16;
v16 = __r... | void wpa_receive(struct wpa_authenticator *wpa_auth,
struct wpa_state_machine *sm, u8 *data, size_t data_len) {
struct ieee802_1x_hdr *hdr;
struct wpa_eapol_key *key;
u16 key_info, key_data_length;
enum { PAIRWISE_2, PAIRWISE_4, GROUP_2, REQUEST } msg;
char *msgtxt;
struct wpa_eapol_ie_pars... | wpa_receive | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int wpa_receive_error_report(wpa_authenticator *wpa_auth, wpa_state_machine *sm,
int group) {
wpa_auth_vlogger(wpa_auth, sm->addr, LOGGER_INFO,
"received EAPOL-Key Error Request (STA detected Michael MIC "
"failure (group=%d))",
gro... | static int wpa_receive_error_report(struct wpa_authenticator *wpa_auth,
struct wpa_state_machine *sm, int group) {
wpa_auth_vlogger(wpa_auth, sm->addr, LOGGER_INFO,
"received EAPOL-Key Error Request (STA detected Michael MIC "
"failure (group=... | wpa_receive_error_report | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int wpa_reconfig(wpa_authenticator *wpa_auth, wpa_auth_config *conf) {
wpa_group *group;
if (!wpa_auth)
return 0;
memcpy(&wpa_auth->conf, conf, sizeof(wpa_auth->conf));
if (wpa_auth_gen_wpa_ie(wpa_auth)) {
wpa_printf(5, "Could not generate WPA IE.");
return -1;
} else {
group = wpa_auth->grou... | int wpa_reconfig(struct wpa_authenticator *wpa_auth,
struct wpa_auth_config *conf) {
struct wpa_group *group;
if (!wpa_auth)
return 0;
os_memcpy(&wpa_auth->conf, conf, sizeof(*conf));
if (wpa_auth_gen_wpa_ie(wpa_auth)) {
wpa_printf(MSG_ERROR, "Could not generate WPA IE.");
return ... | wpa_reconfig | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void wpa_rekey_gmk(void *eloop_ctx, void *timeout_ctx) {
if (random_get_bytes((void *)(*(_QWORD *)eloop_ctx + 76LL), 0x20u)) {
wpa_printf(5, "Failed to get random data for WPA initialization.");
} else {
wpa_auth_logger((wpa_authenticator *)eloop_ctx, 0, LOGGER_DEBUG,
"GMK rekeyd");
... | static void wpa_rekey_gmk(void *eloop_ctx, void *timeout_ctx) {
struct wpa_authenticator *wpa_auth = eloop_ctx;
if (random_get_bytes(wpa_auth->group->GMK, WPA_GMK_LEN)) {
wpa_printf(MSG_ERROR, "Failed to get random data for WPA initialization.");
} else {
wpa_auth_logger(wpa_auth, NULL, LOGGER_DEBUG, "GM... | wpa_rekey_gmk | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void wpa_rekey_gtk(void *eloop_ctx, void *timeout_ctx) {
wpa_group *group;
wpa_group *next;
wpa_auth_logger((wpa_authenticator *)eloop_ctx, 0, LOGGER_DEBUG,
"rekeying GTK");
for (group = *(wpa_group **)eloop_ctx; group; group = next) {
wpa_group_get((wpa_authenticator *)eloop_ctx, group);... | static void wpa_rekey_gtk(void *eloop_ctx, void *timeout_ctx) {
struct wpa_authenticator *wpa_auth = eloop_ctx;
struct wpa_group *group, *next;
wpa_auth_logger(wpa_auth, NULL, LOGGER_DEBUG, "rekeying GTK");
group = wpa_auth->group;
while (group) {
wpa_group_get(wpa_auth, group);
group->GTKReKey = tr... | wpa_rekey_gtk | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void wpa_rekey_ptk(void *eloop_ctx, void *timeout_ctx) {
wpa_auth_logger((wpa_authenticator *)eloop_ctx, (const u8 *)timeout_ctx + 16,
LOGGER_DEBUG, "rekeying PTK");
wpa_request_new_ptk((wpa_state_machine *)timeout_ctx);
wpa_sm_step((wpa_state_machine *)timeout_ctx);
} | static void wpa_rekey_ptk(void *eloop_ctx, void *timeout_ctx) {
struct wpa_authenticator *wpa_auth = eloop_ctx;
struct wpa_state_machine *sm = timeout_ctx;
wpa_auth_logger(wpa_auth, sm->addr, LOGGER_DEBUG, "rekeying PTK");
wpa_request_new_ptk(sm);
wpa_sm_step(sm);
} | wpa_rekey_ptk | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void wpa_remove_ptk(wpa_state_machine *sm) {
sm->PTK_valid = 0;
memset(&sm->PTK, 0, sizeof(sm->PTK));
wpa_auth_remove_ptksa(sm->wpa_auth, sm->addr, sm->pairwise);
if (wpa_auth_set_key(sm->wpa_auth, 0, wpa_alg_WPA_ALG_NONE, sm->addr, 0, 0, 0,
key_flag_KEY_FLAG_PAIRWISE))
wpa_printf(2, ... | void wpa_remove_ptk(struct wpa_state_machine *sm) {
sm->PTK_valid = false;
os_memset(&sm->PTK, 0, sizeof(sm->PTK));
wpa_auth_remove_ptksa(sm->wpa_auth, sm->addr, sm->pairwise);
if (wpa_auth_set_key(sm->wpa_auth, 0, WPA_ALG_NONE, sm->addr, 0, NULL, 0,
KEY_FLAG_PAIRWISE))
wpa_printf(M... | wpa_remove_ptk | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void wpa_replay_counter_mark_invalid(wpa_key_replay_counter *ctr,
const u8 *replay_counter) {
int i;
for (i = 0; i <= 3; ++i) {
if (ctr[i].valid &&
(!replay_counter || !memcmp(replay_counter, &ctr[i], 8u)))
ctr[i].valid = 0;
}
} | static void wpa_replay_counter_mark_invalid(struct wpa_key_replay_counter *ctr,
const u8 *replay_counter) {
int i;
for (i = 0; i < RSNA_MAX_EAPOL_RETRIES; i++) {
if (ctr[i].valid &&
(!replay_counter || os_memcmp(replay_counter, ctr[i].counter,
... | wpa_replay_counter_mark_invalid | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int wpa_replay_counter_valid(wpa_key_replay_counter *ctr,
const u8 *replay_counter) {
int i;
for (i = 0; i <= 3 && ctr[i].valid; ++i) {
if (!memcmp(replay_counter, &ctr[i], 8u))
return 1;
}
return 0;
} | static int wpa_replay_counter_valid(struct wpa_key_replay_counter *ctr,
const u8 *replay_counter) {
int i;
for (i = 0; i < RSNA_MAX_EAPOL_RETRIES; i++) {
if (!ctr[i].valid)
break;
if (os_memcmp(replay_counter, ctr[i].counter, WPA_REPLAY_COUNTER_LEN) == 0)
retu... | wpa_replay_counter_valid | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void wpa_request_new_ptk(wpa_state_machine *sm) {
if (sm) {
if (!sm->use_ext_key_id && sm->wpa_auth->conf.wpa_deny_ptk0_rekey) {
wpa_printf(3,
"WPA: PTK0 rekey not allowed, disconnect "
"%02x:%02x:%02x:%02x:%02x:%02x",
sm->addr[0], sm->addr[1], sm->addr[2],... | static void wpa_request_new_ptk(struct wpa_state_machine *sm) {
if (!sm)
return;
if (!sm->use_ext_key_id && sm->wpa_auth->conf.wpa_deny_ptk0_rekey) {
wpa_printf(MSG_INFO, "WPA: PTK0 rekey not allowed, disconnect " MACSTR,
MAC2STR(sm->addr));
sm->Disconnect = true;
sm->disconnect_rea... | wpa_request_new_ptk | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
u16 wpa_res_to_status_code(wpa_validate_result res) {
u16 result;
switch (res) {
case wpa_validate_result_WPA_IE_OK:
result = 0;
break;
case wpa_validate_result_WPA_INVALID_IE:
result = 40;
break;
case wpa_validate_result_WPA_INVALID_GROUP:
result = 41;
break;
case wpa_validate_resu... | static u16 wpa_res_to_status_code(enum wpa_validate_result res) {
switch (res) {
case WPA_IE_OK:
return WLAN_STATUS_SUCCESS;
case WPA_INVALID_IE:
return WLAN_STATUS_INVALID_IE;
case WPA_INVALID_GROUP:
return WLAN_STATUS_GROUP_CIPHER_NOT_VALID;
case WPA_INVALID_PAIRWISE:
return WLAN_STATUS_PAIR... | wpa_res_to_status_code | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void wpa_scan_results_free(wpa_scan_results *res) {
size_t i;
if (res) {
for (i = 0; i < res->num; ++i)
free(res->res[i]);
free(res->res);
free(res);
}
} | void wpa_scan_results_free(struct wpa_scan_results *res) {
size_t i;
if (res == NULL)
return;
for (i = 0; i < res->num; i++)
os_free(res->res[i]);
os_free(res->res);
os_free(res);
} | wpa_scan_results_free | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int wpa_select_ap_group_cipher(int wpa, int wpa_pairwise, int rsn_pairwise) {
short pairwise;
pairwise = 0;
if ((wpa & 1) != 0)
pairwise = wpa_pairwise;
if ((wpa & 2) != 0)
pairwise |= rsn_pairwise;
if ((pairwise & 8) != 0)
return 8;
if ((pairwise & 0x50) == 0x40)
return 64;
if ((pairwise... | int wpa_select_ap_group_cipher(int wpa, int wpa_pairwise, int rsn_pairwise) {
int pairwise = 0;
if (wpa & 1)
pairwise |= wpa_pairwise;
if (wpa & 2)
pairwise |= rsn_pairwise;
if (pairwise & WPA_CIPHER_TKIP)
return WPA_CIPHER_TKIP;
if ((pairwise & (WPA_CIPHER_CCMP | WPA_CIPHER_GCMP)) == WPA_CIPHER... | wpa_select_ap_group_cipher | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int wpa_selector_to_bitfield(const u8 *s) {
if (WPA_GET_BE32_1(s) == 5304832)
return 1;
if (WPA_GET_BE32_1(s) == 5304834)
return 8;
if (WPA_GET_BE32_1(s) == 5304836)
return 16;
return 0;
} | static int wpa_selector_to_bitfield(const u8 *s) {
if (RSN_SELECTOR_GET(s) == WPA_CIPHER_SUITE_NONE)
return WPA_CIPHER_NONE;
if (RSN_SELECTOR_GET(s) == WPA_CIPHER_SUITE_TKIP)
return WPA_CIPHER_TKIP;
if (RSN_SELECTOR_GET(s) == WPA_CIPHER_SUITE_CCMP)
return WPA_CIPHER_CCMP;
return 0;
} | wpa_selector_to_bitfield | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void wpa_send_eapol(wpa_authenticator *wpa_auth, wpa_state_machine *sm,
int key_info, const u8 *key_rsc, const u8 *nonce,
const u8 *kde, size_t kde_len, int keyidx, int encr) {
u32 TimeoutCtr;
int v10;
short key_infoa;
int timeout_ms;
int pairwise;
u32 ctr;
key_inf... | static void wpa_send_eapol(struct wpa_authenticator *wpa_auth,
struct wpa_state_machine *sm, int key_info,
const u8 *key_rsc, const u8 *nonce, const u8 *kde,
size_t kde_len, int keyidx, int encr) {
int timeout_ms;
int pairwise = key_in... | wpa_send_eapol | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void wpa_send_eapol_timeout(void *eloop_ctx, void *timeout_ctx) {
*((_DWORD *)timeout_ctx + 265) = 0;
wpa_auth_logger((wpa_authenticator *)eloop_ctx, (const u8 *)timeout_ctx + 16,
LOGGER_DEBUG, "EAPOL-Key timeout");
*((_BYTE *)timeout_ctx + 56) = 1;
wpa_sm_step((wpa_state_machine *)timeout_ctx... | static void wpa_send_eapol_timeout(void *eloop_ctx, void *timeout_ctx) {
struct wpa_authenticator *wpa_auth = eloop_ctx;
struct wpa_state_machine *sm = timeout_ctx;
sm->pending_1_of_4_timeout = 0;
wpa_auth_logger(wpa_auth, sm->addr, LOGGER_DEBUG, "EAPOL-Key timeout");
sm->TimeoutEvt = true;
wpa_sm_step(sm)... | wpa_send_eapol_timeout | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void wpa_set_wnmsleep(wpa_state_machine *sm, int flag) {
if (sm)
*((_BYTE *)sm + 681) = (4 * (flag != 0)) | *((_BYTE *)sm + 681) & 0xFB;
} | void wpa_set_wnmsleep(struct wpa_state_machine *sm, int flag) {
if (sm)
sm->is_wnmsleep = !!flag;
} | wpa_set_wnmsleep | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void wpa_sm_call_step(void *eloop_ctx, void *timeout_ctx) {
wpa_sm_step((wpa_state_machine *)eloop_ctx);
} | static void wpa_sm_call_step(void *eloop_ctx, void *timeout_ctx) {
struct wpa_state_machine *sm = eloop_ctx;
wpa_sm_step(sm);
} | wpa_sm_call_step | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int wpa_sm_step(wpa_state_machine *sm) {
if (!sm)
return 0;
if ((*((_BYTE *)sm + 680) & 2) != 0) {
wpa_printf(5, "WPA: wpa_sm_step() called recursively");
return 0;
} else {
*((_BYTE *)sm + 680) |= 2u;
while ((*((_BYTE *)sm + 680) & 4) == 0) {
*((_BYTE *)sm + 680) &= ~1u;
sm->wpa_a... | static int wpa_sm_step(struct wpa_state_machine *sm) {
if (!sm)
return 0;
if (sm->in_step_loop) {
wpa_printf(MSG_ERROR, "WPA: wpa_sm_step() called recursively");
return 0;
}
sm->in_step_loop = 1;
do {
if (sm->pending_deinit)
break;
sm->changed = false;
sm->wpa_auth->group->ch... | wpa_sm_step | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
u8 *wpa_sm_write_assoc_resp_ies(wpa_state_machine *sm, u8 *pos, size_t max_len,
int auth_alg, const u8 *req_ies,
size_t req_ies_len, int omit_rsnxe) {
u8 *v8;
u8 *v9;
_BOOL4 v10;
char v11;
u8 *v12;
size_t v13;
u8 *posa;
u8 *posb;
u8 *posc... | u8 *wpa_sm_write_assoc_resp_ies(struct wpa_state_machine *sm, u8 *pos,
size_t max_len, int auth_alg, const u8 *req_ies,
size_t req_ies_len, int omit_rsnxe) {
u8 *end, *mdie, *ftie, *rsnie = NULL, *r0kh_id, *subelem = NULL;
u8 *fte_mic, *elem_count;
s... | wpa_sm_write_assoc_resp_ies | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int wpa_snprintf_hex_sep(char *buf, size_t buf_size, const u8 *data, size_t len,
char sep) {
int ret;
size_t i;
char *pos;
char *end;
pos = buf;
end = &buf[buf_size];
if (!buf_size)
return 0;
for (i = 0; i < len; ++i) {
ret = snprintf(pos, end - pos, "%02x%c", data[i], ... | int wpa_snprintf_hex_sep(char *buf, size_t buf_size, const u8 *data, size_t len,
char sep) {
size_t i;
char *pos = buf, *end = buf + buf_size;
int ret;
if (buf_size == 0)
return 0;
for (i = 0; i < len; i++) {
ret = os_snprintf(pos, end - pos, "%02x%c", data[i], sep);
if ... | wpa_snprintf_hex_sep | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void wpa_sta_disconnect(wpa_authenticator *wpa_auth, const u8 *addr,
u16 reason) {
if (wpa_auth->cb->disconnect) {
wpa_printf(
2, "wpa_sta_disconnect STA %02x:%02x:%02x:%02x:%02x:%02x (reason %u)",
*addr, addr[1], addr[2], addr[3], addr[4], addr[5], reason);
wpa_auth->c... | static void wpa_sta_disconnect(struct wpa_authenticator *wpa_auth,
const u8 *addr, u16 reason) {
if (!wpa_auth->cb->disconnect)
return;
wpa_printf(MSG_DEBUG, "wpa_sta_disconnect STA " MACSTR " (reason %u)",
MAC2STR(addr), reason);
wpa_auth->cb->disconnect(wpa_auth->... | wpa_sta_disconnect | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void wpa_supplicant_event(void *ctx, wpa_event_type event,
wpa_event_data *data) {
const char *v3;
u16 fc;
int level;
level = 2;
if (event == wpa_event_type_EVENT_RX_MGMT && data->disassoc_info.addr &&
data->ft_ies.ies_len > 0x17) {
fc = *(_WORD *)data->disassoc_info.addr;... | void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
union wpa_event_data *data) {
struct hostapd_data *hapd = ctx;
#ifndef CONFIG_NO_STDOUT_DEBUG
int level = MSG_DEBUG;
if (event == EVENT_RX_MGMT && data->rx_mgmt.frame &&
data->rx_mgmt.frame_len >= 24) {
const stru... | wpa_supplicant_event | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void wpa_supplicant_event_global(void *ctx, wpa_event_type event,
wpa_event_data *data) {
unsigned int ifindex;
hostapd_data *hapd;
if (event == wpa_event_type_EVENT_INTERFACE_STATUS) {
hapd = hostapd_get_iface((hapd_interfaces *)ctx,
data->interf... | void wpa_supplicant_event_global(void *ctx, enum wpa_event_type event,
union wpa_event_data *data) {
struct hapd_interfaces *interfaces = ctx;
struct hostapd_data *hapd;
if (event != EVENT_INTERFACE_STATUS)
return;
hapd = hostapd_get_iface(interfaces, data->interface_statu... | wpa_supplicant_event_global | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int wpa_try_alt_snonce(wpa_state_machine *sm, u8 *data, size_t data_len) {
int vlan_id;
int ok;
size_t pmk_len;
const u8 *pmk;
wpa_ptk PTK;
unsigned long v10;
v10 = __readfsqword(0x28u);
ok = 0;
pmk = 0;
vlan_id = 0;
memset(&PTK, 0, sizeof(PTK));
do {
if (!wpa_key_mgmt_wpa_psk_0(sm->wpa_key... | static int wpa_try_alt_snonce(struct wpa_state_machine *sm, u8 *data,
size_t data_len) {
struct wpa_ptk PTK;
int ok = 0;
const u8 *pmk = NULL;
size_t pmk_len;
int vlan_id = 0;
os_memset(&PTK, 0, sizeof(PTK));
for (;;) {
if (wpa_key_mgmt_wpa_psk(sm->wpa_key_mgmt) &&
... | wpa_try_alt_snonce | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int wpa_use_aes_key_wrap(int akmp) {
return akmp == 0x8000 || akmp == 0x400000 || akmp == 0x800000 ||
wpa_key_mgmt_ft_4(akmp) || wpa_key_mgmt_sha256(akmp) ||
wpa_key_mgmt_sae_4(akmp) || wpa_key_mgmt_suite_b_1(akmp);
} | int wpa_use_aes_key_wrap(int akmp) {
return akmp == WPA_KEY_MGMT_OSEN || akmp == WPA_KEY_MGMT_OWE ||
akmp == WPA_KEY_MGMT_DPP || wpa_key_mgmt_ft(akmp) ||
wpa_key_mgmt_sha256(akmp) || wpa_key_mgmt_sae(akmp) ||
wpa_key_mgmt_suite_b(akmp);
} | wpa_use_aes_key_wrap | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int wpa_use_akm_defined(int akmp) {
return akmp == 0x8000 || akmp == 0x400000 || akmp == 0x800000 ||
akmp == 0x1000000 || wpa_key_mgmt_sae_4(akmp) ||
wpa_key_mgmt_suite_b_1(akmp) || wpa_key_mgmt_fils_2(akmp);
} | int wpa_use_akm_defined(int akmp) {
return akmp == WPA_KEY_MGMT_OSEN || akmp == WPA_KEY_MGMT_OWE ||
akmp == WPA_KEY_MGMT_DPP || akmp == WPA_KEY_MGMT_FT_IEEE8021X_SHA384 ||
wpa_key_mgmt_sae(akmp) || wpa_key_mgmt_suite_b(akmp) ||
wpa_key_mgmt_fils(akmp);
} | wpa_use_akm_defined | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int wpa_use_cmac(int akmp) {
return akmp == 0x8000 || akmp == 0x400000 || akmp == 0x800000 ||
wpa_key_mgmt_ft_4(akmp) || wpa_key_mgmt_sha256(akmp) ||
wpa_key_mgmt_sae_4(akmp) || wpa_key_mgmt_suite_b_1(akmp);
} | int wpa_use_cmac(int akmp) {
return akmp == WPA_KEY_MGMT_OSEN || akmp == WPA_KEY_MGMT_OWE ||
akmp == WPA_KEY_MGMT_DPP || wpa_key_mgmt_ft(akmp) ||
wpa_key_mgmt_sha256(akmp) || wpa_key_mgmt_sae(akmp) ||
wpa_key_mgmt_suite_b(akmp);
} | wpa_use_cmac | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int wpa_validate_osen(wpa_authenticator *wpa_auth, wpa_state_machine *sm,
const u8 *osen_ie, size_t osen_ie_len) {
if (!wpa_auth || !sm)
return -1;
sm->wpa_key_mgmt = 0x8000;
*((_BYTE *)sm + 680) |= 0x10u;
sm->pairwise = 16;
sm->wpa = WPA_VERSION_WPA2;
if (!sm->wpa_ie || osen_ie_le... | int wpa_validate_osen(struct wpa_authenticator *wpa_auth,
struct wpa_state_machine *sm, const u8 *osen_ie,
size_t osen_ie_len) {
if (wpa_auth == NULL || sm == NULL)
return -1;
sm->wpa_key_mgmt = WPA_KEY_MGMT_OSEN;
sm->mgmt_frame_prot = 1;
sm->pairwise = WPA_CIPHE... | wpa_validate_osen | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
wpa_validate_result wpa_validate_wpa_ie(wpa_authenticator *wpa_auth,
wpa_state_machine *sm, int freq,
const u8 *wpa_ie, size_t wpa_ie_len,
const u8 *rsnxe, size_t rsnxe_len,
... | enum wpa_validate_result wpa_validate_wpa_ie(
struct wpa_authenticator *wpa_auth, struct wpa_state_machine *sm, int freq,
const u8 *wpa_ie, size_t wpa_ie_len, const u8 *rsnxe, size_t rsnxe_len,
const u8 *mdie, size_t mdie_len, const u8 *owe_dh, size_t owe_dh_len) {
struct wpa_auth_config *conf = &wpa_auth... | wpa_validate_wpa_ie | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int wpa_verify_key_mic(int akmp, size_t pmk_len, wpa_ptk *PTK, u8 *data,
size_t data_len) {
char key_info;
int ret;
size_t mic_len;
u8 *mic_pos;
u8 mic[32];
unsigned long v14;
v14 = __readfsqword(0x28u);
ret = 0;
mic_len = wpa_mic_len(akmp, pmk_len);
if (data_len <= 0x50)
... | static int wpa_verify_key_mic(int akmp, size_t pmk_len, struct wpa_ptk *PTK,
u8 *data, size_t data_len) {
struct ieee802_1x_hdr *hdr;
struct wpa_eapol_key *key;
u16 key_info;
int ret = 0;
u8 mic[WPA_EAPOL_KEY_MIC_MAX_LEN], *mic_pos;
size_t mic_len = wpa_mic_len(akmp, pmk_len);
... | wpa_verify_key_mic | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int wpa_wnmsleep_bigtk_subelem(wpa_state_machine *sm, u8 *pos) {
wpa_group *gsm;
size_t len;
gsm = sm->group;
len = wpa_cipher_key_len(sm->wpa_auth->conf.group_mgmt_cipher);
*pos = 2;
pos[1] = len + 8;
WPA_PUT_LE16_0(pos + 2, gsm->GN_bigtk);
if (wpa_auth_get_seqnum(sm->wpa_auth, 0, gsm->GN_bigtk, pos +... | int wpa_wnmsleep_bigtk_subelem(struct wpa_state_machine *sm, u8 *pos) {
struct wpa_group *gsm = sm->group;
u8 *start = pos;
size_t len = wpa_cipher_key_len(sm->wpa_auth->conf.group_mgmt_cipher);
*pos++ = WNM_SLEEP_SUBELEM_BIGTK;
*pos++ = 2 + 6 + len;
WPA_PUT_LE16(pos, gsm->GN_bigtk);
pos += 2;
if (wpa_... | wpa_wnmsleep_bigtk_subelem | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int wpa_wnmsleep_gtk_subelem(wpa_state_machine *sm, u8 *pos) {
u8 *posa;
int posb;
wpa_auth_config *conf;
wpa_group *gsm;
conf = &sm->wpa_auth->conf;
gsm = sm->group;
*pos = 0;
pos[1] = gsm->GTK_len + 11;
WPA_PUT_LE16_0(pos + 2, gsm->GN & 3);
pos[4] = gsm->GTK_len;
if (wpa_auth_get_seqnum(sm->wpa... | int wpa_wnmsleep_gtk_subelem(struct wpa_state_machine *sm, u8 *pos) {
struct wpa_auth_config *conf = &sm->wpa_auth->conf;
struct wpa_group *gsm = sm->group;
u8 *start = pos;
*pos++ = WNM_SLEEP_SUBELEM_GTK;
*pos++ = 11 + gsm->GTK_len;
WPA_PUT_LE16(pos, gsm->GN & 0x03);
pos += 2;
*pos++ = gsm->GTK_len;
... | wpa_wnmsleep_gtk_subelem | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int wpa_wnmsleep_igtk_subelem(wpa_state_machine *sm, u8 *pos) {
wpa_auth_config *conf;
wpa_group *gsm;
size_t len;
conf = &sm->wpa_auth->conf;
gsm = sm->group;
len = wpa_cipher_key_len(sm->wpa_auth->conf.group_mgmt_cipher);
*pos = 1;
pos[1] = len + 8;
WPA_PUT_LE16_0(pos + 2, gsm->GN_igtk);
if (wpa_... | int wpa_wnmsleep_igtk_subelem(struct wpa_state_machine *sm, u8 *pos) {
struct wpa_auth_config *conf = &sm->wpa_auth->conf;
struct wpa_group *gsm = sm->group;
u8 *start = pos;
size_t len = wpa_cipher_key_len(sm->wpa_auth->conf.group_mgmt_cipher);
*pos++ = WNM_SLEEP_SUBELEM_IGTK;
*pos++ = 2 + 6 + len;
WPA_... | wpa_wnmsleep_igtk_subelem | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void wpa_wnmsleep_rekey_gtk(wpa_state_machine *sm) {
if (sm) {
if ((*((_BYTE *)sm + 681) & 4) == 0)
wpa_group_update_sta(sm, 0);
}
} | void wpa_wnmsleep_rekey_gtk(struct wpa_state_machine *sm) {
if (!sm || sm->is_wnmsleep)
return;
wpa_group_update_sta(sm, NULL);
} | wpa_wnmsleep_rekey_gtk | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.