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 dump_ifidx(wpa_driver_nl80211_data *drv) {
int i;
int res;
char *pos;
char buf[200];
unsigned long v5;
v5 = __readfsqword(0x28u);
pos = buf;
for (i = 0; i < drv->num_if_indices; ++i) {
if (drv->if_indices[i].ifindex) {
res = snprintf(pos, (char *)&v5 - pos, " %d(%d)",
... | static void dump_ifidx(struct wpa_driver_nl80211_data *drv) {
char buf[200], *pos, *end;
int i, res;
pos = buf;
end = pos + sizeof(buf);
for (i = 0; i < drv->num_if_indices; i++) {
if (!drv->if_indices[i].ifindex)
continue;
res = os_snprintf(pos, end - pos, " %d(%d)", drv->if_indices[i].ifinde... | dump_ifidx | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void dyn_iface_get(hostapd_data *hapd, const char *ifname, int clean) {
dynamic_iface *next;
dynamic_iface *nexta;
dynamic_iface **dynamic_ifaces;
dynamic_ifaces = &hapd->iface->interfaces->vlan_priv;
for (next = *dynamic_ifaces; next && strcmp(ifname, next->ifname);
next = next->next)
;
if (nex... | static void dyn_iface_get(struct hostapd_data *hapd, const char *ifname,
int clean) {
struct dynamic_iface *next, **dynamic_ifaces;
struct hapd_interfaces *interfaces;
interfaces = hapd->iface->interfaces;
dynamic_ifaces = &interfaces->vlan_priv;
for (next = *dynamic_ifaces; next; ... | dyn_iface_get | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int dyn_iface_put(hostapd_data *hapd, const char *ifname) {
int clean;
dynamic_iface *next;
dynamic_iface *prev;
dynamic_iface **dynamic_ifaces;
prev = 0;
dynamic_ifaces = &hapd->iface->interfaces->vlan_priv;
for (next = *dynamic_ifaces; next && strcmp(ifname, next->ifname);
next = next->next)
... | static int dyn_iface_put(struct hostapd_data *hapd, const char *ifname) {
struct dynamic_iface *next, *prev = NULL, **dynamic_ifaces;
struct hapd_interfaces *interfaces;
int clean;
interfaces = hapd->iface->interfaces;
dynamic_ifaces = &interfaces->vlan_priv;
for (next = *dynamic_ifaces; next; next = next... | dyn_iface_put | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_aka_add_checkcode(eap_aka_data *data, eap_sim_msg *msg) {
size_t v2;
const u8 *addr;
size_t len;
u8 hash[40];
unsigned long v6;
v6 = __readfsqword(0x28u);
wpa_printf(2, " AT_CHECKCODE");
if (data->id_msgs) {
addr = (const u8 *)wpabuf_head_25(data->id_msgs);
len = wpabuf_len_26(data->... | static void eap_aka_add_checkcode(struct eap_aka_data *data,
struct eap_sim_msg *msg) {
const u8 *addr;
size_t len;
u8 hash[SHA256_MAC_LEN];
wpa_printf(MSG_DEBUG, " AT_CHECKCODE");
if (data->id_msgs == NULL) {
eap_sim_msg_add(msg, EAP_SIM_AT_CHECKCODE, 0, NULL, 0);
... | eap_aka_add_checkcode | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int eap_aka_add_id_msg(eap_aka_data *data, const wpabuf *msg) {
size_t v3;
if (!msg)
return -1;
if (data->id_msgs) {
v3 = wpabuf_len_26(msg);
if (wpabuf_resize(&data->id_msgs, v3) >= 0) {
wpabuf_put_buf_4(data->id_msgs, msg);
return 0;
} else {
return -1;
}
} else {
da... | static int eap_aka_add_id_msg(struct eap_aka_data *data,
const struct wpabuf *msg) {
if (msg == NULL)
return -1;
if (data->id_msgs == NULL) {
data->id_msgs = wpabuf_dup(msg);
return data->id_msgs == NULL ? -1 : 0;
}
if (wpabuf_resize(&data->id_msgs, wpabuf_len(msg)) <... | eap_aka_add_id_msg | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
wpabuf *eap_aka_buildReq(eap_sm *sm, void *priv, u8 id) {
unsigned int v3;
*((_DWORD *)priv + 98) = 0;
v3 = *((_DWORD *)priv + 88);
if (v3 == 3)
return eap_aka_build_notification(sm, (eap_aka_data *)priv, id);
if (v3 > 3) {
wpa_printf(2, "EAP-AKA: Unknown state %d in buildReq",
*((_DWO... | static struct wpabuf *eap_aka_buildReq(struct eap_sm *sm, void *priv, u8 id) {
struct eap_aka_data *data = priv;
data->auts_reported = 0;
switch (data->state) {
case IDENTITY:
return eap_aka_build_identity(sm, data, id);
case CHALLENGE:
return eap_aka_build_challenge(sm, data, id);
case REAUTH:
... | eap_aka_buildReq | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
wpabuf *eap_aka_build_challenge(eap_sm *sm, eap_aka_data *data, u8 id) {
u16 flags;
int i;
int aka_prime_preferred;
eap_sim_msg *msg;
wpa_printf(2, "EAP-AKA: Generating Challenge");
msg = eap_sim_msg_init(1, id, data->eap_method, 1);
wpa_printf(2, " AT_RAND");
eap_sim_msg_add(msg, 1u, 0, data->rand, ... | static struct wpabuf *
eap_aka_build_challenge(struct eap_sm *sm, struct eap_aka_data *data, u8 id) {
struct eap_sim_msg *msg;
wpa_printf(MSG_DEBUG, "EAP-AKA: Generating Challenge");
msg = eap_sim_msg_init(EAP_CODE_REQUEST, id, data->eap_method,
EAP_AKA_SUBTYPE_CHALLENGE);
wpa_printf(M... | eap_aka_build_challenge | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int eap_aka_build_encr(eap_sm *sm, eap_aka_data *data, eap_sim_msg *msg,
u16 counter, const u8 *nonce_s) {
eap_sim_db_method v5;
eap_sim_db_method v6;
size_t v8;
char *next_pseudonym;
u16 v10;
size_t v11;
char *next_reauth_id;
u16 v13;
free(data->next_pseudonym);
if ((sm->cfg... | static int eap_aka_build_encr(struct eap_sm *sm, struct eap_aka_data *data,
struct eap_sim_msg *msg, u16 counter,
const u8 *nonce_s) {
os_free(data->next_pseudonym);
if (!(sm->cfg->eap_sim_id & 0x01)) {
data->next_pseudonym = NULL;
} else if (!nonce... | eap_aka_build_encr | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
wpabuf *eap_aka_build_identity(eap_sm *sm, eap_aka_data *data, u8 id) {
eap_sim_msg *msg;
wpabuf *buf;
wpa_printf(2, "EAP-AKA: Generating Identity");
msg = eap_sim_msg_init(1, id, data->eap_method, 5);
if (++data->identity_round == 1) {
wpa_printf(2, " AT_ANY_ID_REQ");
eap_sim_msg_add(msg, 0xDu, 0,... | static struct wpabuf *eap_aka_build_identity(struct eap_sm *sm,
struct eap_aka_data *data, u8 id) {
struct eap_sim_msg *msg;
struct wpabuf *buf;
wpa_printf(MSG_DEBUG, "EAP-AKA: Generating Identity");
msg = eap_sim_msg_init(EAP_CODE_REQUEST, id, data->eap_method,
... | eap_aka_build_identity | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
wpabuf *eap_aka_build_notification(eap_sm *sm, eap_aka_data *data, u8 id) {
eap_sim_msg *msg;
wpa_printf(2, "EAP-AKA: Generating Notification");
msg = eap_sim_msg_init(1, id, data->eap_method, 12);
wpa_printf(2, " AT_NOTIFICATION (%d)", data->notification);
eap_sim_msg_add(msg, 0xCu, data->notification, 0,... | static struct wpabuf *eap_aka_build_notification(struct eap_sm *sm,
struct eap_aka_data *data,
u8 id) {
struct eap_sim_msg *msg;
wpa_printf(MSG_DEBUG, "EAP-AKA: Generating Notification");
msg = eap_sim_msg_init(EAP_... | eap_aka_build_notification | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
wpabuf *eap_aka_build_reauth(eap_sm *sm, eap_aka_data *data, u8 id) {
const u8 *v4;
const u8 *v5;
long v6;
eap_sim_msg *msg;
wpabuf *buf;
wpa_printf(2, "EAP-AKA: Generating Re-authentication");
if (random_get_bytes(data->nonce_s, 0x10u))
return 0;
wpa_hexdump_key(1, "EAP-AKA: NONCE_S", data->nonce_... | static struct wpabuf *eap_aka_build_reauth(struct eap_sm *sm,
struct eap_aka_data *data, u8 id) {
struct eap_sim_msg *msg;
struct wpabuf *buf;
wpa_printf(MSG_DEBUG, "EAP-AKA: Generating Re-authentication");
if (random_get_bytes(data->nonce_s, EAP_SIM_NONCE_S_LEN))
... | eap_aka_build_reauth | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
bool eap_aka_check(eap_sm *sm, void *priv, wpabuf *respData) {
size_t len;
eap_aka_data *data;
const u8 *pos;
unsigned long v7;
v7 = __readfsqword(0x28u);
data = (eap_aka_data *)priv;
pos = eap_hdr_validate(0, (eap_type) * ((unsigned char *)priv + 420),
respData, &len);
if (pos... | static bool eap_aka_check(struct eap_sm *sm, void *priv,
struct wpabuf *respData) {
struct eap_aka_data *data = priv;
const u8 *pos;
size_t len;
pos = eap_hdr_validate(EAP_VENDOR_IETF, data->eap_method, respData, &len);
if (pos == NULL || len < 3) {
wpa_printf(MSG_INFO, "EAP-AKA... | eap_aka_check | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_aka_check_identity(eap_sm *sm, eap_aka_data *data) {
char *username;
const char *permanent;
username = sim_get_username(sm->identity, sm->identity_len);
if (username) {
if (eap_aka_check_identity_reauth(sm, data, username) <= 0 &&
(data->eap_method == 50 && *username == 55 ||
data... | static void eap_aka_check_identity(struct eap_sm *sm,
struct eap_aka_data *data) {
char *username;
username = sim_get_username(sm->identity, sm->identity_len);
if (username == NULL)
return;
if (eap_aka_check_identity_reauth(sm, data, username) > 0) {
os_free(username... | eap_aka_check_identity | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int eap_aka_check_identity_reauth(eap_sm *sm, eap_aka_data *data,
const char *username) {
long v4;
if (data->eap_method == 50 && *username != 56)
return 0;
if (data->eap_method == 23 && *username != 52)
return 0;
wpa_printf(2, "EAP-AKA: Reauth username '%s'", username)... | static int eap_aka_check_identity_reauth(struct eap_sm *sm,
struct eap_aka_data *data,
const char *username) {
if (data->eap_method == EAP_TYPE_AKA_PRIME &&
username[0] != EAP_AKA_PRIME_REAUTH_ID_PREFIX)
return 0;
if (data->... | eap_aka_check_identity_reauth | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_aka_derive_mk(const u8 *identity, size_t identity_len, const u8 *ik,
const u8 *ck, u8 *mk) {
const u8 *addr[3];
size_t len[3];
unsigned long v10;
v10 = __readfsqword(0x28u);
addr[0] = identity;
len[0] = identity_len;
addr[1] = ik;
len[1] = 16;
addr[2] = ck;
len[2] = ... | void eap_aka_derive_mk(const u8 *identity, size_t identity_len, const u8 *ik,
const u8 *ck, u8 *mk) {
const u8 *addr[3];
size_t len[3];
addr[0] = identity;
len[0] = identity_len;
addr[1] = ik;
len[1] = EAP_AKA_IK_LEN;
addr[2] = ck;
len[2] = EAP_AKA_CK_LEN;
sha1_vector(3, addr,... | eap_aka_derive_mk | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_aka_determine_identity(eap_sm *sm, eap_aka_data *data) {
char *username;
const char *permanent;
wpa_hexdump_ascii(2, "EAP-AKA: Identity", sm->identity, sm->identity_len);
username = sim_get_username(sm->identity, sm->identity_len);
if (!username) {
data->notification = 0x4000;
eap_aka_state(... | static void eap_aka_determine_identity(struct eap_sm *sm,
struct eap_aka_data *data) {
char *username;
wpa_hexdump_ascii(MSG_DEBUG, "EAP-AKA: Identity", sm->identity,
sm->identity_len);
username = sim_get_username(sm->identity, sm->identity_len);
if (... | eap_aka_determine_identity | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_aka_fullauth(eap_sm *sm, eap_aka_data *data) {
int res;
size_t identity_len;
res = eap_sim_db_get_aka_auth(
(eap_sim_db_data *)sm->cfg->eap_sim_db_priv, data->permanent, data->rand,
data->autn, data->ik, data->ck, data->res, &data->res_len, sm);
if (res == -2) {
wpa_printf(
2,
... | static void eap_aka_fullauth(struct eap_sm *sm, struct eap_aka_data *data) {
size_t identity_len;
int res;
res = eap_sim_db_get_aka_auth(sm->cfg->eap_sim_db_priv, data->permanent,
data->rand, data->autn, data->ik, data->ck,
data->res, &data->res_len... | eap_aka_fullauth | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
u8 *eap_aka_getKey(eap_sm *sm, void *priv, size_t *len) {
u8 *key;
if (*((_DWORD *)priv + 88) != 4)
return 0;
key = (u8 *)os_memdup((char *)priv + 116, 0x40u);
if (!key)
return 0;
*len = 64;
return key;
} | static u8 *eap_aka_getKey(struct eap_sm *sm, void *priv, size_t *len) {
struct eap_aka_data *data = priv;
u8 *key;
if (data->state != SUCCESS)
return NULL;
key = os_memdup(data->msk, EAP_SIM_KEYING_DATA_LEN);
if (key == NULL)
return NULL;
*len = EAP_SIM_KEYING_DATA_LEN;
return key;
} | eap_aka_getKey | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
u8 *eap_aka_get_emsk(eap_sm *sm, void *priv, size_t *len) {
u8 *key;
if (*((_DWORD *)priv + 88) != 4)
return 0;
key = (u8 *)os_memdup((char *)priv + 180, 0x40u);
if (!key)
return 0;
*len = 64;
return key;
} | static u8 *eap_aka_get_emsk(struct eap_sm *sm, void *priv, size_t *len) {
struct eap_aka_data *data = priv;
u8 *key;
if (data->state != SUCCESS)
return NULL;
key = os_memdup(data->emsk, EAP_EMSK_LEN);
if (key == NULL)
return NULL;
*len = EAP_EMSK_LEN;
return key;
} | eap_aka_get_emsk | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
u8 *eap_aka_get_session_id(eap_sm *sm, void *priv, size_t *len) {
long v4;
u8 *v5;
long v6;
long v7;
long v8;
u8 *id;
if (*((_DWORD *)priv + 88) != 4)
return 0;
*len = 33;
id = (u8 *)malloc(*len);
if (!id)
return 0;
*id = *((_BYTE *)priv + 420);
if (*((_QWORD *)priv + 48)) {
v8 = *(... | static u8 *eap_aka_get_session_id(struct eap_sm *sm, void *priv, size_t *len) {
struct eap_aka_data *data = priv;
u8 *id;
if (data->state != SUCCESS)
return NULL;
if (!data->reauth)
*len = 1 + EAP_AKA_RAND_LEN + EAP_AKA_AUTN_LEN;
else
*len = 1 + EAP_SIM_NONCE_S_LEN + EAP_SIM_MAC_LEN;
id = os_m... | eap_aka_get_session_id | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void *eap_aka_init(eap_sm *sm) {
eap_aka_data *data;
if (sm->cfg->eap_sim_db_priv) {
data = (eap_aka_data *)os_zalloc(0x1D8u);
if (data) {
data->eap_method = 23;
data->state = IDENTITY;
data->pending_id = -1;
eap_aka_check_identity(sm, data);
return data;
} else {
re... | static void *eap_aka_init(struct eap_sm *sm) {
struct eap_aka_data *data;
if (!sm->cfg->eap_sim_db_priv) {
wpa_printf(MSG_WARNING, "EAP-AKA: eap_sim_db not configured");
return NULL;
}
data = os_zalloc(sizeof(*data));
if (data == NULL)
return NULL;
data->eap_method = EAP_TYPE_AKA;
data->st... | eap_aka_init | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
bool eap_aka_isDone(eap_sm *sm, void *priv) {
return *((_DWORD *)priv + 88) == 4 || *((_DWORD *)priv + 88) == 5;
} | static bool eap_aka_isDone(struct eap_sm *sm, void *priv) {
struct eap_aka_data *data = priv;
return data->state == SUCCESS || data->state == FAILURE;
} | eap_aka_isDone | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
bool eap_aka_isSuccess(eap_sm *sm, void *priv) {
return *((_DWORD *)priv + 88) == 4;
} | static bool eap_aka_isSuccess(struct eap_sm *sm, void *priv) {
struct eap_aka_data *data = priv;
return data->state == SUCCESS;
} | eap_aka_isSuccess | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_aka_prime_derive_ck_ik_prime(u8 *ck, u8 *ik, const u8 *sqn_ak,
const u8 *network_name,
size_t network_name_len) {
long v5;
long v6;
long v7;
long v8;
u8 fc;
const u8 *addr[5];
size_t len[5];
u8 l0[2];
u8 l1[2];
u8 k... | void eap_aka_prime_derive_ck_ik_prime(u8 *ck, u8 *ik, const u8 *sqn_ak,
const u8 *network_name,
size_t network_name_len) {
u8 key[EAP_AKA_CK_LEN + EAP_AKA_IK_LEN];
u8 hash[SHA256_MAC_LEN];
const u8 *addr[5];
size_t len[5];
u8 fc;
u8... | eap_aka_prime_derive_ck_ik_prime | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_aka_prime_derive_keys(const u8 *identity, size_t identity_len,
const u8 *ik, const u8 *ck, u8 *k_encr,
u8 *k_aut, u8 *k_re, u8 *msk, u8 *emsk) {
long v10;
long v11;
long v12;
u8 key[32];
u8 keys[208];
unsigned long v17;
v17 = __readfs... | void eap_aka_prime_derive_keys(const u8 *identity, size_t identity_len,
const u8 *ik, const u8 *ck, u8 *k_encr,
u8 *k_aut, u8 *k_re, u8 *msk, u8 *emsk) {
u8 key[EAP_AKA_IK_LEN + EAP_AKA_CK_LEN];
u8 keys[EAP_SIM_K_ENCR_LEN + EAP_AKA_PRIME_K_AUT_LEN +
... | eap_aka_prime_derive_keys | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int eap_aka_prime_derive_keys_reauth(const u8 *k_re, u16 counter,
const u8 *identity, size_t identity_len,
const u8 *nonce_s, u8 *msk, u8 *emsk) {
long v7;
u8 seed3[32];
u8 keys[136];
unsigned long v15;
v15 = __readfsqword(0x28u);
WP... | int eap_aka_prime_derive_keys_reauth(const u8 *k_re, u16 counter,
const u8 *identity, size_t identity_len,
const u8 *nonce_s, u8 *msk, u8 *emsk) {
u8 seed3[2 + EAP_SIM_NONCE_S_LEN];
u8 keys[EAP_MSK_LEN + EAP_EMSK_LEN];
u8 *pos;
WPA_PUT_B... | eap_aka_prime_derive_keys_reauth | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void *eap_aka_prime_init(eap_sm *sm) {
eap_aka_data *data;
if (sm->cfg->eap_sim_db_priv) {
data = (eap_aka_data *)os_zalloc(0x1D8u);
if (data) {
data->eap_method = 50;
data->network_name = (u8 *)strdup("WLAN");
if (data->network_name) {
data->network_name_len = strlen("WLAN");
... | static void *eap_aka_prime_init(struct eap_sm *sm) {
struct eap_aka_data *data;
char *network_name = "WLAN";
if (sm->cfg->eap_sim_db_priv == NULL) {
wpa_printf(MSG_WARNING, "EAP-AKA: eap_sim_db not configured");
return NULL;
}
data = os_zalloc(sizeof(*data));
if (data == NULL)
return NULL;
... | eap_aka_prime_init | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_aka_process(eap_sm *sm, void *priv, wpabuf *respData) {
int v3;
eap_aka_data_$2BB236550D26BEF1D49C6F699AA0D2A4 state;
u8 subtype;
size_t len;
eap_aka_data *data;
const u8 *pos;
const u8 *end;
eap_sim_attrs attr;
unsigned long v12;
v12 = __readfsqword(0x28u);
data = (eap_aka_data *)priv;
... | static void eap_aka_process(struct eap_sm *sm, void *priv,
struct wpabuf *respData) {
struct eap_aka_data *data = priv;
const u8 *pos, *end;
u8 subtype;
size_t len;
struct eap_sim_attrs attr;
pos = eap_hdr_validate(EAP_VENDOR_IETF, data->eap_method, respData, &len);
if (pos ==... | eap_aka_process | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_aka_process_authentication_reject(eap_sm *sm, eap_aka_data *data,
wpabuf *respData,
eap_sim_attrs *attr) {
wpa_printf(2, "EAP-AKA: Client rejected authentication");
eap_aka_state(data, 5);
} | static void eap_aka_process_authentication_reject(struct eap_sm *sm,
struct eap_aka_data *data,
struct wpabuf *respData,
struct eap_sim_attrs *attr) {
wpa_printf(MSG_DE... | eap_aka_process_authentication_reject | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_aka_process_challenge(eap_sm *sm, eap_aka_data *data, wpabuf *respData,
eap_sim_attrs *attr) {
wpa_printf(2, "EAP-AKA: Processing Challenge");
if (attr->checkcode &&
eap_aka_verify_checkcode(data, attr->checkcode, attr->checkcode_len)) {
wpa_printf(4, "EAP-AKA: Inva... | static void eap_aka_process_challenge(struct eap_sm *sm,
struct eap_aka_data *data,
struct wpabuf *respData,
struct eap_sim_attrs *attr) {
wpa_printf(MSG_DEBUG, "EAP-AKA: Processing Challenge");
#ifdef E... | eap_aka_process_challenge | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_aka_process_client_error(eap_sm *sm, eap_aka_data *data,
wpabuf *respData, eap_sim_attrs *attr) {
wpa_printf(2, "EAP-AKA: Client reported error %d", attr->client_error_code);
if (data->notification == 0x8000 && data->use_result_ind)
eap_aka_state(data, 4);
else
e... | static void eap_aka_process_client_error(struct eap_sm *sm,
struct eap_aka_data *data,
struct wpabuf *respData,
struct eap_sim_attrs *attr) {
wpa_printf(MSG_DEBUG, "EAP-AKA: Client reported error... | eap_aka_process_client_error | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_aka_process_identity(eap_sm *sm, eap_aka_data *data, wpabuf *respData,
eap_sim_attrs *attr) {
u8 *new_identity;
wpa_printf(2, "EAP-AKA: Processing Identity");
if (*(_OWORD *)&attr->mac == 0 && !attr->encr_data) {
if (attr->identity && attr->identity_len) {
new_ide... | static void eap_aka_process_identity(struct eap_sm *sm,
struct eap_aka_data *data,
struct wpabuf *respData,
struct eap_sim_attrs *attr) {
u8 *new_identity;
wpa_printf(MSG_DEBUG, "EAP-AKA: Processing Ident... | eap_aka_process_identity | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_aka_process_notification(eap_sm *sm, eap_aka_data *data,
wpabuf *respData, eap_sim_attrs *attr) {
wpa_printf(2, "EAP-AKA: Client replied to notification");
if (data->notification == 0x8000 && data->use_result_ind)
eap_aka_state(data, 4);
else
eap_aka_state(data, ... | static void eap_aka_process_notification(struct eap_sm *sm,
struct eap_aka_data *data,
struct wpabuf *respData,
struct eap_sim_attrs *attr) {
wpa_printf(MSG_DEBUG, "EAP-AKA: Client replied to not... | eap_aka_process_notification | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_aka_process_reauth(eap_sm *sm, eap_aka_data *data, wpabuf *respData,
eap_sim_attrs *attr) {
u8 *decrypted;
eap_sim_attrs eattr;
unsigned long v8;
v8 = __readfsqword(0x28u);
decrypted = 0;
wpa_printf(2, "EAP-AKA: Processing Reauthentication");
if (!attr->mac ||
e... | static void eap_aka_process_reauth(struct eap_sm *sm, struct eap_aka_data *data,
struct wpabuf *respData,
struct eap_sim_attrs *attr) {
struct eap_sim_attrs eattr;
u8 *decrypted = NULL;
wpa_printf(MSG_DEBUG, "EAP-AKA: Processing Reauthenticati... | eap_aka_process_reauth | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_aka_process_sync_failure(eap_sm *sm, eap_aka_data *data,
wpabuf *respData, eap_sim_attrs *attr) {
wpa_printf(2, "EAP-AKA: Processing Synchronization-Failure");
if (attr->auts) {
if (data->auts_reported ||
!eap_sim_db_resynchronize((eap_sim_db_data *)sm->cfg->ea... | static void eap_aka_process_sync_failure(struct eap_sm *sm,
struct eap_aka_data *data,
struct wpabuf *respData,
struct eap_sim_attrs *attr) {
wpa_printf(MSG_DEBUG, "EAP-AKA: Processing Synchroniz... | eap_aka_process_sync_failure | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_aka_reset(eap_sm *sm, void *priv) {
free(*((void **)priv + 45));
free(*((void **)priv + 46));
wpabuf_free(*((wpabuf **)priv + 51));
free(*((void **)priv + 53));
bin_clear_free(priv, 0x1D8u);
} | static void eap_aka_reset(struct eap_sm *sm, void *priv) {
struct eap_aka_data *data = priv;
os_free(data->next_pseudonym);
os_free(data->next_reauth_id);
wpabuf_free(data->id_msgs);
os_free(data->network_name);
bin_clear_free(data, sizeof(*data));
} | eap_aka_reset | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_aka_state(eap_aka_data *data, int state) {
const char *v2;
const char *v3;
v2 = eap_aka_state_txt(state);
v3 = eap_aka_state_txt(data->state);
wpa_printf(2, "EAP-AKA: %s -> %s", v3, v2);
data->state = state;
} | static void eap_aka_state(struct eap_aka_data *data, int state) {
wpa_printf(MSG_DEBUG, "EAP-AKA: %s -> %s", eap_aka_state_txt(data->state),
eap_aka_state_txt(state));
data->state = state;
} | eap_aka_state | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
const char *eap_aka_state_txt(int state) {
const char *result;
switch (state) {
case 0:
result = "IDENTITY";
break;
case 1:
result = "CHALLENGE";
break;
case 2:
result = "REAUTH";
break;
case 3:
result = "NOTIFICATION";
break;
case 4:
result = "SUCCESS";
break;
c... | static const char *eap_aka_state_txt(int state) {
switch (state) {
case IDENTITY:
return "IDENTITY";
case CHALLENGE:
return "CHALLENGE";
case REAUTH:
return "REAUTH";
case SUCCESS:
return "SUCCESS";
case FAILURE:
return "FAILURE";
case NOTIFICATION:
return "NOTIFICATION";
default... | eap_aka_state_txt | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
bool eap_aka_subtype_ok(eap_aka_data *data, u8 subtype) {
eap_aka_data_$2BB236550D26BEF1D49C6F699AA0D2A4 state;
if (subtype == 14 || subtype == 2)
return 0;
state = data->state;
if (state == 3) {
if (subtype != 12) {
LABEL_16:
wpa_printf(3, "EAP-AKA: Unexpected response subtype %d", subtype);... | static bool eap_aka_subtype_ok(struct eap_aka_data *data, u8 subtype) {
if (subtype == EAP_AKA_SUBTYPE_CLIENT_ERROR ||
subtype == EAP_AKA_SUBTYPE_AUTHENTICATION_REJECT)
return false;
switch (data->state) {
case IDENTITY:
if (subtype != EAP_AKA_SUBTYPE_IDENTITY) {
wpa_printf(MSG_INFO,
... | eap_aka_subtype_ok | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int eap_aka_verify_checkcode(eap_aka_data *data, const u8 *checkcode,
size_t checkcode_len) {
size_t v4;
const u8 *addr;
size_t len;
size_t hash_len;
u8 hash[40];
unsigned long v9;
v9 = __readfsqword(0x28u);
if (!checkcode)
return -1;
if (data->id_msgs) {
if (data... | static int eap_aka_verify_checkcode(struct eap_aka_data *data,
const u8 *checkcode, size_t checkcode_len) {
const u8 *addr;
size_t len;
u8 hash[SHA256_MAC_LEN];
size_t hash_len;
if (checkcode == NULL)
return -1;
if (data->id_msgs == NULL) {
if (checkcode_len != ... | eap_aka_verify_checkcode | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int eap_aka_verify_mac(eap_aka_data *data, const wpabuf *req, const u8 *mac,
const u8 *extra, size_t extra_len) {
if (data->eap_method == 50)
return eap_sim_verify_mac_sha256(data->k_aut, req, mac, extra, extra_len);
else
return eap_sim_verify_mac(data->k_aut, req, mac, extra, extra_l... | static int eap_aka_verify_mac(struct eap_aka_data *data,
const struct wpabuf *req, const u8 *mac,
const u8 *extra, size_t extra_len) {
if (data->eap_method == EAP_TYPE_AKA_PRIME)
return eap_sim_verify_mac_sha256(data->k_aut, req, mac, extra, extra_len);
... | eap_aka_verify_mac | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
const char *eap_code_str(u8 code) {
const char *result;
switch (code) {
case 1u:
result = "request";
break;
case 2u:
result = "response";
break;
case 3u:
result = "success";
break;
case 4u:
result = "failure";
break;
case 5u:
result = "initiate";
break;
case 6u:
... | static const char *eap_code_str(u8 code) {
switch (code) {
case EAP_CODE_REQUEST:
return "request";
case EAP_CODE_RESPONSE:
return "response";
case EAP_CODE_SUCCESS:
return "success";
case EAP_CODE_FAILURE:
return "failure";
case EAP_CODE_INITIATE:
return "initiate";
case EAP_CODE_FINI... | eap_code_str | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int eap_copy_buf(wpabuf **dst, const wpabuf *src) {
if (!src)
return -1;
wpabuf_free(*dst);
*dst = wpabuf_dup(src);
if (*dst)
return 0;
else
return -1;
} | static int eap_copy_buf(struct wpabuf **dst, const struct wpabuf *src) {
if (src == NULL)
return -1;
wpabuf_free(*dst);
*dst = wpabuf_dup(src);
return *dst ? 0 : -1;
} | eap_copy_buf | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int eap_copy_data(u8 **dst, size_t *dst_len, const u8 *src, size_t src_len) {
if (!src)
return -1;
free(*dst);
*dst = (u8 *)malloc(src_len);
if (*dst) {
memcpy(*dst, src, src_len);
*dst_len = src_len;
return 0;
} else {
*dst_len = 0;
return -1;
}
} | static int eap_copy_data(u8 **dst, size_t *dst_len, const u8 *src,
size_t src_len) {
if (src == NULL)
return -1;
os_free(*dst);
*dst = os_malloc(src_len);
if (*dst) {
os_memcpy(*dst, src, src_len);
*dst_len = src_len;
return 0;
} else {
*dst_len = 0;
return -1... | eap_copy_data | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int eap_eke_auth(eap_eke_session *sess, const char *label, const wpabuf *msgs,
u8 *auth) {
size_t v4;
const u8 *v5;
size_t v6;
wpa_printf(2, "EAP-EKE: Auth(%s)", label);
wpa_hexdump_key(2, "EAP-EKE: Ka for Auth", sess->ka, sess->auth_len);
wpa_hexdump_buf_3(1, "EAP-EKE: Messages for Auth",... | int eap_eke_auth(struct eap_eke_session *sess, const char *label,
const struct wpabuf *msgs, u8 *auth) {
wpa_printf(MSG_DEBUG, "EAP-EKE: Auth(%s)", label);
wpa_hexdump_key(MSG_DEBUG, "EAP-EKE: Ka for Auth", sess->ka, sess->auth_len);
wpa_hexdump_buf(MSG_MSGDUMP, "EAP-EKE: Messages for Auth", msgs... | eap_eke_auth | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int eap_eke_auth_len(u8 prf) {
if (prf == 1)
return 20;
if (prf == 2)
return 32;
return -1;
} | static int eap_eke_auth_len(u8 prf) {
switch (prf) {
case EAP_EKE_PRF_HMAC_SHA1:
return SHA1_MAC_LEN;
case EAP_EKE_PRF_HMAC_SHA2_256:
return SHA256_MAC_LEN;
}
return -1;
} | eap_eke_auth_len | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
wpabuf *eap_eke_buildReq(eap_sm *sm, void *priv, u8 id) {
unsigned int v3;
v3 = *(_DWORD *)priv;
if (*(_DWORD *)priv == 3)
return eap_eke_build_failure((eap_eke_data *)priv, id);
if (v3 > 3)
goto LABEL_10;
if (v3 == 2)
return eap_eke_build_confirm(sm, (eap_eke_data *)priv, id);
if (v3 > 2) {
... | static struct wpabuf *eap_eke_buildReq(struct eap_sm *sm, void *priv, u8 id) {
struct eap_eke_data *data = priv;
switch (data->state) {
case IDENTITY:
return eap_eke_build_identity(sm, data, id);
case COMMIT:
return eap_eke_build_commit(sm, data, id);
case CONFIRM:
return eap_eke_build_confirm(sm... | eap_eke_buildReq | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
wpabuf *eap_eke_build_commit(eap_sm *sm, eap_eke_data *data, u8 id) {
u8 *v4;
size_t v5;
wpabuf *msg;
u8 pub[520];
unsigned long v9;
v9 = __readfsqword(0x28u);
wpa_printf(2, "EAP-EKE: Request/Commit");
if (sm->user && sm->user->password) {
if (eap_eke_derive_key(&data->sess, sm->user->password,
... | static struct wpabuf *eap_eke_build_commit(struct eap_sm *sm,
struct eap_eke_data *data, u8 id) {
struct wpabuf *msg;
u8 pub[EAP_EKE_MAX_DH_LEN];
wpa_printf(MSG_DEBUG, "EAP-EKE: Request/Commit");
if (sm->user == NULL || sm->user->password == NULL) {
wpa_printf(MS... | eap_eke_build_commit | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
wpabuf *eap_eke_build_confirm(eap_sm *sm, eap_eke_data *data, u8 id) {
u8 *v4;
size_t prot_len;
size_t plen;
wpabuf *msg;
u8 *auth;
u8 nonces[40];
unsigned long v11;
v11 = __readfsqword(0x28u);
wpa_printf(2, "EAP-EKE: Request/Confirm");
plen = data->sess.pnonce_ps_len + data->sess.prf_len;
msg = ... | static struct wpabuf *eap_eke_build_confirm(struct eap_sm *sm,
struct eap_eke_data *data, u8 id) {
struct wpabuf *msg;
size_t plen, prot_len;
u8 nonces[2 * EAP_EKE_MAX_NONCE_LEN];
u8 *auth;
wpa_printf(MSG_DEBUG, "EAP-EKE: Request/Confirm");
plen = data->sess.pno... | eap_eke_build_confirm | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
wpabuf *eap_eke_build_failure(eap_eke_data *data, u8 id) {
wpabuf *msg;
wpa_printf(2, "EAP-EKE: Request/Failure: Failure-Code=0x%x",
data->failure_code);
msg = eap_eke_build_msg(data, id, 4u, 4u);
if (msg) {
wpabuf_put_be32_0(msg, data->failure_code);
return msg;
} else {
eap_eke_sta... | static struct wpabuf *eap_eke_build_failure(struct eap_eke_data *data, u8 id) {
struct wpabuf *msg;
wpa_printf(MSG_DEBUG, "EAP-EKE: Request/Failure: Failure-Code=0x%x",
data->failure_code);
msg = eap_eke_build_msg(data, id, 4, EAP_EKE_FAILURE);
if (msg == NULL) {
eap_eke_state(data, FAILURE);... | eap_eke_build_failure | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
wpabuf *eap_eke_build_identity(eap_sm *sm, eap_eke_data *data, u8 id) {
wpabuf *msg;
wpa_printf(2, "EAP-EKE: Request/Identity");
msg = eap_eke_build_msg(data, id, sm->cfg->server_id_len + 19, 1u);
if (!msg)
return 0;
wpabuf_put_u8_16(msg, 4u);
wpabuf_put_u8_16(msg, 0);
wpabuf_put_u8_16(msg, 5u);
wp... | static struct wpabuf *eap_eke_build_identity(struct eap_sm *sm,
struct eap_eke_data *data, u8 id) {
struct wpabuf *msg;
size_t plen;
wpa_printf(MSG_DEBUG, "EAP-EKE: Request/Identity");
plen = 2 + 4 * 4 + 1 + sm->cfg->server_id_len;
msg = eap_eke_build_msg(data, i... | eap_eke_build_identity | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
wpabuf *eap_eke_build_msg(eap_eke_data *data, u8 id, size_t length,
u8 eke_exch) {
wpabuf *msg;
msg = eap_msg_alloc(0, eap_type_EAP_TYPE_EKE, length + 1, 1u, id);
if (msg) {
wpabuf_put_u8_16(msg, eke_exch);
return msg;
} else {
wpa_printf(5, "EAP-EKE: Failed to allocate me... | static struct wpabuf *eap_eke_build_msg(struct eap_eke_data *data, u8 id,
size_t length, u8 eke_exch) {
struct wpabuf *msg;
size_t plen;
plen = 1 + length;
msg =
eap_msg_alloc(EAP_VENDOR_IETF, EAP_TYPE_EKE, plen, EAP_CODE_REQUEST, id);
if (msg == NULL) {
wpa... | eap_eke_build_msg | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
bool eap_eke_check(eap_sm *sm, void *priv, wpabuf *respData) {
u8 eke_exch;
size_t len;
eap_eke_data *data;
const u8 *pos;
unsigned long v8;
v8 = __readfsqword(0x28u);
data = (eap_eke_data *)priv;
pos = eap_hdr_validate(0, eap_type_EAP_TYPE_EKE, respData, &len);
if (pos && len) {
eke_exch = *pos;... | static bool eap_eke_check(struct eap_sm *sm, void *priv,
struct wpabuf *respData) {
struct eap_eke_data *data = priv;
size_t len;
const u8 *pos;
u8 eke_exch;
pos = eap_hdr_validate(EAP_VENDOR_IETF, EAP_TYPE_EKE, respData, &len);
if (pos == NULL || len < 1) {
wpa_printf(MSG_INF... | eap_eke_check | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int eap_eke_decrypt_prot(eap_eke_session *sess, const u8 *prot, size_t prot_len,
u8 *data, size_t *data_len) {
size_t icv_len;
u8 icv[40];
unsigned long v11;
v11 = __readfsqword(0x28u);
if (sess->encr != 1)
return -1;
if (sess->mac == 1) {
icv_len = 20;
} else {
if (s... | int eap_eke_decrypt_prot(struct eap_eke_session *sess, const u8 *prot,
size_t prot_len, u8 *data, size_t *data_len) {
size_t block_size, icv_len;
u8 icv[EAP_EKE_MAX_HASH_LEN];
if (sess->encr == EAP_EKE_ENCR_AES128_CBC)
block_size = AES_BLOCK_SIZE;
else
return -1;
if (sess->m... | eap_eke_decrypt_prot | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int eap_eke_derive_ka(eap_eke_session *sess, const u8 *id_s, size_t id_s_len,
const u8 *id_p, size_t id_p_len, const u8 *nonce_p,
const u8 *nonce_s) {
size_t label_len;
size_t data_len;
u8 *data;
u8 *pos;
u8 *posa;
label_len = strlen("EAP-EKE Ka");
data_len = i... | int eap_eke_derive_ka(struct eap_eke_session *sess, const u8 *id_s,
size_t id_s_len, const u8 *id_p, size_t id_p_len,
const u8 *nonce_p, const u8 *nonce_s) {
u8 *data, *pos;
size_t data_len;
const char *label = "EAP-EKE Ka";
size_t label_len;
label_len = os_strlen(... | eap_eke_derive_ka | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int eap_eke_derive_ke_ki(eap_eke_session *sess, const u8 *id_s, size_t id_s_len,
const u8 *id_p, size_t id_p_len) {
size_t ki_len;
size_t label_len;
u8 *data;
u8 buf[56];
unsigned long v13;
v13 = __readfsqword(0x28u);
if (sess->encr != 1)
return -1;
if (sess->mac == 1) {
... | int eap_eke_derive_ke_ki(struct eap_eke_session *sess, const u8 *id_s,
size_t id_s_len, const u8 *id_p, size_t id_p_len) {
u8 buf[EAP_EKE_MAX_KE_LEN + EAP_EKE_MAX_KI_LEN];
size_t ke_len, ki_len;
u8 *data;
size_t data_len;
const char *label = "EAP-EKE Keys";
size_t label_len;
if (... | eap_eke_derive_ke_ki | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int eap_eke_derive_key(eap_eke_session *sess, const u8 *password,
size_t password_len, const u8 *id_s, size_t id_s_len,
const u8 *id_p, size_t id_p_len, u8 *key) {
u8 *id;
u8 zeros[32];
u8 temp[40];
unsigned long v16;
v16 = __readfsqword(0x28u);
memset(zeros, 0... | int eap_eke_derive_key(struct eap_eke_session *sess, const u8 *password,
size_t password_len, const u8 *id_s, size_t id_s_len,
const u8 *id_p, size_t id_p_len, u8 *key) {
u8 zeros[EAP_EKE_MAX_HASH_LEN];
u8 temp[EAP_EKE_MAX_HASH_LEN];
size_t key_len = 16;
u8 *id;
... | eap_eke_derive_key | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int eap_eke_derive_msk(eap_eke_session *sess, const u8 *id_s, size_t id_s_len,
const u8 *id_p, size_t id_p_len, const u8 *nonce_p,
const u8 *nonce_s, u8 *msk, u8 *emsk) {
size_t label_len;
size_t data_len;
u8 *data;
u8 *pos;
u8 *posa;
u8 buf[136];
unsigned lon... | int eap_eke_derive_msk(struct eap_eke_session *sess, const u8 *id_s,
size_t id_s_len, const u8 *id_p, size_t id_p_len,
const u8 *nonce_p, const u8 *nonce_s, u8 *msk,
u8 *emsk) {
u8 *data, *pos;
size_t data_len;
const char *label = "EAP-EKE Expor... | eap_eke_derive_msk | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int eap_eke_dh_generator(u8 group) {
int result;
switch (group) {
case 1u:
result = 5;
break;
case 2u:
result = 31;
break;
case 3u:
result = 11;
break;
case 4u:
result = 5;
break;
case 5u:
result = 5;
break;
default:
result = -1;
break;
}
return resul... | static int eap_eke_dh_generator(u8 group) {
switch (group) {
case EAP_EKE_DHGROUP_EKE_2:
return 5;
case EAP_EKE_DHGROUP_EKE_5:
return 31;
case EAP_EKE_DHGROUP_EKE_14:
return 11;
case EAP_EKE_DHGROUP_EKE_15:
return 5;
case EAP_EKE_DHGROUP_EKE_16:
return 5;
}
return -1;
} | eap_eke_dh_generator | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
const dh_group *eap_eke_dh_group(u8 group) {
const dh_group *result;
switch (group) {
case 1u:
result = dh_groups_get(2);
break;
case 2u:
result = dh_groups_get(5);
break;
case 3u:
result = dh_groups_get(14);
break;
case 4u:
result = dh_groups_get(15);
break;
case 5u:
... | static const struct dh_group *eap_eke_dh_group(u8 group) {
switch (group) {
case EAP_EKE_DHGROUP_EKE_2:
return dh_groups_get(2);
case EAP_EKE_DHGROUP_EKE_5:
return dh_groups_get(5);
case EAP_EKE_DHGROUP_EKE_14:
return dh_groups_get(14);
case EAP_EKE_DHGROUP_EKE_15:
return dh_groups_get(15);
... | eap_eke_dh_group | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int eap_eke_dh_init(u8 group, u8 *ret_priv, u8 *ret_pub) {
unsigned int generator;
const dh_group *dh_0;
generator = eap_eke_dh_generator(group);
dh_0 = eap_eke_dh_group(group);
if (generator >= 0x100 || !dh_0)
return -1;
if (crypto_dh_init(generator, dh_0->prime, dh_0->prime_len, ret_priv,
... | int eap_eke_dh_init(u8 group, u8 *ret_priv, u8 *ret_pub) {
int generator;
u8 gen;
const struct dh_group *dh;
generator = eap_eke_dh_generator(group);
dh = eap_eke_dh_group(group);
if (generator < 0 || generator > 255 || !dh)
return -1;
gen = generator;
if (crypto_dh_init(gen, dh->prime, dh->prime_... | eap_eke_dh_init | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int eap_eke_dh_len(u8 group) {
int result;
switch (group) {
case 1u:
result = 128;
break;
case 2u:
result = 192;
break;
case 3u:
result = 256;
break;
case 4u:
result = 384;
break;
case 5u:
result = 512;
break;
default:
result = -1;
break;
}
return res... | static int eap_eke_dh_len(u8 group) {
switch (group) {
case EAP_EKE_DHGROUP_EKE_2:
return 128;
case EAP_EKE_DHGROUP_EKE_5:
return 192;
case EAP_EKE_DHGROUP_EKE_14:
return 256;
case EAP_EKE_DHGROUP_EKE_15:
return 384;
case EAP_EKE_DHGROUP_EKE_16:
return 512;
}
return -1;
} | eap_eke_dh_len | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int eap_eke_dhcomp(eap_eke_session *sess, const u8 *key, const u8 *dhpub,
u8 *ret_dhcomp) {
long v5;
int dh_len;
u8 iv[16];
u8 pub[520];
unsigned long v11;
v11 = __readfsqword(0x28u);
dh_len = eap_eke_dh_len(sess->dhgroup);
if (dh_len < 0)
return -1;
if (sess->encr != 1)
re... | int eap_eke_dhcomp(struct eap_eke_session *sess, const u8 *key, const u8 *dhpub,
u8 *ret_dhcomp) {
u8 pub[EAP_EKE_MAX_DH_LEN];
int dh_len;
u8 iv[AES_BLOCK_SIZE];
dh_len = eap_eke_dh_len(sess->dhgroup);
if (dh_len < 0)
return -1;
if (sess->encr != EAP_EKE_ENCR_AES128_CBC)
return ... | eap_eke_dhcomp | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int eap_eke_dhcomp_len(u8 dhgroup, u8 encr) {
int dhlen;
dhlen = eap_eke_dh_len(dhgroup);
if (dhlen >= 0 && encr == 1)
return dhlen + 16;
else
return -1;
} | static int eap_eke_dhcomp_len(u8 dhgroup, u8 encr) {
int dhlen;
dhlen = eap_eke_dh_len(dhgroup);
if (dhlen < 0 || encr != EAP_EKE_ENCR_AES128_CBC)
return -1;
return AES_BLOCK_SIZE + dhlen;
} | eap_eke_dhcomp_len | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_eke_fail(eap_eke_data *data, u32 code) {
wpa_printf(2, "EAP-EKE: Failure - code 0x%x", code);
data->failure_code = code;
eap_eke_state(data, 3);
} | static void eap_eke_fail(struct eap_eke_data *data, u32 code) {
wpa_printf(MSG_DEBUG, "EAP-EKE: Failure - code 0x%x", code);
data->failure_code = code;
eap_eke_state(data, FAILURE_REPORT);
} | eap_eke_fail | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
u8 *eap_eke_getKey(eap_sm *sm, void *priv, size_t *len) {
u8 *key;
if (*(_DWORD *)priv != 4)
return 0;
key = (u8 *)os_memdup((char *)priv + 4, 0x40u);
if (!key)
return 0;
*len = 64;
return key;
} | static u8 *eap_eke_getKey(struct eap_sm *sm, void *priv, size_t *len) {
struct eap_eke_data *data = priv;
u8 *key;
if (data->state != SUCCESS)
return NULL;
key = os_memdup(data->msk, EAP_MSK_LEN);
if (key == NULL)
return NULL;
*len = EAP_MSK_LEN;
return key;
} | eap_eke_getKey | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
u8 *eap_eke_get_emsk(eap_sm *sm, void *priv, size_t *len) {
u8 *key;
if (*(_DWORD *)priv != 4)
return 0;
key = (u8 *)os_memdup((char *)priv + 68, 0x40u);
if (!key)
return 0;
*len = 64;
return key;
} | static u8 *eap_eke_get_emsk(struct eap_sm *sm, void *priv, size_t *len) {
struct eap_eke_data *data = priv;
u8 *key;
if (data->state != SUCCESS)
return NULL;
key = os_memdup(data->emsk, EAP_EMSK_LEN);
if (key == NULL)
return NULL;
*len = EAP_EMSK_LEN;
return key;
} | eap_eke_get_emsk | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
u8 *eap_eke_get_session_id(eap_sm *sm, void *priv, size_t *len) {
size_t sid_len;
u8 *sid;
if (*(_DWORD *)priv != 4)
return 0;
sid_len = 2 * *((_DWORD *)priv + 201) + 1;
sid = (u8 *)malloc(sid_len);
if (!sid)
return 0;
*sid = 53;
memcpy(sid + 1, (char *)priv + 824, *((int *)priv + 201));
memc... | static u8 *eap_eke_get_session_id(struct eap_sm *sm, void *priv, size_t *len) {
struct eap_eke_data *data = priv;
u8 *sid;
size_t sid_len;
if (data->state != SUCCESS)
return NULL;
sid_len = 1 + 2 * data->sess.nonce_len;
sid = os_malloc(sid_len);
if (sid == NULL)
return NULL;
sid[0] = EAP_TYPE_... | eap_eke_get_session_id | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void *eap_eke_init(eap_sm *sm) {
size_t i;
eap_eke_data *data;
data = (eap_eke_data *)os_zalloc(0x368u);
if (!data)
return 0;
eap_eke_state(data, 0);
data->serverid_type = 1;
for (i = 0; i < sm->cfg->server_id_len; ++i) {
if (sm->cfg->server_id[i] == 46 && data->serverid_type == 1)
data->se... | static void *eap_eke_init(struct eap_sm *sm) {
struct eap_eke_data *data;
size_t i;
data = os_zalloc(sizeof(*data));
if (data == NULL)
return NULL;
eap_eke_state(data, IDENTITY);
data->serverid_type = EAP_EKE_ID_OPAQUE;
for (i = 0; i < sm->cfg->server_id_len; i++) {
if (sm->cfg->server_id[i] == ... | eap_eke_init | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
bool eap_eke_isDone(eap_sm *sm, void *priv) {
return *(_DWORD *)priv == 4 || *(_DWORD *)priv == 5;
} | static bool eap_eke_isDone(struct eap_sm *sm, void *priv) {
struct eap_eke_data *data = priv;
return data->state == SUCCESS || data->state == FAILURE;
} | eap_eke_isDone | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
bool eap_eke_isSuccess(eap_sm *sm, void *priv) { return *(_DWORD *)priv == 4; } | static bool eap_eke_isSuccess(struct eap_sm *sm, void *priv) {
struct eap_eke_data *data = priv;
return data->state == SUCCESS;
} | eap_eke_isSuccess | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int eap_eke_mac(u8 mac, const u8 *key, const u8 *data, size_t data_len,
u8 *res) {
if (mac == 1)
return hmac_sha1(key, 0x14u, data, data_len, res);
if (mac == 2)
return hmac_sha256(key, 0x20u, data, data_len, res);
return -1;
} | static int eap_eke_mac(u8 mac, const u8 *key, const u8 *data, size_t data_len,
u8 *res) {
if (mac == EAP_EKE_MAC_HMAC_SHA1)
return hmac_sha1(key, SHA1_MAC_LEN, data, data_len, res);
if (mac == EAP_EKE_MAC_HMAC_SHA2_256)
return hmac_sha256(key, SHA256_MAC_LEN, data, data_len, res);
r... | eap_eke_mac | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int eap_eke_nonce_len(u8 prf) {
int prf_len;
prf_len = eap_eke_prf_len(prf);
if (prf_len < 0)
return -1;
if (prf_len <= 32)
return 16;
return (prf_len + 1) / 2;
} | static int eap_eke_nonce_len(u8 prf) {
int prf_len;
prf_len = eap_eke_prf_len(prf);
if (prf_len < 0)
return -1;
if (prf_len > 2 * 16)
return (prf_len + 1) / 2;
return 16;
} | eap_eke_nonce_len | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int eap_eke_pnonce_len(u8 mac) {
int mac_len;
if (mac == 1) {
mac_len = 20;
} else {
if (mac != 2)
return -1;
mac_len = 32;
}
return mac_len + 32;
} | static int eap_eke_pnonce_len(u8 mac) {
int mac_len;
if (mac == EAP_EKE_MAC_HMAC_SHA1)
mac_len = SHA1_MAC_LEN;
else if (mac == EAP_EKE_MAC_HMAC_SHA2_256)
mac_len = SHA256_MAC_LEN;
else
return -1;
return AES_BLOCK_SIZE + 16 + mac_len;
} | eap_eke_pnonce_len | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int eap_eke_pnonce_ps_len(u8 mac) {
int mac_len;
if (mac == 1) {
mac_len = 20;
} else {
if (mac != 2)
return -1;
mac_len = 32;
}
return mac_len + 48;
} | static int eap_eke_pnonce_ps_len(u8 mac) {
int mac_len;
if (mac == EAP_EKE_MAC_HMAC_SHA1)
mac_len = SHA1_MAC_LEN;
else if (mac == EAP_EKE_MAC_HMAC_SHA2_256)
mac_len = SHA256_MAC_LEN;
else
return -1;
return AES_BLOCK_SIZE + 2 * 16 + mac_len;
} | eap_eke_pnonce_ps_len | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int eap_eke_prf(u8 prf, const u8 *key, size_t key_len, const u8 *data,
size_t data_len, const u8 *data2, size_t data2_len, u8 *res) {
size_t num_elem;
const u8 *addr[2];
size_t len[3];
unsigned long v12;
v12 = __readfsqword(0x28u);
num_elem = 1;
addr[0] = data;
len[0] = data_len;
if (... | static int eap_eke_prf(u8 prf, const u8 *key, size_t key_len, const u8 *data,
size_t data_len, const u8 *data2, size_t data2_len,
u8 *res) {
const u8 *addr[2];
size_t len[2];
size_t num_elem = 1;
addr[0] = data;
len[0] = data_len;
if (data2) {
num_elem++;
... | eap_eke_prf | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int eap_eke_prf_hmac_sha1(const u8 *key, size_t key_len, const u8 *data,
size_t data_len, u8 *res, size_t len) {
long v7;
u8 idx;
int ret;
const u8 *addr[3];
size_t vlen[4];
u8 hash[20];
unsigned long v15;
v15 = __readfsqword(0x28u);
idx = 0;
addr[0] = hash;
vlen[0] = 20... | static int eap_eke_prf_hmac_sha1(const u8 *key, size_t key_len, const u8 *data,
size_t data_len, u8 *res, size_t len) {
u8 hash[SHA1_MAC_LEN];
u8 idx;
const u8 *addr[3];
size_t vlen[3];
int ret;
idx = 0;
addr[0] = hash;
vlen[0] = SHA1_MAC_LEN;
addr[1] = data;
vlen[1... | eap_eke_prf_hmac_sha1 | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int eap_eke_prf_hmac_sha256(const u8 *key, size_t key_len, const u8 *data,
size_t data_len, u8 *res, size_t len) {
long v7;
long v8;
u8 idx;
int ret;
const u8 *addr[3];
size_t vlen[4];
u8 hash[32];
unsigned long v16;
v16 = __readfsqword(0x28u);
idx = 0;
addr[0] = hash;... | static int eap_eke_prf_hmac_sha256(const u8 *key, size_t key_len,
const u8 *data, size_t data_len, u8 *res,
size_t len) {
u8 hash[SHA256_MAC_LEN];
u8 idx;
const u8 *addr[3];
size_t vlen[3];
int ret;
idx = 0;
addr[0] = hash;
vlen[0] =... | eap_eke_prf_hmac_sha256 | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int eap_eke_prf_len(u8 prf) {
if (prf == 1)
return 20;
if (prf == 2)
return 32;
return -1;
} | static int eap_eke_prf_len(u8 prf) {
if (prf == EAP_EKE_PRF_HMAC_SHA1)
return 20;
if (prf == EAP_EKE_PRF_HMAC_SHA2_256)
return 32;
return -1;
} | eap_eke_prf_len | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int eap_eke_prfplus(u8 prf, const u8 *key, size_t key_len, const u8 *data,
size_t data_len, u8 *res, size_t len) {
if (prf == 1)
return eap_eke_prf_hmac_sha1(key, key_len, data, data_len, res, len);
if (prf == 2)
return eap_eke_prf_hmac_sha256(key, key_len, data, data_len, res, len);
r... | static int eap_eke_prfplus(u8 prf, const u8 *key, size_t key_len,
const u8 *data, size_t data_len, u8 *res,
size_t len) {
if (prf == EAP_EKE_PRF_HMAC_SHA1)
return eap_eke_prf_hmac_sha1(key, key_len, data, data_len, res, len);
if (prf == EAP_EKE_PRF_HMAC_SHA2... | eap_eke_prfplus | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_eke_process(eap_sm *sm, void *priv, wpabuf *respData) {
u8 eke_exch;
size_t len;
eap_eke_data *data;
const u8 *pos;
const u8 *end;
unsigned long v9;
v9 = __readfsqword(0x28u);
data = (eap_eke_data *)priv;
pos = eap_hdr_validate(0, eap_type_EAP_TYPE_EKE, respData, &len);
if (pos && len) {
... | static void eap_eke_process(struct eap_sm *sm, void *priv,
struct wpabuf *respData) {
struct eap_eke_data *data = priv;
u8 eke_exch;
size_t len;
const u8 *pos, *end;
pos = eap_hdr_validate(EAP_VENDOR_IETF, EAP_TYPE_EKE, respData, &len);
if (pos == NULL || len < 1)
return;
... | eap_eke_process | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_eke_process_commit(eap_sm *sm, eap_eke_data *data,
const wpabuf *respData, const u8 *payload,
size_t payloadlen) {
size_t v5;
size_t decrypt_len;
const u8 *pos;
const u8 *end;
const u8 *dhcomp;
const u8 *pnonce;
unsigned long v14;
v14 = _... | static void eap_eke_process_commit(struct eap_sm *sm, struct eap_eke_data *data,
const struct wpabuf *respData,
const u8 *payload, size_t payloadlen) {
const u8 *pos, *end, *dhcomp, *pnonce;
size_t decrypt_len;
wpa_printf(MSG_DEBUG, "EAP-EKE: ... | eap_eke_process_commit | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_eke_process_confirm(eap_sm *sm, eap_eke_data *data,
const wpabuf *respData, const u8 *payload,
size_t payloadlen) {
size_t decrypt_len;
u8 nonce[16];
u8 auth_p[40];
unsigned long v10;
v10 = __readfsqword(0x28u);
wpa_printf(2, "EAP-EKE: Rece... | static void eap_eke_process_confirm(struct eap_sm *sm,
struct eap_eke_data *data,
const struct wpabuf *respData,
const u8 *payload, size_t payloadlen) {
size_t decrypt_len;
u8 nonce[EAP_EKE_MAX_NONCE_LEN];
... | eap_eke_process_confirm | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_eke_process_failure(eap_sm *sm, eap_eke_data *data,
const wpabuf *respData, const u8 *payload,
size_t payloadlen) {
u32 code;
wpa_printf(2, "EAP-EKE: Received Response/Failure");
if (payloadlen > 3) {
code = WPA_GET_BE32_6(payload);
wpa_p... | static void eap_eke_process_failure(struct eap_sm *sm,
struct eap_eke_data *data,
const struct wpabuf *respData,
const u8 *payload, size_t payloadlen) {
u32 code;
wpa_printf(MSG_DEBUG, "EAP-EKE: Received Res... | eap_eke_process_failure | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_eke_process_identity(eap_sm *sm, eap_eke_data *data,
const wpabuf *respData, const u8 *payload,
size_t payloadlen) {
size_t v5;
int i;
wpa_printf(2, "EAP-EKE: Received Response/Identity");
if (data->state) {
eap_eke_fail(data, 2u);
re... | static void eap_eke_process_identity(struct eap_sm *sm,
struct eap_eke_data *data,
const struct wpabuf *respData,
const u8 *payload, size_t payloadlen) {
const u8 *pos, *end;
int i;
wpa_printf(MSG_DEBUG... | eap_eke_process_identity | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int eap_eke_prot(eap_eke_session *sess, const u8 *data, size_t data_len,
u8 *prot, size_t *prot_len) {
size_t icv_len;
size_t pad;
u8 *pos;
u8 *e;
if (sess->encr != 1)
return -1;
if (sess->mac == 1) {
icv_len = 20;
} else {
if (sess->mac != 2)
return -1;
icv_len = 3... | int eap_eke_prot(struct eap_eke_session *sess, const u8 *data, size_t data_len,
u8 *prot, size_t *prot_len) {
size_t block_size, icv_len, pad;
u8 *pos, *iv, *e;
if (sess->encr == EAP_EKE_ENCR_AES128_CBC)
block_size = AES_BLOCK_SIZE;
else
return -1;
if (sess->mac == EAP_EKE_PRF_HMAC_... | eap_eke_prot | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_eke_reset(eap_sm *sm, void *priv) {
eap_eke_session_clean((eap_eke_session *)((char *)priv + 684));
free(*((void **)priv + 17));
wpabuf_free(*((wpabuf **)priv + 107));
bin_clear_free(priv, 0x368u);
} | static void eap_eke_reset(struct eap_sm *sm, void *priv) {
struct eap_eke_data *data = priv;
eap_eke_session_clean(&data->sess);
os_free(data->peerid);
wpabuf_free(data->msgs);
bin_clear_free(data, sizeof(*data));
} | eap_eke_reset | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_eke_session_clean(eap_eke_session *sess) {
memset(sess->shared_secret, 0, sizeof(sess->shared_secret));
memset(sess->ke, 0, sizeof(sess->ke));
memset(sess->ki, 0, sizeof(sess->ki));
memset(sess->ka, 0, sizeof(sess->ka));
} | void eap_eke_session_clean(struct eap_eke_session *sess) {
os_memset(sess->shared_secret, 0, EAP_EKE_MAX_HASH_LEN);
os_memset(sess->ke, 0, EAP_EKE_MAX_KE_LEN);
os_memset(sess->ki, 0, EAP_EKE_MAX_KI_LEN);
os_memset(sess->ka, 0, EAP_EKE_MAX_KA_LEN);
} | eap_eke_session_clean | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int eap_eke_session_init(eap_eke_session *sess, u8 dhgroup, u8 encr, u8 prf,
u8 mac) {
sess->dhgroup = dhgroup;
sess->encr = encr;
sess->prf = prf;
sess->mac = mac;
sess->prf_len = eap_eke_prf_len(prf);
sess->nonce_len = eap_eke_nonce_len(prf);
sess->auth_len = eap_eke_auth_len(pr... | int eap_eke_session_init(struct eap_eke_session *sess, u8 dhgroup, u8 encr,
u8 prf, u8 mac) {
sess->dhgroup = dhgroup;
sess->encr = encr;
sess->prf = prf;
sess->mac = mac;
sess->prf_len = eap_eke_prf_len(prf);
sess->nonce_len = eap_eke_nonce_len(prf);
sess->auth_len = eap_eke_aut... | eap_eke_session_init | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int eap_eke_shared_secret(eap_eke_session *sess, const u8 *key,
const u8 *dhpriv, const u8 *peer_dhcomp) {
size_t len;
const dh_group *dh_0;
size_t pad;
u8 zeros[32];
u8 peer_pub[512];
u8 modexp[520];
unsigned long v13;
v13 = __readfsqword(0x28u);
dh_0 = eap_eke_dh_group(ses... | int eap_eke_shared_secret(struct eap_eke_session *sess, const u8 *key,
const u8 *dhpriv, const u8 *peer_dhcomp) {
u8 zeros[EAP_EKE_MAX_HASH_LEN];
u8 peer_pub[EAP_EKE_MAX_DH_LEN];
u8 modexp[EAP_EKE_MAX_DH_LEN];
size_t len;
const struct dh_group *dh;
dh = eap_eke_dh_group(sess->dhgr... | eap_eke_shared_secret | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_eke_state(eap_eke_data *data, int state) {
const char *v2;
const char *v3;
v2 = eap_eke_state_txt(state);
v3 = eap_eke_state_txt(data->state);
wpa_printf(2, "EAP-EKE: %s -> %s", v3, v2);
data->state = state;
} | static void eap_eke_state(struct eap_eke_data *data, int state) {
wpa_printf(MSG_DEBUG, "EAP-EKE: %s -> %s", eap_eke_state_txt(data->state),
eap_eke_state_txt(state));
data->state = state;
} | eap_eke_state | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
const char *eap_eke_state_txt(int state) {
const char *result;
switch (state) {
case 0:
result = "IDENTITY";
break;
case 1:
result = "COMMIT";
break;
case 2:
result = "CONFIRM";
break;
case 3:
result = "FAILURE_REPORT";
break;
case 4:
result = "SUCCESS";
break;
c... | static const char *eap_eke_state_txt(int state) {
switch (state) {
case IDENTITY:
return "IDENTITY";
case COMMIT:
return "COMMIT";
case CONFIRM:
return "CONFIRM";
case FAILURE_REPORT:
return "FAILURE_REPORT";
case SUCCESS:
return "SUCCESS";
case FAILURE:
return "FAILURE";
default... | eap_eke_state_txt | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int eap_erp_add_key(eap_sm *sm, eap_server_erp_key *erp) {
if (sm->eapol_cb->erp_add_key)
return sm->eapol_cb->erp_add_key(sm->eapol_ctx, erp);
else
return -1;
} | static int eap_erp_add_key(struct eap_sm *sm, struct eap_server_erp_key *erp) {
if (sm->eapol_cb->erp_add_key)
return sm->eapol_cb->erp_add_key(sm->eapol_ctx, erp);
return -1;
} | eap_erp_add_key | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
eap_server_erp_key *eap_erp_get_key(eap_sm *sm, const char *keyname) {
if (sm->eapol_cb->erp_get_key)
return sm->eapol_cb->erp_get_key(sm->eapol_ctx, keyname);
else
return 0;
} | static struct eap_server_erp_key *eap_erp_get_key(struct eap_sm *sm,
const char *keyname) {
if (sm->eapol_cb->erp_get_key)
return sm->eapol_cb->erp_get_key(sm->eapol_ctx, keyname);
return NULL;
} | eap_erp_get_key | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_erp_update_identity(eap_sm *sm, const u8 *eap, size_t len) {
const u8 *end;
erp_tlvs parse;
unsigned long v5;
v5 = __readfsqword(0x28u);
if (len > 4) {
end = &eap[len];
if (*eap == 5 && eap[4] == 2 && end >= eap + 8 &&
erp_parse_tlvs(eap + 8, end, &parse, 1) >= 0 && parse.keyname) {
... | void eap_erp_update_identity(struct eap_sm *sm, const u8 *eap, size_t len) {
#ifdef CONFIG_ERP
const struct eap_hdr *hdr;
const u8 *pos, *end;
struct erp_tlvs parse;
if (len < sizeof(*hdr) + 1)
return;
hdr = (const struct eap_hdr *)eap;
end = eap + len;
pos = (const u8 *)(hdr + 1);
if (hdr->code !=... | eap_erp_update_identity | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
wpabuf *eap_fast_buildReq(eap_sm *sm, void *priv, u8 id) {
wpabuf *result;
wpabuf *v4;
int piggyback;
wpabuf *req;
req = 0;
piggyback = 0;
if (*((_DWORD *)priv + 14) == 1)
return eap_server_tls_build_ack(id, 43, *((_DWORD *)priv + 27));
if (*((_DWORD *)priv + 14) == 2)
return eap_server_tls_bui... | static struct wpabuf *eap_fast_buildReq(struct eap_sm *sm, void *priv, u8 id) {
struct eap_fast_data *data = priv;
struct wpabuf *req = NULL;
int piggyback = 0;
if (data->ssl.state == FRAG_ACK) {
return eap_server_tls_build_ack(id, EAP_TYPE_FAST, data->fast_version);
}
if (data->ssl.state == WAIT_FRAG... | eap_fast_buildReq | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
wpabuf *eap_fast_build_crypto_binding(eap_sm *sm, eap_fast_data *data) {
wpabuf *buf;
eap_tlv_result_tlv *result;
eap_tlv_result_tlv *resulta;
eap_tlv_crypto_binding_tlv *binding;
buf = wpabuf_alloc(0x48u);
if (!buf)
return 0;
data->final_result =
!data->send_new_pac && !data->anon_provisioning... | static struct wpabuf *
eap_fast_build_crypto_binding(struct eap_sm *sm, struct eap_fast_data *data) {
struct wpabuf *buf;
struct eap_tlv_result_tlv *result;
struct eap_tlv_crypto_binding_tlv *binding;
buf = wpabuf_alloc(2 * sizeof(*result) + sizeof(*binding));
if (buf == NULL)
return NULL;
if (data->s... | eap_fast_build_crypto_binding | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
wpabuf *eap_fast_build_pac(eap_sm *sm, eap_fast_data *data) {
long v3;
long v4;
u8 *v5;
u8 *pos;
unsigned short posa;
size_t pac_len;
size_t pac_lena;
u8 *pac_buf;
size_t srv_id_info_len;
u8 *pac_opaque;
wpabuf *buf;
u8 *result;
eap_tlv_hdr *pac_tlv;
pac_tlv_hdr *pac_info;
os_time now;
u... | static struct wpabuf *eap_fast_build_pac(struct eap_sm *sm,
struct eap_fast_data *data) {
u8 pac_key[EAP_FAST_PAC_KEY_LEN];
u8 *pac_buf, *pac_opaque;
struct wpabuf *buf;
u8 *pos;
size_t buf_len, srv_id_info_len, pac_len;
struct eap_tlv_hdr *pac_tlv;
struct pac_tlv_... | eap_fast_build_pac | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
wpabuf *eap_fast_build_phase2_req(eap_sm *sm, eap_fast_data *data, u8 id) {
wpabuf *req;
if (data->phase2_priv) {
req = data->phase2_method->buildReq(sm, data->phase2_priv, id);
if (req) {
wpa_hexdump_buf_key_1(1, "EAP-FAST: Phase 2 EAP-Request", req);
return eap_fast_tlv_eap_payload(req);
... | static struct wpabuf *eap_fast_build_phase2_req(struct eap_sm *sm,
struct eap_fast_data *data,
u8 id) {
struct wpabuf *req;
if (data->phase2_priv == NULL) {
wpa_printf(MSG_DEBUG, "EAP-FAST: Phase 2 method not "
... | eap_fast_build_phase2_req | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
wpabuf *eap_fast_build_start(eap_sm *sm, eap_fast_data *data, u8 id) {
wpabuf *req;
req = eap_msg_alloc(0, eap_type_EAP_TYPE_FAST, data->srv_id_len + 5, 1u, id);
if (req) {
wpabuf_put_u8_17(req, LOBYTE(data->fast_version) | 0x20);
eap_fast_put_tlv(req, 4u, data->srv_id, data->srv_id_len);
eap_fast_st... | static struct wpabuf *eap_fast_build_start(struct eap_sm *sm,
struct eap_fast_data *data, u8 id) {
struct wpabuf *req;
req = eap_msg_alloc(EAP_VENDOR_IETF, EAP_TYPE_FAST,
1 + sizeof(struct pac_tlv_hdr) + data->srv_id_len,
EAP_CO... | eap_fast_build_start | 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.