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 |
|---|---|---|---|---|---|---|---|
wpabuf *eap_sim_buildReq(eap_sm *sm, void *priv, u8 id) {
unsigned int v3;
v3 = *((_DWORD *)priv + 79);
if (v3 == 3)
return eap_sim_build_notification(sm, (eap_sim_data *)priv, id);
if (v3 > 3) {
wpa_printf(2, "EAP-SIM: Unknown state %d in buildReq",
*((_DWORD *)priv + 79));
return 0... | static struct wpabuf *eap_sim_buildReq(struct eap_sm *sm, void *priv, u8 id) {
struct eap_sim_data *data = priv;
switch (data->state) {
case START:
return eap_sim_build_start(sm, data, id);
case CHALLENGE:
return eap_sim_build_challenge(sm, data, id);
case REAUTH:
return eap_sim_build_reauth(sm, ... | eap_sim_buildReq | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
wpabuf *eap_sim_build_challenge(eap_sm *sm, eap_sim_data *data, u8 id) {
eap_sim_msg *msg;
wpa_printf(2, "EAP-SIM: Generating Challenge");
msg = eap_sim_msg_init(1, id, 18, 11);
wpa_printf(2, " AT_RAND");
eap_sim_msg_add(msg, 1u, 0, data->rand[0], 16 * data->num_chal);
if (eap_sim_build_encr(sm, data, ms... | static struct wpabuf *
eap_sim_build_challenge(struct eap_sm *sm, struct eap_sim_data *data, u8 id) {
struct eap_sim_msg *msg;
wpa_printf(MSG_DEBUG, "EAP-SIM: Generating Challenge");
msg = eap_sim_msg_init(EAP_CODE_REQUEST, id, EAP_TYPE_SIM,
EAP_SIM_SUBTYPE_CHALLENGE);
wpa_printf(MSG_D... | eap_sim_build_challenge | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int eap_sim_build_encr(eap_sm *sm, eap_sim_data *data, eap_sim_msg *msg,
u16 counter, const u8 *nonce_s) {
size_t v6;
char *next_pseudonym;
u16 v8;
size_t v9;
char *next_reauth_id;
u16 v11;
free(data->next_pseudonym);
if ((sm->cfg->eap_sim_id & 1) != 0) {
if (nonce_s)
d... | static int eap_sim_build_encr(struct eap_sm *sm, struct eap_sim_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_sim_build_encr | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
wpabuf *eap_sim_build_notification(eap_sm *sm, eap_sim_data *data, u8 id) {
eap_sim_msg *msg;
wpa_printf(2, "EAP-SIM: Generating Notification");
msg = eap_sim_msg_init(1, id, 18, 12);
wpa_printf(2, " AT_NOTIFICATION (%d)", data->notification);
eap_sim_msg_add(msg, 0xCu, data->notification, 0, 0);
if (dat... | static struct wpabuf *eap_sim_build_notification(struct eap_sm *sm,
struct eap_sim_data *data,
u8 id) {
struct eap_sim_msg *msg;
wpa_printf(MSG_DEBUG, "EAP-SIM: Generating Notification");
msg = eap_sim_msg_init(EAP_... | eap_sim_build_notification | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
wpabuf *eap_sim_build_reauth(eap_sm *sm, eap_sim_data *data, u8 id) {
const u8 *v4;
const u8 *v5;
long v6;
eap_sim_msg *msg;
wpabuf *buf;
wpa_printf(2, "EAP-SIM: Generating Re-authentication");
if (random_get_bytes(data->nonce_s, 0x10u))
return 0;
wpa_hexdump_key(1, "EAP-SIM: NONCE_S", data->nonce_... | static struct wpabuf *eap_sim_build_reauth(struct eap_sm *sm,
struct eap_sim_data *data, u8 id) {
struct eap_sim_msg *msg;
struct wpabuf *buf;
wpa_printf(MSG_DEBUG, "EAP-SIM: Generating Re-authentication");
if (random_get_bytes(data->nonce_s, EAP_SIM_NONCE_S_LEN))
... | eap_sim_build_reauth | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
wpabuf *eap_sim_build_start(eap_sm *sm, eap_sim_data *data, u8 id) {
eap_sim_msg *msg;
u8 ver[2];
unsigned long v7;
v7 = __readfsqword(0x28u);
wpa_printf(2, "EAP-SIM: Generating Start");
msg = eap_sim_msg_init(1, id, 18, 10);
if (++data->start_round == 1) {
wpa_printf(2, " AT_ANY_ID_REQ");
eap_... | static struct wpabuf *eap_sim_build_start(struct eap_sm *sm,
struct eap_sim_data *data, u8 id) {
struct eap_sim_msg *msg;
u8 ver[2];
wpa_printf(MSG_DEBUG, "EAP-SIM: Generating Start");
msg = eap_sim_msg_init(EAP_CODE_REQUEST, id, EAP_TYPE_SIM,
... | eap_sim_build_start | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
bool eap_sim_check(eap_sm *sm, void *priv, wpabuf *respData) {
size_t len;
const u8 *pos;
unsigned long v6;
v6 = __readfsqword(0x28u);
pos = eap_hdr_validate(0, eap_type_EAP_TYPE_SIM, respData, &len);
if (pos && len > 2)
return 0;
wpa_printf(3, "EAP-SIM: Invalid frame");
return 1;
} | static bool eap_sim_check(struct eap_sm *sm, void *priv,
struct wpabuf *respData) {
const u8 *pos;
size_t len;
pos = eap_hdr_validate(EAP_VENDOR_IETF, EAP_TYPE_SIM, respData, &len);
if (pos == NULL || len < 3) {
wpa_printf(MSG_INFO, "EAP-SIM: Invalid frame");
return true;
}
... | eap_sim_check | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_sim_db_add_pending(eap_sim_db_data *data, eap_sim_db_pending *entry) {
entry->next = data->pending;
data->pending = entry;
} | static void eap_sim_db_add_pending(struct eap_sim_db_data *data,
struct eap_sim_db_pending *entry) {
entry->next = data->pending;
data->pending = entry;
} | eap_sim_db_add_pending | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int eap_sim_db_add_pseudonym(eap_sim_db_data *data, const char *permanent,
char *pseudonym) {
eap_sim_pseudonym *p;
eap_sim_pseudonym *pa;
wpa_printf(2, "EAP-SIM DB: Add pseudonym '%s' for permanent username '%s'",
pseudonym, permanent);
for (p = data->pseudonyms; p &&... | int eap_sim_db_add_pseudonym(struct eap_sim_db_data *data,
const char *permanent, char *pseudonym) {
struct eap_sim_pseudonym *p;
wpa_printf(MSG_DEBUG,
"EAP-SIM DB: Add pseudonym '%s' for permanent "
"username '%s'",
pseudonym, permanent);
#ifdef ... | eap_sim_db_add_pseudonym | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int eap_sim_db_add_reauth(eap_sim_db_data *data, const char *permanent,
char *reauth_id, u16 counter, const u8 *mk) {
eap_sim_reauth *r;
wpa_printf(2, "EAP-SIM DB: Add reauth_id '%s' for permanent identity '%s'",
reauth_id, permanent);
r = eap_sim_db_add_reauth_data(data, p... | int eap_sim_db_add_reauth(struct eap_sim_db_data *data, const char *permanent,
char *reauth_id, u16 counter, const u8 *mk) {
struct eap_sim_reauth *r;
wpa_printf(MSG_DEBUG,
"EAP-SIM DB: Add reauth_id '%s' for permanent "
"identity '%s'",
reauth_id, p... | eap_sim_db_add_reauth | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
eap_sim_reauth *eap_sim_db_add_reauth_data(eap_sim_db_data *data,
const char *permanent,
char *reauth_id, u16 counter) {
eap_sim_reauth *r;
for (r = data->reauths; r && strcmp(r->permanent, permanent); r = r->next)
;
if (r)... | static struct eap_sim_reauth *
eap_sim_db_add_reauth_data(struct eap_sim_db_data *data, const char *permanent,
char *reauth_id, u16 counter) {
struct eap_sim_reauth *r;
for (r = data->reauths; r; r = r->next) {
if (os_strcmp(r->permanent, permanent) == 0)
break;
}
if (r) {... | eap_sim_db_add_reauth_data | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int eap_sim_db_add_reauth_prime(eap_sim_db_data *data, const char *permanent,
char *reauth_id, u16 counter, const u8 *k_encr,
const u8 *k_aut, const u8 *k_re) {
long v8;
eap_sim_reauth *r;
wpa_printf(2, "EAP-SIM DB: Add reauth_id '%s' for permanent ... | int eap_sim_db_add_reauth_prime(struct eap_sim_db_data *data,
const char *permanent, char *reauth_id,
u16 counter, const u8 *k_encr, const u8 *k_aut,
const u8 *k_re) {
struct eap_sim_reauth *r;
wpa_printf(MSG_DEBUG,
... | eap_sim_db_add_reauth_prime | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_sim_db_aka_resp_auth(eap_sim_db_data *data, const char *imsi,
char *buf) {
char *end;
char *enda;
char *endb;
char *endc;
char *endd;
eap_sim_db_pending *entry;
char *start;
char *starta;
char *startb;
char *startc;
entry = eap_sim_db_get_pending(data, imsi,... | static void eap_sim_db_aka_resp_auth(struct eap_sim_db_data *data,
const char *imsi, char *buf) {
char *start, *end;
struct eap_sim_db_pending *entry;
entry = eap_sim_db_get_pending(data, imsi, 1);
if (entry == NULL) {
wpa_printf(MSG_DEBUG, "EAP-SIM DB: No pending entry... | eap_sim_db_aka_resp_auth | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_sim_db_close_socket(eap_sim_db_data *data) {
if (data->sock >= 0) {
eloop_unregister_read_sock(data->sock);
close(data->sock);
data->sock = -1;
}
if (data->local_sock) {
unlink(data->local_sock);
free(data->local_sock);
data->local_sock = 0;
}
} | static void eap_sim_db_close_socket(struct eap_sim_db_data *data) {
if (data->sock >= 0) {
eloop_unregister_read_sock(data->sock);
close(data->sock);
data->sock = -1;
}
if (data->local_sock) {
unlink(data->local_sock);
os_free(data->local_sock);
data->local_sock = NULL;
}
} | eap_sim_db_close_socket | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_sim_db_deinit(void *priv) {
eap_sim_pseudonym *p;
eap_sim_reauth *r;
eap_sim_db_pending *pending;
eap_sim_db_pending *prev_pending;
eap_sim_reauth *prevr;
eap_sim_pseudonym *prev;
eap_sim_db_close_socket((eap_sim_db_data *)priv);
free(*((void **)priv + 1));
p = (eap_sim_pseudonym *)*((_QWORD... | void eap_sim_db_deinit(void *priv) {
struct eap_sim_db_data *data = priv;
struct eap_sim_pseudonym *p, *prev;
struct eap_sim_reauth *r, *prevr;
struct eap_sim_db_pending *pending, *prev_pending;
#ifdef CONFIG_SQLITE
if (data->sqlite_db) {
sqlite3_close(data->sqlite_db);
data->sqlite_db = NULL;
}
#e... | eap_sim_db_deinit | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_sim_db_del_pending(eap_sim_db_data *data, eap_sim_db_pending *entry) {
eap_sim_db_pending *pp;
for (pp = (eap_sim_db_pending *)&data->pending; pp->next; pp = pp->next) {
if (entry == pp->next) {
pp->next = entry->next;
eap_sim_db_free_pending(data, entry);
return;
}
}
} | static void eap_sim_db_del_pending(struct eap_sim_db_data *data,
struct eap_sim_db_pending *entry) {
struct eap_sim_db_pending **pp = &data->pending;
while (*pp != NULL) {
if (*pp == entry) {
*pp = entry->next;
eap_sim_db_free_pending(data, entry);
return;
... | eap_sim_db_del_pending | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_sim_db_del_timeout(void *eloop_ctx, void *user_ctx) {
wpa_printf(2, "EAP-SIM DB: Delete query timeout for %p", user_ctx);
eap_sim_db_del_pending((eap_sim_db_data *)eloop_ctx,
(eap_sim_db_pending *)user_ctx);
} | static void eap_sim_db_del_timeout(void *eloop_ctx, void *user_ctx) {
struct eap_sim_db_data *data = eloop_ctx;
struct eap_sim_db_pending *entry = user_ctx;
wpa_printf(MSG_DEBUG, "EAP-SIM DB: Delete query timeout for %p", entry);
eap_sim_db_del_pending(data, entry);
} | eap_sim_db_del_timeout | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_sim_db_expire_pending(eap_sim_db_data *data,
eap_sim_db_pending *entry) {
eloop_register_timeout(data->eap_sim_db_timeout, 0,
(eloop_timeout_handler)eap_sim_db_query_timeout, data,
entry);
} | static void eap_sim_db_expire_pending(struct eap_sim_db_data *data,
struct eap_sim_db_pending *entry) {
eloop_register_timeout(data->eap_sim_db_timeout, 0, eap_sim_db_query_timeout,
data, entry);
} | eap_sim_db_expire_pending | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_sim_db_free_pending(eap_sim_db_data *data, eap_sim_db_pending *entry) {
eloop_cancel_timeout((eloop_timeout_handler)eap_sim_db_query_timeout, data,
entry);
eloop_cancel_timeout((eloop_timeout_handler)eap_sim_db_del_timeout, data,
entry);
free(entry);
} | static void eap_sim_db_free_pending(struct eap_sim_db_data *data,
struct eap_sim_db_pending *entry) {
eloop_cancel_timeout(eap_sim_db_query_timeout, data, entry);
eloop_cancel_timeout(eap_sim_db_del_timeout, data, entry);
os_free(entry);
} | eap_sim_db_free_pending | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_sim_db_free_pseudonym(eap_sim_pseudonym *p) {
free(p->permanent);
free(p->pseudonym);
free(p);
} | static void eap_sim_db_free_pseudonym(struct eap_sim_pseudonym *p) {
os_free(p->permanent);
os_free(p->pseudonym);
os_free(p);
} | eap_sim_db_free_pseudonym | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_sim_db_free_reauth(eap_sim_reauth *r) {
free(r->permanent);
free(r->reauth_id);
free(r);
} | static void eap_sim_db_free_reauth(struct eap_sim_reauth *r) {
os_free(r->permanent);
os_free(r->reauth_id);
os_free(r);
} | eap_sim_db_free_reauth | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int eap_sim_db_get_aka_auth(eap_sim_db_data *data, const char *username,
u8 *_rand, u8 *autn, u8 *ik, u8 *ck, u8 *res,
size_t *res_len, void *cb_session_ctx) {
long v10;
long v11;
long v12;
long v13;
long v14;
int len;
const char *imsi;
eap_sim_db_... | int eap_sim_db_get_aka_auth(struct eap_sim_db_data *data, const char *username,
u8 *_rand, u8 *autn, u8 *ik, u8 *ck, u8 *res,
size_t *res_len, void *cb_session_ctx) {
struct eap_sim_db_pending *entry;
int len;
char msg[40];
const char *imsi;
size_t imsi_... | eap_sim_db_get_aka_auth | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int eap_sim_db_get_gsm_triplets(eap_sim_db_data *data, const char *username,
int max_chal, u8 *_rand, u8 *kc, u8 *sres,
void *cb_session_ctx) {
int num_chal;
int len;
int lena;
int ret;
const char *imsi;
eap_sim_db_pending *entry;
eap_sim_db_... | int eap_sim_db_get_gsm_triplets(struct eap_sim_db_data *data,
const char *username, int max_chal, u8 *_rand,
u8 *kc, u8 *sres, void *cb_session_ctx) {
struct eap_sim_db_pending *entry;
int len, ret;
char msg[40];
const char *imsi;
size_t imsi_len... | eap_sim_db_get_gsm_triplets | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
char *eap_sim_db_get_next(eap_sim_db_data *data, char prefix) {
char *id;
u8 buf[10];
unsigned long v5;
v5 = __readfsqword(0x28u);
if (random_get_bytes(buf, 0xAu))
return 0;
id = (char *)malloc(0x16u);
if (!id)
return 0;
*id = prefix;
wpa_snprintf_hex(id + 1, 0x15u, buf, 0xAu);
return id;
} | static char *eap_sim_db_get_next(struct eap_sim_db_data *data, char prefix) {
char *id, *pos, *end;
u8 buf[10];
if (random_get_bytes(buf, sizeof(buf)))
return NULL;
id = os_malloc(sizeof(buf) * 2 + 2);
if (id == NULL)
return NULL;
pos = id;
end = id + sizeof(buf) * 2 + 2;
*pos++ = prefix;
wp... | eap_sim_db_get_next | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
char *eap_sim_db_get_next_pseudonym(eap_sim_db_data *data,
eap_sim_db_method method) {
char prefix;
prefix = 53;
if (method == eap_sim_db_method_EAP_SIM_DB_AKA_PRIME) {
prefix = 55;
return eap_sim_db_get_next(data, prefix);
}
if ((unsigned int)method > eap_sim_db_m... | char *eap_sim_db_get_next_pseudonym(struct eap_sim_db_data *data,
enum eap_sim_db_method method) {
char prefix = EAP_SIM_REAUTH_ID_PREFIX;
switch (method) {
case EAP_SIM_DB_SIM:
prefix = EAP_SIM_PSEUDONYM_PREFIX;
break;
case EAP_SIM_DB_AKA:
prefix = EAP_AKA_PSEUD... | eap_sim_db_get_next_pseudonym | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
char *eap_sim_db_get_next_reauth_id(eap_sim_db_data *data,
eap_sim_db_method method) {
char prefix;
prefix = 53;
if (method == eap_sim_db_method_EAP_SIM_DB_AKA_PRIME) {
prefix = 56;
return eap_sim_db_get_next(data, prefix);
}
if ((unsigned int)method > eap_sim_db_m... | char *eap_sim_db_get_next_reauth_id(struct eap_sim_db_data *data,
enum eap_sim_db_method method) {
char prefix = EAP_SIM_REAUTH_ID_PREFIX;
switch (method) {
case EAP_SIM_DB_SIM:
prefix = EAP_SIM_REAUTH_ID_PREFIX;
break;
case EAP_SIM_DB_AKA:
prefix = EAP_AKA_REAUT... | eap_sim_db_get_next_reauth_id | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
eap_sim_db_pending *eap_sim_db_get_pending(eap_sim_db_data *data,
const char *imsi, int aka) {
eap_sim_db_pending *entry;
eap_sim_db_pending *prev;
prev = 0;
for (entry = data->pending; entry; entry = entry->next) {
if (aka == entry->aka && !strcmp(entry->imsi, im... | static struct eap_sim_db_pending *
eap_sim_db_get_pending(struct eap_sim_db_data *data, const char *imsi,
int aka) {
struct eap_sim_db_pending *entry, *prev = NULL;
entry = data->pending;
while (entry) {
if (entry->aka == aka && os_strcmp(entry->imsi, imsi) == 0) {
if (prev)
... | eap_sim_db_get_pending | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
const char *eap_sim_db_get_permanent(eap_sim_db_data *data,
const char *pseudonym) {
eap_sim_pseudonym *p;
for (p = data->pseudonyms; p; p = p->next) {
if (!strcmp(p->pseudonym, pseudonym))
return p->permanent;
}
return 0;
} | const char *eap_sim_db_get_permanent(struct eap_sim_db_data *data,
const char *pseudonym) {
struct eap_sim_pseudonym *p;
#ifdef CONFIG_SQLITE
if (data->sqlite_db)
return db_get_pseudonym(data, pseudonym);
#endif
p = data->pseudonyms;
while (p) {
if (os_strcmp(p->ps... | eap_sim_db_get_permanent | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
eap_sim_reauth *eap_sim_db_get_reauth_entry(eap_sim_db_data *data,
const char *reauth_id) {
eap_sim_reauth *r;
for (r = data->reauths; r && strcmp(r->reauth_id, reauth_id); r = r->next)
;
return r;
} | struct eap_sim_reauth *eap_sim_db_get_reauth_entry(struct eap_sim_db_data *data,
const char *reauth_id) {
struct eap_sim_reauth *r;
#ifdef CONFIG_SQLITE
if (data->sqlite_db)
return db_get_reauth(data, reauth_id);
#endif
r = data->reauths;
while (r) {
... | eap_sim_db_get_reauth_entry | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
eap_sim_db_data *eap_sim_db_init(const char *config, unsigned int db_timeout,
void (*get_complete_cb)(void *, void *),
void *ctx) {
eap_sim_db_data *data;
char *pos;
data = (eap_sim_db_data *)os_zalloc(0x48u);
if (!data)
return 0;
data->so... | struct eap_sim_db_data *
eap_sim_db_init(const char *config, unsigned int db_timeout,
void (*get_complete_cb)(void *ctx, void *session_ctx),
void *ctx) {
struct eap_sim_db_data *data;
char *pos;
data = os_zalloc(sizeof(*data));
if (data == NULL)
return NULL;
data->sock = ... | eap_sim_db_init | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int eap_sim_db_open_socket(eap_sim_db_data *data) {
int *v2;
char *v3;
int v4;
__pid_t v5;
int *v6;
char *v7;
int *v8;
char *v9;
size_t v10;
sockaddr_un addr;
unsigned long v12;
v12 = __readfsqword(0x28u);
if (strncmp(data->fname, "unix:", 5u))
return -1;
data->sock = socket(1, 2, 0);
... | static int eap_sim_db_open_socket(struct eap_sim_db_data *data) {
struct sockaddr_un addr;
static int counter = 0;
if (os_strncmp(data->fname, "unix:", 5) != 0)
return -1;
data->sock = socket(PF_UNIX, SOCK_DGRAM, 0);
if (data->sock < 0) {
wpa_printf(MSG_INFO, "socket(eap_sim_db): %s", strerror(errno... | eap_sim_db_open_socket | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_sim_db_query_timeout(void *eloop_ctx, void *user_ctx) {
wpa_printf(2, "EAP-SIM DB: Query timeout for %p", user_ctx);
*((_DWORD *)user_ctx + 7) = 2;
(*((void (**)(_QWORD, _QWORD))eloop_ctx + 3))(*((_QWORD *)eloop_ctx + 4),
*((_QWORD *)user_ctx + 4));
eloop... | static void eap_sim_db_query_timeout(void *eloop_ctx, void *user_ctx) {
struct eap_sim_db_data *data = eloop_ctx;
struct eap_sim_db_pending *entry = user_ctx;
wpa_printf(MSG_DEBUG, "EAP-SIM DB: Query timeout for %p", entry);
entry->state = FAILURE;
data->get_complete_cb(data->ctx, entry->cb_session_ctx);
e... | eap_sim_db_query_timeout | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_sim_db_receive(int sock, void *eloop_ctx, void *sock_ctx) {
int res;
char *pos;
char *posa;
char *imsi;
char buf[1000];
unsigned long v8;
v8 = __readfsqword(0x28u);
res = recv(sock, buf, 0x3E7u, 0);
if (res >= 0) {
buf[res] = 0;
wpa_hexdump_ascii_key(1, "EAP-SIM DB: Received from an ... | static void eap_sim_db_receive(int sock, void *eloop_ctx, void *sock_ctx) {
struct eap_sim_db_data *data = eloop_ctx;
char buf[1000], *pos, *cmd, *imsi;
int res;
res = recv(sock, buf, sizeof(buf) - 1, 0);
if (res < 0)
return;
buf[res] = '\0';
wpa_hexdump_ascii_key(MSG_MSGDUMP,
... | eap_sim_db_receive | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_sim_db_remove_reauth(eap_sim_db_data *data, eap_sim_reauth *reauth) {
eap_sim_reauth *r;
eap_sim_reauth *prev;
prev = 0;
for (r = data->reauths; r; r = r->next) {
if (r == reauth) {
if (prev)
prev->next = r->next;
else
data->reauths = r->next;
eap_sim_db_free_reau... | void eap_sim_db_remove_reauth(struct eap_sim_db_data *data,
struct eap_sim_reauth *reauth) {
struct eap_sim_reauth *r, *prev = NULL;
#ifdef CONFIG_SQLITE
if (data->sqlite_db) {
db_remove_reauth(data, reauth);
return;
}
#endif
r = data->reauths;
while (r) {
if (r == re... | eap_sim_db_remove_reauth | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int eap_sim_db_resynchronize(eap_sim_db_data *data, const char *username,
const u8 *auts, const u8 *_rand) {
int len;
int lena;
int lenb;
int lenc;
int ret;
int reta;
const char *imsi;
size_t imsi_len;
char msg[104];
unsigned long v16;
v16 = __readfsqword(0x28u);
if... | int eap_sim_db_resynchronize(struct eap_sim_db_data *data, const char *username,
const u8 *auts, const u8 *_rand) {
const char *imsi;
size_t imsi_len;
if (username == NULL ||
(username[0] != EAP_AKA_PERMANENT_PREFIX &&
username[0] != EAP_AKA_PRIME_PERMANENT_PREFIX) ||
... | eap_sim_db_resynchronize | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int eap_sim_db_send(eap_sim_db_data *data, const char *msg, size_t len) {
int *v3;
char *v4;
int *v6;
char *v7;
int _errno;
_errno = 0;
if (send(data->sock, msg, len, 0) < 0) {
_errno = *__errno_location();
v3 = __errno_location();
v4 = strerror(*v3);
wpa_printf(3, "send[EAP-SIM DB UNIX]:... | static int eap_sim_db_send(struct eap_sim_db_data *data, const char *msg,
size_t len) {
int _errno = 0;
if (send(data->sock, msg, len, 0) < 0) {
_errno = errno;
wpa_printf(MSG_INFO, "send[EAP-SIM DB UNIX]: %s", strerror(errno));
}
if (_errno == ENOTCONN || _errno == EDESTADD... | eap_sim_db_send | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_sim_db_sim_resp_auth(eap_sim_db_data *data, const char *imsi,
char *buf) {
int num_chal;
const char *start;
char *starta;
eap_sim_db_pending *entry;
char *end;
char *pos;
char *posa;
entry = eap_sim_db_get_pending(data, imsi, 0);
if (entry) {
start = buf;
... | static void eap_sim_db_sim_resp_auth(struct eap_sim_db_data *data,
const char *imsi, char *buf) {
char *start, *end, *pos;
struct eap_sim_db_pending *entry;
int num_chal;
entry = eap_sim_db_get_pending(data, imsi, 0);
if (entry == NULL) {
wpa_printf(MSG_DEBUG, "EAP-SI... | eap_sim_db_sim_resp_auth | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int eap_sim_derive_keys(const u8 *mk, u8 *k_encr, u8 *k_aut, u8 *msk,
u8 *emsk) {
long v6;
long v7;
u8 buf[160];
unsigned long v12;
v12 = __readfsqword(0x28u);
if (eap_sim_prf(mk, buf, 0xA0u) >= 0) {
v6 = *(_QWORD *)&buf[8];
*(_QWORD *)k_encr = *(_QWORD *)buf;
*((_QWORD ... | int eap_sim_derive_keys(const u8 *mk, u8 *k_encr, u8 *k_aut, u8 *msk,
u8 *emsk) {
u8 buf[EAP_SIM_K_ENCR_LEN + EAP_SIM_K_AUT_LEN + EAP_SIM_KEYING_DATA_LEN +
EAP_EMSK_LEN],
*pos;
if (eap_sim_prf(mk, buf, sizeof(buf)) < 0) {
wpa_printf(MSG_ERROR, "EAP-SIM: Failed to derive ke... | eap_sim_derive_keys | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int eap_sim_derive_keys_reauth(u16 _counter, const u8 *identity,
size_t identity_len, const u8 *nonce_s,
const u8 *mk, u8 *msk, u8 *emsk) {
const u8 *addr[4];
size_t len[5];
u8 counter[2];
u8 xkey[32];
u8 buf[168];
unsigned long v17;
v17 = __r... | int eap_sim_derive_keys_reauth(u16 _counter, const u8 *identity,
size_t identity_len, const u8 *nonce_s,
const u8 *mk, u8 *msk, u8 *emsk) {
u8 xkey[SHA1_MAC_LEN];
u8 buf[EAP_SIM_KEYING_DATA_LEN + EAP_EMSK_LEN + 32];
u8 counter[2];
const u8 *addr[4];
... | eap_sim_derive_keys_reauth | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_sim_derive_mk(const u8 *identity, size_t identity_len,
const u8 *nonce_mt, u16 selected_version,
const u8 *ver_list, size_t ver_list_len, int num_chal,
const u8 *kc, u8 *mk) {
const unsigned char *addr[5];
size_t len[6];
u8 sel_ver[2];
... | void eap_sim_derive_mk(const u8 *identity, size_t identity_len,
const u8 *nonce_mt, u16 selected_version,
const u8 *ver_list, size_t ver_list_len, int num_chal,
const u8 *kc, u8 *mk) {
u8 sel_ver[2];
const unsigned char *addr[5];
size_t len[5];
... | eap_sim_derive_mk | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
u8 *eap_sim_getKey(eap_sm *sm, void *priv, size_t *len) {
u8 *key;
if (*((_DWORD *)priv + 79) != 4)
return 0;
key = (u8 *)os_memdup((char *)priv + 84, 0x40u);
if (!key)
return 0;
*len = 64;
return key;
} | static u8 *eap_sim_getKey(struct eap_sm *sm, void *priv, size_t *len) {
struct eap_sim_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_sim_getKey | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
u8 *eap_sim_get_emsk(eap_sm *sm, void *priv, size_t *len) {
u8 *key;
if (*((_DWORD *)priv + 79) != 4)
return 0;
key = (u8 *)os_memdup((char *)priv + 148, 0x40u);
if (!key)
return 0;
*len = 64;
return key;
} | static u8 *eap_sim_get_emsk(struct eap_sm *sm, void *priv, size_t *len) {
struct eap_sim_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_sim_get_emsk | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
u8 *eap_sim_get_session_id(eap_sm *sm, void *priv, size_t *len) {
u8 *v4;
long v5;
long v6;
long v7;
u8 *id;
if (*((_DWORD *)priv + 79) != 4)
return 0;
if (*((_QWORD *)priv + 43))
*len = 33;
else
*len = 16 * *((_DWORD *)priv + 78) + 17;
id = (u8 *)malloc(*len);
if (!id)
return 0;
... | static u8 *eap_sim_get_session_id(struct eap_sm *sm, void *priv, size_t *len) {
struct eap_sim_data *data = priv;
u8 *id;
if (data->state != SUCCESS)
return NULL;
if (!data->reauth)
*len = 1 + data->num_chal * GSM_RAND_LEN + EAP_SIM_NONCE_MT_LEN;
else
*len = 1 + EAP_SIM_NONCE_S_LEN + EAP_SIM_MAC... | eap_sim_get_session_id | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void *eap_sim_init(eap_sm *sm) {
eap_sim_data *data;
if (sm->cfg->eap_sim_db_priv) {
data = (eap_sim_data *)os_zalloc(0x180u);
if (data) {
data->state = 0;
return data;
} else {
return 0;
}
} else {
wpa_printf(4, "EAP-SIM: eap_sim_db not configured");
return 0;
}
} | static void *eap_sim_init(struct eap_sm *sm) {
struct eap_sim_data *data;
if (!sm->cfg->eap_sim_db_priv) {
wpa_printf(MSG_WARNING, "EAP-SIM: eap_sim_db not configured");
return NULL;
}
data = os_zalloc(sizeof(*data));
if (data == NULL)
return NULL;
data->state = START;
return data;
} | eap_sim_init | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
bool eap_sim_isDone(eap_sm *sm, void *priv) {
return *((_DWORD *)priv + 79) == 4 || *((_DWORD *)priv + 79) == 5;
} | static bool eap_sim_isDone(struct eap_sm *sm, void *priv) {
struct eap_sim_data *data = priv;
return data->state == SUCCESS || data->state == FAILURE;
} | eap_sim_isDone | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
bool eap_sim_isSuccess(eap_sm *sm, void *priv) {
return *((_DWORD *)priv + 79) == 4;
} | static bool eap_sim_isSuccess(struct eap_sm *sm, void *priv) {
struct eap_sim_data *data = priv;
return data->state == SUCCESS;
} | eap_sim_isSuccess | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
u8 *eap_sim_msg_add(eap_sim_msg *msg, u8 attr, u16 value, const u8 *data,
size_t len) {
void *v6;
int attr_len;
int attr_lena;
int pad_len;
u8 *start;
attr_len = len + 4;
if (!msg)
return 0;
pad_len = (4 - attr_len % 4) % 4;
attr_lena = pad_len + attr_len;
if (wpabuf_resize(... | u8 *eap_sim_msg_add(struct eap_sim_msg *msg, u8 attr, u16 value, const u8 *data,
size_t len) {
int attr_len = 4 + len;
int pad_len;
u8 *start;
if (msg == NULL)
return NULL;
pad_len = (4 - attr_len % 4) % 4;
attr_len += pad_len;
if (wpabuf_resize(&msg->buf, attr_len))
return N... | eap_sim_msg_add | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int eap_sim_msg_add_encr_end(eap_sim_msg *msg, u8 *k_encr, int attr_pad) {
size_t v4;
size_t encr;
u8 *v6;
const u8 *v7;
u8 attr_pada;
int pad_len;
unsigned long encr_len;
u8 *pos;
attr_pada = attr_pad;
if (!msg || !k_encr || !msg->iv || !msg->encr)
return -1;
v4 = wpabuf_len_27(msg->buf);
... | int eap_sim_msg_add_encr_end(struct eap_sim_msg *msg, u8 *k_encr,
int attr_pad) {
size_t encr_len;
if (msg == NULL || k_encr == NULL || msg->iv == 0 || msg->encr == 0)
return -1;
encr_len = wpabuf_len(msg->buf) - msg->encr - 4;
if (encr_len % 16) {
u8 *pos;
int pad_len... | eap_sim_msg_add_encr_end | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int eap_sim_msg_add_encr_start(eap_sim_msg *msg, u8 attr_iv, u8 attr_encr) {
u8 *v4;
u8 *pos;
u8 *posa;
pos = eap_sim_msg_add(msg, attr_iv, 0, 0, 0x10u);
if (!pos)
return -1;
msg->iv = pos - wpabuf_head_u8_4(msg->buf) + 4;
v4 = wpabuf_mhead_u8_2(msg->buf);
if (random_get_bytes(&v4[msg->iv], 0x10u))... | int eap_sim_msg_add_encr_start(struct eap_sim_msg *msg, u8 attr_iv,
u8 attr_encr) {
u8 *pos = eap_sim_msg_add(msg, attr_iv, 0, NULL, EAP_SIM_IV_LEN);
if (pos == NULL)
return -1;
msg->iv = (pos - wpabuf_head_u8(msg->buf)) + 4;
if (random_get_bytes(wpabuf_mhead_u8(msg->buf) + ms... | eap_sim_msg_add_encr_start | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
u8 *eap_sim_msg_add_full(eap_sim_msg *msg, u8 attr, const u8 *data,
size_t len) {
void *v5;
int attr_len;
int attr_lena;
int pad_len;
u8 *start;
attr_len = len + 2;
if (!msg)
return 0;
pad_len = (4 - attr_len % 4) % 4;
attr_lena = pad_len + attr_len;
if (wpabuf_resize(&... | u8 *eap_sim_msg_add_full(struct eap_sim_msg *msg, u8 attr, const u8 *data,
size_t len) {
int attr_len = 2 + len;
int pad_len;
u8 *start;
if (msg == NULL)
return NULL;
pad_len = (4 - attr_len % 4) % 4;
attr_len += pad_len;
if (wpabuf_resize(&msg->buf, attr_len))
return NU... | eap_sim_msg_add_full | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
u8 *eap_sim_msg_add_mac(eap_sim_msg *msg, u8 attr) {
u8 *pos;
pos = eap_sim_msg_add(msg, attr, 0, 0, 0x10u);
if (pos)
msg->mac = pos - wpabuf_head_u8_4(msg->buf) + 4;
return pos;
} | u8 *eap_sim_msg_add_mac(struct eap_sim_msg *msg, u8 attr) {
u8 *pos = eap_sim_msg_add(msg, attr, 0, NULL, EAP_SIM_MAC_LEN);
if (pos)
msg->mac = (pos - wpabuf_head_u8(msg->buf)) + 4;
return pos;
} | eap_sim_msg_add_mac | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
wpabuf *eap_sim_msg_finish(eap_sim_msg *msg, int type, const u8 *k_aut,
const u8 *extra, size_t extra_len) {
__uint16_t v6;
u8 *v7;
size_t v8;
const u8 *v9;
u8 *v10;
size_t v11;
const u8 *v12;
eap_hdr *eap;
wpabuf *buf;
if (!msg)
return 0;
eap = (eap_hdr *)wpabuf_mh... | struct wpabuf *eap_sim_msg_finish(struct eap_sim_msg *msg, int type,
const u8 *k_aut, const u8 *extra,
size_t extra_len) {
struct eap_hdr *eap;
struct wpabuf *buf;
if (msg == NULL)
return NULL;
eap = wpabuf_mhead(msg->buf);
eap->length ... | eap_sim_msg_finish | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_sim_msg_free(eap_sim_msg *msg) {
if (msg) {
wpabuf_free(msg->buf);
free(msg);
}
} | void eap_sim_msg_free(struct eap_sim_msg *msg) {
if (msg) {
wpabuf_free(msg->buf);
os_free(msg);
}
} | eap_sim_msg_free | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
eap_sim_msg *eap_sim_msg_init(int code, int id, int type, int subtype) {
_BYTE *v5;
char subtypea;
char typea;
eap_sim_msg *msg;
eap_hdr *eap;
typea = type;
subtypea = subtype;
msg = (eap_sim_msg *)os_zalloc(0x20u);
if (!msg)
return 0;
msg->buf = wpabuf_alloc(0x80u);
if (msg->buf) {
eap =... | struct eap_sim_msg *eap_sim_msg_init(int code, int id, int type, int subtype) {
struct eap_sim_msg *msg;
struct eap_hdr *eap;
u8 *pos;
msg = os_zalloc(sizeof(*msg));
if (msg == NULL)
return NULL;
msg->buf = wpabuf_alloc(EAP_SIM_INIT_LEN);
if (msg->buf == NULL) {
os_free(msg);
return NULL;
... | eap_sim_msg_init | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int eap_sim_parse_attr(const u8 *start, const u8 *end, eap_sim_attrs *attr,
int aka, int encr) {
size_t kdf_count;
size_t i;
const u8 *apos;
size_t alen;
size_t alena;
size_t alenb;
size_t alenc;
size_t alend;
size_t alene;
size_t alenf;
size_t plen;
unsigned long plena;
... | int eap_sim_parse_attr(const u8 *start, const u8 *end,
struct eap_sim_attrs *attr, int aka, int encr) {
const u8 *pos = start, *apos;
size_t alen, plen, i, list_len;
os_memset(attr, 0, sizeof(*attr));
attr->id_req = NO_ID_REQ;
attr->notification = -1;
attr->counter = -1;
attr->sele... | eap_sim_parse_attr | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
u8 *eap_sim_parse_encr(const u8 *k_encr, const u8 *encr_data,
size_t encr_data_len, const u8 *iv, eap_sim_attrs *attr,
int aka) {
u8 *decrypted;
if (iv) {
decrypted = (u8 *)os_memdup(encr_data, encr_data_len);
if (decrypted) {
if (aes_128_cbc_decrypt(k_en... | u8 *eap_sim_parse_encr(const u8 *k_encr, const u8 *encr_data,
size_t encr_data_len, const u8 *iv,
struct eap_sim_attrs *attr, int aka) {
u8 *decrypted;
if (!iv) {
wpa_printf(MSG_INFO, "EAP-SIM: Encrypted data, but no IV");
return NULL;
}
decrypted = os_mem... | eap_sim_parse_encr | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int eap_sim_prf(const u8 *key, u8 *x, size_t xlen) {
return fips186_2_prf(key, 0x14u, x, xlen);
} | static int eap_sim_prf(const u8 *key, u8 *x, size_t xlen) {
return fips186_2_prf(key, EAP_SIM_MK_LEN, x, xlen);
} | eap_sim_prf | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_sim_process(eap_sm *sm, void *priv, wpabuf *respData) {
eap_sim_data_$D911041CB4356E9AFD7B12F90D0C2700 state;
u8 subtype;
size_t len;
eap_sim_data *data;
const u8 *pos;
const u8 *end;
eap_sim_attrs attr;
unsigned long v11;
v11 = __readfsqword(0x28u);
data = (eap_sim_data *)priv;
pos = ea... | static void eap_sim_process(struct eap_sm *sm, void *priv,
struct wpabuf *respData) {
struct eap_sim_data *data = priv;
const u8 *pos, *end;
u8 subtype;
size_t len;
struct eap_sim_attrs attr;
pos = eap_hdr_validate(EAP_VENDOR_IETF, EAP_TYPE_SIM, respData, &len);
if (pos == NUL... | eap_sim_process | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_sim_process_challenge(eap_sm *sm, eap_sim_data *data, wpabuf *respData,
eap_sim_attrs *attr) {
if (attr->mac && !eap_sim_verify_mac(data->k_aut, respData, attr->mac,
data->sres[0], 4 * data->num_chal)) {
wpa_printf(2, "EAP-SIM: Challen... | static void eap_sim_process_challenge(struct eap_sm *sm,
struct eap_sim_data *data,
struct wpabuf *respData,
struct eap_sim_attrs *attr) {
if (attr->mac == NULL ||
eap_sim_verify_mac(data->k_aut, re... | eap_sim_process_challenge | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_sim_process_client_error(eap_sm *sm, eap_sim_data *data,
wpabuf *respData, eap_sim_attrs *attr) {
wpa_printf(2, "EAP-SIM: Client reported error %d", attr->client_error_code);
if (data->notification == 0x8000 && data->use_result_ind)
eap_sim_state(data, 4);
else
e... | static void eap_sim_process_client_error(struct eap_sm *sm,
struct eap_sim_data *data,
struct wpabuf *respData,
struct eap_sim_attrs *attr) {
wpa_printf(MSG_DEBUG, "EAP-SIM: Client reported error... | eap_sim_process_client_error | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_sim_process_notification(eap_sm *sm, eap_sim_data *data,
wpabuf *respData, eap_sim_attrs *attr) {
wpa_printf(2, "EAP-SIM: Client replied to notification");
if (data->notification == 0x8000 && data->use_result_ind)
eap_sim_state(data, 4);
else
eap_sim_state(data, ... | static void eap_sim_process_notification(struct eap_sm *sm,
struct eap_sim_data *data,
struct wpabuf *respData,
struct eap_sim_attrs *attr) {
wpa_printf(MSG_DEBUG, "EAP-SIM: Client replied to not... | eap_sim_process_notification | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_sim_process_reauth(eap_sm *sm, eap_sim_data *data, wpabuf *respData,
eap_sim_attrs *attr) {
u8 *decrypted;
eap_sim_attrs eattr;
unsigned long v7;
v7 = __readfsqword(0x28u);
decrypted = 0;
if (!attr->mac || eap_sim_verify_mac(data->k_aut, respData, attr->mac,
... | static void eap_sim_process_reauth(struct eap_sm *sm, struct eap_sim_data *data,
struct wpabuf *respData,
struct eap_sim_attrs *attr) {
struct eap_sim_attrs eattr;
u8 *decrypted = NULL;
if (attr->mac == NULL ||
eap_sim_verify_mac(data->k... | eap_sim_process_reauth | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_sim_process_start(eap_sm *sm, eap_sim_data *data, wpabuf *respData,
eap_sim_attrs *attr) {
const u8 *nonce_mt;
long v5;
size_t identity_len;
u8 *new_identity;
char *username;
const char *permanent;
u8 ver_list[2];
unsigned long v12;
v12 = __readfsqword(0x28u);
wp... | static void eap_sim_process_start(struct eap_sm *sm, struct eap_sim_data *data,
struct wpabuf *respData,
struct eap_sim_attrs *attr) {
size_t identity_len;
u8 ver_list[2];
u8 *new_identity;
char *username;
wpa_printf(MSG_DEBUG, "EAP-SIM: Rec... | eap_sim_process_start | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_sim_report_notification(void *msg_ctx, int notification, int aka) {
const char *v3;
if (aka)
v3 = "AKA";
else
v3 = "SIM";
if (notification == 0x8000) {
wpa_printf(3, "EAP-%s: Successful authentication notification", v3);
} else {
if (notification <= 0x8000) {
if (notification =... | void eap_sim_report_notification(void *msg_ctx, int notification, int aka) {
#ifndef CONFIG_NO_STDOUT_DEBUG
const char *type = aka ? "AKA" : "SIM";
#endif
switch (notification) {
case EAP_SIM_GENERAL_FAILURE_AFTER_AUTH:
wpa_printf(MSG_WARNING,
"EAP-%s: General failure "
"notific... | eap_sim_report_notification | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_sim_reset(eap_sm *sm, void *priv) {
free(*((void **)priv + 40));
free(*((void **)priv + 41));
bin_clear_free(priv, 0x180u);
} | static void eap_sim_reset(struct eap_sm *sm, void *priv) {
struct eap_sim_data *data = priv;
os_free(data->next_pseudonym);
os_free(data->next_reauth_id);
bin_clear_free(data, sizeof(*data));
} | eap_sim_reset | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_sim_state(eap_sim_data *data, int state) {
const char *v2;
const char *v3;
v2 = eap_sim_state_txt(state);
v3 = eap_sim_state_txt(data->state);
wpa_printf(2, "EAP-SIM: %s -> %s", v3, v2);
data->state = state;
} | static void eap_sim_state(struct eap_sim_data *data, int state) {
wpa_printf(MSG_DEBUG, "EAP-SIM: %s -> %s", eap_sim_state_txt(data->state),
eap_sim_state_txt(state));
data->state = state;
} | eap_sim_state | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
const char *eap_sim_state_txt(int state) {
const char *result;
switch (state) {
case 0:
result = "START";
break;
case 1:
result = "CHALLENGE";
break;
case 2:
result = "REAUTH";
break;
case 3:
result = "NOTIFICATION";
break;
case 4:
result = "SUCCESS";
break;
case... | static const char *eap_sim_state_txt(int state) {
switch (state) {
case START:
return "START";
case CHALLENGE:
return "CHALLENGE";
case REAUTH:
return "REAUTH";
case SUCCESS:
return "SUCCESS";
case FAILURE:
return "FAILURE";
case NOTIFICATION:
return "NOTIFICATION";
default:
... | eap_sim_state_txt | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int eap_sim_supported_ver(eap_sim_data *data, int version) {
return version == 1;
} | static int eap_sim_supported_ver(struct eap_sim_data *data, int version) {
return version == EAP_SIM_VERSION;
} | eap_sim_supported_ver | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
bool eap_sim_unexpected_subtype(eap_sim_data *data, u8 subtype) {
eap_sim_data_$D911041CB4356E9AFD7B12F90D0C2700 state;
if (subtype == 14)
return 0;
state = data->state;
if (state == NOTIFICATION) {
if (subtype != 12) {
LABEL_14:
wpa_printf(3, "EAP-SIM: Unexpected response subtype %d", subtyp... | static bool eap_sim_unexpected_subtype(struct eap_sim_data *data, u8 subtype) {
if (subtype == EAP_SIM_SUBTYPE_CLIENT_ERROR)
return false;
switch (data->state) {
case START:
if (subtype != EAP_SIM_SUBTYPE_START) {
wpa_printf(MSG_INFO,
"EAP-SIM: Unexpected response "
... | eap_sim_unexpected_subtype | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int eap_sim_verify_mac(const u8 *k_aut, const wpabuf *req, const u8 *mac,
const u8 *extra, size_t extra_len) {
const u8 *v5;
size_t v7;
const void *v8;
const u8 *v9;
size_t v10;
u8 *tmp;
const u8 *addr[2];
size_t len[2];
u8 hmac[24];
unsigned long v18;
v18 = __readfsqword(0... | int eap_sim_verify_mac(const u8 *k_aut, const struct wpabuf *req, const u8 *mac,
const u8 *extra, size_t extra_len) {
unsigned char hmac[SHA1_MAC_LEN];
const u8 *addr[2];
size_t len[2];
u8 *tmp;
if (mac == NULL || wpabuf_len(req) < EAP_SIM_MAC_LEN ||
mac < wpabuf_head_u8(req) ||
... | eap_sim_verify_mac | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int eap_sim_verify_mac_sha256(const u8 *k_aut, const wpabuf *req, const u8 *mac,
const u8 *extra, size_t extra_len) {
const u8 *v5;
size_t v7;
const void *v8;
const u8 *v9;
size_t v10;
u8 *tmp;
const u8 *addr[2];
size_t len[2];
u8 hmac[40];
unsigned long v18;
v18 = _... | int eap_sim_verify_mac_sha256(const u8 *k_aut, const struct wpabuf *req,
const u8 *mac, const u8 *extra,
size_t extra_len) {
unsigned char hmac[SHA256_MAC_LEN];
const u8 *addr[2];
size_t len[2];
u8 *tmp;
if (mac == NULL || wpabuf_len(req) < EAP_SIM_... | eap_sim_verify_mac_sha256 | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
bool eap_sm_Policy_doPickUp(eap_sm *sm, eap_type method) {
return method == eap_type_EAP_TYPE_IDENTITY;
} | static bool eap_sm_Policy_doPickUp(struct eap_sm *sm, enum eap_type method) {
return method == EAP_TYPE_IDENTITY;
} | eap_sm_Policy_doPickUp | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int eap_sm_Policy_getDecision(eap_sm *sm) {
_BOOL4 id_req;
if (!sm->cfg->eap_server && sm->identity && !sm->start_reauth) {
wpa_printf(2, "EAP: getDecision: -> PASSTHROUGH");
return 3;
}
if (sm->m && sm->currentMethod != eap_type_EAP_TYPE_IDENTITY &&
sm->m->isSuccess(sm, sm->eap_method_priv)) {
... | static int eap_sm_Policy_getDecision(struct eap_sm *sm) {
if (!sm->cfg->eap_server && sm->identity && !sm->start_reauth) {
wpa_printf(MSG_DEBUG, "EAP: getDecision: -> PASSTHROUGH");
return DECISION_PASSTHROUGH;
}
if (sm->m && sm->currentMethod != EAP_TYPE_IDENTITY &&
sm->m->isSuccess(sm, sm->eap_me... | eap_sm_Policy_getDecision | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
eap_type eap_sm_Policy_getNextMethod(eap_sm *sm, int *vendor) {
u32 next;
int idx;
idx = sm->user_eap_method_index;
if (sm->identity && sm->currentId != -1) {
if (sm->user && idx <= 7 &&
(sm->user->methods[idx].vendor || sm->user->methods[idx].method)) {
*vendor = sm->user->methods[idx].vendo... | static enum eap_type eap_sm_Policy_getNextMethod(struct eap_sm *sm,
int *vendor) {
enum eap_type next;
int idx = sm->user_eap_method_index;
if (sm->identity == NULL || sm->currentId == -1) {
*vendor = EAP_VENDOR_IETF;
next = EAP_TYPE_IDENTITY;
sm->upda... | eap_sm_Policy_getNextMethod | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_sm_Policy_update(eap_sm *sm, const u8 *nak_list, size_t len) {
if (nak_list && sm && sm->user) {
if (sm->user->phase2) {
wpa_printf(
2,
"EAP: EAP-Nak received after Phase2 user info was selected - reject");
sm->decision = DECISION_FAILURE;
} else {
eap_sm_process... | static void eap_sm_Policy_update(struct eap_sm *sm, const u8 *nak_list,
size_t len) {
if (nak_list == NULL || sm == NULL || sm->user == NULL)
return;
if (sm->user->phase2) {
wpa_printf(MSG_DEBUG, "EAP: EAP-Nak received after Phase2 user"
" info was... | eap_sm_Policy_update | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
wpabuf *eap_sm_buildFailure(eap_sm *sm, u8 id) {
wpabuf *msg;
eap_hdr *resp;
wpa_printf(2, "EAP: Building EAP-Failure (id=%d)", id);
msg = wpabuf_alloc(4u);
if (!msg)
return 0;
resp = (eap_hdr *)wpabuf_put(msg, 4u);
resp->code = 4;
resp->identifier = id;
resp->length = _bswap_16_12(4u);
return ... | static struct wpabuf *eap_sm_buildFailure(struct eap_sm *sm, u8 id) {
struct wpabuf *msg;
struct eap_hdr *resp;
wpa_printf(MSG_DEBUG, "EAP: Building EAP-Failure (id=%d)", id);
msg = wpabuf_alloc(sizeof(*resp));
if (msg == NULL)
return NULL;
resp = wpabuf_put(msg, sizeof(*resp));
resp->code = EAP_CODE... | eap_sm_buildFailure | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
wpabuf *eap_sm_buildInitiateReauthStart(eap_sm *sm, u8 id) {
size_t plen;
size_t domain_len;
const char *domain;
wpabuf *msg;
plen = 1;
domain_len = 0;
domain = eap_get_erp_domain(sm);
if (domain) {
domain_len = strlen(domain);
plen = domain_len + 3;
}
msg = eap_msg_alloc(0, eap_type_EAP_TY... | static struct wpabuf *eap_sm_buildInitiateReauthStart(struct eap_sm *sm,
u8 id) {
const char *domain;
size_t plen = 1;
struct wpabuf *msg;
size_t domain_len = 0;
domain = eap_get_erp_domain(sm);
if (domain) {
domain_len = os_strlen(domain);
plen... | eap_sm_buildInitiateReauthStart | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
wpabuf *eap_sm_buildSuccess(eap_sm *sm, u8 id) {
wpabuf *msg;
eap_hdr *resp;
wpa_printf(2, "EAP: Building EAP-Success (id=%d)", id);
msg = wpabuf_alloc(4u);
if (!msg)
return 0;
resp = (eap_hdr *)wpabuf_put(msg, 4u);
resp->code = 3;
resp->identifier = id;
resp->length = _bswap_16_12(4u);
return ... | static struct wpabuf *eap_sm_buildSuccess(struct eap_sm *sm, u8 id) {
struct wpabuf *msg;
struct eap_hdr *resp;
wpa_printf(MSG_DEBUG, "EAP: Building EAP-Success (id=%d)", id);
msg = wpabuf_alloc(sizeof(*resp));
if (msg == NULL)
return NULL;
resp = wpabuf_put(msg, sizeof(*resp));
resp->code = EAP_CODE... | eap_sm_buildSuccess | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int eap_sm_calculateTimeout(eap_sm *sm, int retransCount, int eapSRTT,
int eapRTTVAR, int methodTimeout) {
int rto;
int i;
if (sm->try_initiate_reauth) {
wpa_printf(
2, "EAP: retransmit timeout 1 second for EAP-Initiate-Re-auth-Start");
return 1;
} else if (methodTim... | static int eap_sm_calculateTimeout(struct eap_sm *sm, int retransCount,
int eapSRTT, int eapRTTVAR,
int methodTimeout) {
int rto, i;
if (sm->try_initiate_reauth) {
wpa_printf(
MSG_DEBUG,
"EAP: retransmit timeout 1 second for ... | eap_sm_calculateTimeout | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int eap_sm_getId(const wpabuf *data) {
const eap_hdr *hdr;
if (!data || wpabuf_len_64(data) <= 3)
return -1;
hdr = (const eap_hdr *)wpabuf_head_64(data);
wpa_printf(2, "EAP: getId: id=%d", hdr->identifier);
return hdr->identifier;
} | static int eap_sm_getId(const struct wpabuf *data) {
const struct eap_hdr *hdr;
if (data == NULL || wpabuf_len(data) < sizeof(*hdr))
return -1;
hdr = wpabuf_head(data);
wpa_printf(MSG_DEBUG, "EAP: getId: id=%d", hdr->identifier);
return hdr->identifier;
} | eap_sm_getId | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int eap_sm_method_pending(eap_sm *sm) {
return sm && sm->method_pending == METHOD_PENDING_WAIT;
} | int eap_sm_method_pending(struct eap_sm *sm) {
if (sm == NULL)
return 0;
return sm->method_pending == METHOD_PENDING_WAIT;
} | eap_sm_method_pending | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
int eap_sm_nextId(eap_sm *sm, int id) {
int ida;
LOBYTE(ida) = id;
if (id >= 0)
return (unsigned char)(ida + 1);
ida = (unsigned char)rand();
if (ida == sm->lastId)
return (unsigned char)(ida + 1);
else
return ida;
} | static int eap_sm_nextId(struct eap_sm *sm, int id) {
if (id < 0) {
id = rand() & 0xff;
if (id != sm->lastId)
return id;
}
return (id + 1) & 0xff;
} | eap_sm_nextId | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_sm_notify_cached(eap_sm *sm) {
if (sm)
sm->EAP_state = EAP_SUCCESS;
} | void eap_sm_notify_cached(struct eap_sm *sm) {
if (sm == NULL)
return;
sm->EAP_state = EAP_SUCCESS;
} | eap_sm_notify_cached | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_sm_parseEapResp(eap_sm *sm, const wpabuf *resp) {
size_t v2;
size_t v3;
const eap_hdr *hdr;
size_t plen;
sm->rxResp = 0;
sm->rxInitiate = 0;
sm->respId = -1;
sm->respMethod = eap_type_EAP_TYPE_NONE;
sm->respVendor = 0;
sm->respVendorMethod = 0;
if (resp && wpabuf_len_64(resp) > 3) {
... | static void eap_sm_parseEapResp(struct eap_sm *sm, const struct wpabuf *resp) {
const struct eap_hdr *hdr;
size_t plen;
sm->rxResp = false;
sm->rxInitiate = false;
sm->respId = -1;
sm->respMethod = EAP_TYPE_NONE;
sm->respVendor = EAP_VENDOR_IETF;
sm->respVendorMethod = EAP_TYPE_NONE;
if (resp == NUL... | eap_sm_parseEapResp | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_sm_pending_cb(eap_sm *sm) {
if (sm) {
wpa_printf(2, "EAP: Callback for pending request received");
if (sm->method_pending == METHOD_PENDING_WAIT)
sm->method_pending = METHOD_PENDING_CONT;
}
} | void eap_sm_pending_cb(struct eap_sm *sm) {
if (sm == NULL)
return;
wpa_printf(MSG_DEBUG, "EAP: Callback for pending request received");
if (sm->method_pending == METHOD_PENDING_WAIT)
sm->method_pending = METHOD_PENDING_CONT;
} | eap_sm_pending_cb | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_sm_process_nak(eap_sm *sm, const u8 *nak_list, size_t len) {
int i;
size_t j;
if (sm->user) {
wpa_printf(1, "EAP: processing NAK (current EAP method index %d)",
sm->user_eap_method_index);
wpa_hexdump(1, "EAP: configured methods", sm->user, 0x40u);
wpa_hexdump(1, "EAP: list of... | void eap_sm_process_nak(struct eap_sm *sm, const u8 *nak_list, size_t len) {
int i;
size_t j;
if (sm->user == NULL)
return;
wpa_printf(MSG_MSGDUMP,
"EAP: processing NAK (current EAP method "
"index %d)",
sm->user_eap_method_index);
wpa_hexdump(MSG_MSGDUMP, "EAP: c... | eap_sm_process_nak | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
wpabuf *eap_tls_buildReq(eap_sm *sm, void *priv, u8 id) {
int v4;
size_t v5;
wpabuf *res;
u8 user[136];
unsigned long v9;
v9 = __readfsqword(0x28u);
if (*((_DWORD *)priv + 14) == 1)
return eap_server_tls_build_ack(id, *((unsigned char *)priv + 112), 0);
if (*((_DWORD *)priv + 14) != 2) {
v4 = *... | static struct wpabuf *eap_tls_buildReq(struct eap_sm *sm, void *priv, u8 id) {
struct eap_tls_data *data = priv;
struct wpabuf *res;
if (data->ssl.state == FRAG_ACK) {
return eap_server_tls_build_ack(id, data->eap_type, 0);
}
if (data->ssl.state == WAIT_FRAG_ACK) {
res = eap_server_tls_build_msg(&da... | eap_tls_buildReq | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
wpabuf *eap_tls_build_start(eap_sm *sm, eap_tls_data *data, u8 id) {
wpabuf *req;
req = eap_tls_msg_alloc((eap_type)data->eap_type, 1u, 1u, id);
if (req) {
wpabuf_put_u8_7(req, 0x20u);
eap_tls_state(data, 1);
return req;
} else {
wpa_printf(5, "EAP-TLS: Failed to allocate memory for request");
... | static struct wpabuf *eap_tls_build_start(struct eap_sm *sm,
struct eap_tls_data *data, u8 id) {
struct wpabuf *req;
req = eap_tls_msg_alloc(data->eap_type, 1, EAP_CODE_REQUEST, id);
if (req == NULL) {
wpa_printf(MSG_ERROR, "EAP-TLS: Failed to allocate memory for "
... | eap_tls_build_start | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
bool eap_tls_check(eap_sm *sm, void *priv, wpabuf *respData) {
size_t len;
const u8 *pos;
eap_tls_data *data;
unsigned long v7;
v7 = __readfsqword(0x28u);
data = (eap_tls_data *)priv;
if (*((_BYTE *)priv + 112) == 0xFF) {
pos = eap_hdr_validate(39068, eap_type_EAP_TYPE_IDENTITY, respData, &len);
} ... | static bool eap_tls_check(struct eap_sm *sm, void *priv,
struct wpabuf *respData) {
struct eap_tls_data *data = priv;
const u8 *pos;
size_t len;
if (data->eap_type == EAP_UNAUTH_TLS_TYPE)
pos = eap_hdr_validate(EAP_VENDOR_UNAUTH_TLS, EAP_VENDOR_TYPE_UNAUTH_TLS,
... | eap_tls_check | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
u8 *eap_tls_getKey(eap_sm *sm, void *priv, size_t *len) {
const char *label;
u8 *context;
size_t context_len;
u8 *eapKeyData;
u8 eap_tls13_context[1];
unsigned long v10;
v10 = __readfsqword(0x28u);
eap_tls13_context[0] = 13;
context = 0;
context_len = 0;
if (*((_DWORD *)priv + 26) != 2)
retur... | static u8 *eap_tls_getKey(struct eap_sm *sm, void *priv, size_t *len) {
struct eap_tls_data *data = priv;
u8 *eapKeyData;
const char *label;
const u8 eap_tls13_context[] = {EAP_TYPE_TLS};
const u8 *context = NULL;
size_t context_len = 0;
if (data->state != SUCCESS)
return NULL;
if (data->ssl.tls_v... | eap_tls_getKey | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
u8 *eap_tls_get_emsk(eap_sm *sm, void *priv, size_t *len) {
u8 *emsk;
const char *label;
u8 *context;
size_t context_len;
u8 *eapKeyData;
u8 eap_tls13_context[1];
unsigned long v11;
v11 = __readfsqword(0x28u);
eap_tls13_context[0] = 13;
context = 0;
context_len = 0;
if (*((_DWORD *)priv + 26) !... | static u8 *eap_tls_get_emsk(struct eap_sm *sm, void *priv, size_t *len) {
struct eap_tls_data *data = priv;
u8 *eapKeyData, *emsk;
const char *label;
const u8 eap_tls13_context[] = {EAP_TYPE_TLS};
const u8 *context = NULL;
size_t context_len = 0;
if (data->state != SUCCESS)
return NULL;
if (data->... | eap_tls_get_emsk | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
u8 *eap_tls_get_session_id(eap_sm *sm, void *priv, size_t *len) {
if (*((_DWORD *)priv + 26) == 2)
return eap_server_tls_derive_session_id(sm, (eap_ssl_data *)priv, 0xDu,
len);
else
return 0;
} | static u8 *eap_tls_get_session_id(struct eap_sm *sm, void *priv, size_t *len) {
struct eap_tls_data *data = priv;
if (data->state != SUCCESS)
return NULL;
return eap_server_tls_derive_session_id(sm, &data->ssl, EAP_TYPE_TLS, len);
} | eap_tls_get_session_id | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void *eap_tls_init(eap_sm *sm) {
eap_tls_data *data;
data = (eap_tls_data *)os_zalloc(0x78u);
if (!data)
return 0;
data->state = START;
if (eap_server_tls_ssl_init(sm, &data->ssl, 1, 13)) {
wpa_printf(3, "EAP-TLS: Failed to initialize SSL.");
eap_tls_reset(sm, data);
return 0;
} else {
... | static void *eap_tls_init(struct eap_sm *sm) {
struct eap_tls_data *data;
data = os_zalloc(sizeof(*data));
if (data == NULL)
return NULL;
data->state = START;
if (eap_server_tls_ssl_init(sm, &data->ssl, 1, EAP_TYPE_TLS)) {
wpa_printf(MSG_INFO, "EAP-TLS: Failed to initialize SSL.");
eap_tls_reset... | eap_tls_init | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
bool eap_tls_isDone(eap_sm *sm, void *priv) {
return *((_DWORD *)priv + 26) == 2 || *((_DWORD *)priv + 26) == 3;
} | static bool eap_tls_isDone(struct eap_sm *sm, void *priv) {
struct eap_tls_data *data = priv;
return data->state == SUCCESS || data->state == FAILURE;
} | eap_tls_isDone | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
bool eap_tls_isSuccess(eap_sm *sm, void *priv) {
return *((_DWORD *)priv + 26) == 2;
} | static bool eap_tls_isSuccess(struct eap_sm *sm, void *priv) {
struct eap_tls_data *data = priv;
return data->state == SUCCESS;
} | eap_tls_isSuccess | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
wpabuf *eap_tls_msg_alloc(eap_type type, size_t payload_len, u8 code,
u8 identifier) {
if (type == (eap_type_EAP_TYPE_EXPANDED | eap_type_EAP_TYPE_IDENTITY))
return eap_msg_alloc(39068, eap_type_EAP_TYPE_IDENTITY, payload_len, code,
identifier);
if (type == eap... | struct wpabuf *eap_tls_msg_alloc(enum eap_type type, size_t payload_len,
u8 code, u8 identifier) {
if (type == EAP_UNAUTH_TLS_TYPE)
return eap_msg_alloc(EAP_VENDOR_UNAUTH_TLS, EAP_VENDOR_TYPE_UNAUTH_TLS,
payload_len, code, identifier);
else if (type == E... | eap_tls_msg_alloc | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_tls_process(eap_sm *sm, void *priv, wpabuf *respData) {
const wpabuf *buf;
const u8 *pos;
if (eap_server_tls_process(
sm, (eap_ssl_data *)priv, respData, priv,
*((unsigned char *)priv + 112), 0,
(void (*)(eap_sm *, void *, const wpabuf *))eap_tls_process_msg) >=
0) {
... | static void eap_tls_process(struct eap_sm *sm, void *priv,
struct wpabuf *respData) {
struct eap_tls_data *data = priv;
const struct wpabuf *buf;
const u8 *pos;
if (eap_server_tls_process(sm, &data->ssl, respData, data, data->eap_type,
NULL, eap_tls_proc... | eap_tls_process | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_tls_process_msg(eap_sm *sm, void *priv, const wpabuf *respData) {
if (*((_DWORD *)priv + 26) != 2 ||
wpabuf_len_21(*((const wpabuf **)priv + 4))) {
if (eap_server_tls_phase1(sm, (eap_ssl_data *)priv) < 0)
eap_tls_state((eap_tls_data *)priv, 3);
} else {
wpa_printf(2, "EAP-TLS: Client ac... | static void eap_tls_process_msg(struct eap_sm *sm, void *priv,
const struct wpabuf *respData) {
struct eap_tls_data *data = priv;
if (data->state == SUCCESS && wpabuf_len(data->ssl.tls_in) == 0) {
wpa_printf(MSG_DEBUG, "EAP-TLS: Client acknowledged final TLS "
... | eap_tls_process_msg | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_tls_reset(eap_sm *sm, void *priv) {
if (priv) {
eap_server_tls_ssl_deinit(sm, (eap_ssl_data *)priv);
free(priv);
}
} | static void eap_tls_reset(struct eap_sm *sm, void *priv) {
struct eap_tls_data *data = priv;
if (data == NULL)
return;
eap_server_tls_ssl_deinit(sm, &data->ssl);
os_free(data);
} | eap_tls_reset | hostapd-2.10 | net-wireless | O0/net-wireless/hostapd-2.10/hostapd | ida | O0 |
void eap_tls_state(eap_tls_data *data, int state) {
const char *v2;
const char *v3;
v2 = eap_tls_state_txt(state);
v3 = eap_tls_state_txt(data->state);
wpa_printf(2, "EAP-TLS: %s -> %s", v3, v2);
data->state = state;
if (state == 3)
tls_connection_remove_session(data->ssl.conn);
} | static void eap_tls_state(struct eap_tls_data *data, int state) {
wpa_printf(MSG_DEBUG, "EAP-TLS: %s -> %s", eap_tls_state_txt(data->state),
eap_tls_state_txt(state));
data->state = state;
if (state == FAILURE)
tls_connection_remove_session(data->ssl.conn);
} | eap_tls_state | 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.