11 #define EAP_SIM_PERMANENT_PREFIX '1'
12 #define EAP_SIM_PSEUDONYM_PREFIX '3'
13 #define EAP_SIM_REAUTH_ID_PREFIX '5'
14 #define EAP_AKA_PERMANENT_PREFIX '0'
15 #define EAP_AKA_PSEUDONYM_PREFIX '2'
16 #define EAP_AKA_REAUTH_ID_PREFIX '4'
17 #define EAP_AKA_PRIME_PERMANENT_PREFIX '6'
18 #define EAP_AKA_PRIME_PSEUDONYM_PREFIX '7'
19 #define EAP_AKA_PRIME_REAUTH_ID_PREFIX '8'
21 enum eap_sim_db_method {
31 void (*get_complete_cb)(
void *ctx,
void *session_ctx),
37 const char *username,
int max_chal,
38 u8 *_rand, u8 *kc, u8 *sres,
39 void *cb_session_ctx);
41 #define EAP_SIM_DB_FAILURE -1
42 #define EAP_SIM_DB_PENDING -2
45 enum eap_sim_db_method method);
48 enum eap_sim_db_method method);
51 const char *permanent,
char *pseudonym);
54 char *reauth_id, u16 counter,
const u8 *mk);
56 const char *permanent,
57 char *reauth_id, u16 counter,
const u8 *k_encr,
58 const u8 *k_aut,
const u8 *k_re);
61 const char *pseudonym);
68 u8 mk[EAP_SIM_MK_LEN];
69 u8 k_encr[EAP_SIM_K_ENCR_LEN];
70 u8 k_aut[EAP_AKA_PRIME_K_AUT_LEN];
71 u8 k_re[EAP_AKA_PRIME_K_RE_LEN];
76 const char *reauth_id);
82 u8 *_rand, u8 *autn, u8 *ik, u8 *ck,
83 u8 *res,
size_t *res_len,
void *cb_session_ctx);
86 const char *username,
const u8 *auts,
int eap_sim_db_resynchronize(struct eap_sim_db_data *data, const char *username, const u8 *auts, const u8 *_rand)
Resynchronize AKA AUTN.
Definition: eap_sim_db.c:1425
int eap_sim_db_add_pseudonym(struct eap_sim_db_data *data, const char *permanent, char *pseudonym)
EAP-SIM DB: Add new pseudonym.
Definition: eap_sim_db.c:1047
int eap_sim_db_add_reauth(struct eap_sim_db_data *data, const char *permanent, char *reauth_id, u16 counter, const u8 *mk)
EAP-SIM DB: Add new re-authentication entry.
Definition: eap_sim_db.c:1150
char * eap_sim_db_get_next_reauth_id(struct eap_sim_db_data *data, enum eap_sim_db_method method)
EAP-SIM DB: Get next reauth_id.
Definition: eap_sim_db.c:1014
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)
Get AKA authentication values.
Definition: eap_sim_db.c:1330
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)
Get GSM triplets.
Definition: eap_sim_db.c:863
Definition: eap_sim_db.c:56
EAP peer/server: EAP-SIM/AKA/AKA' shared routines.
void eap_sim_db_remove_reauth(struct eap_sim_db_data *data, struct eap_sim_reauth *reauth)
EAP-SIM DB: Remove re-authentication entry.
Definition: eap_sim_db.c:1280
struct eap_sim_reauth * eap_sim_db_get_reauth_entry(struct eap_sim_db_data *data, const char *reauth_id)
EAP-SIM DB: Get re-authentication entry.
Definition: eap_sim_db.c:1253
char * eap_sim_db_get_next_pseudonym(struct eap_sim_db_data *data, enum eap_sim_db_method method)
EAP-SIM DB: Get next pseudonym.
Definition: eap_sim_db.c:981
char * sim_get_username(const u8 *identity, size_t identity_len)
Extract username from SIM identity.
Definition: eap_sim_db.c:1486
Definition: eap_sim_db.h:63
struct eap_sim_db_data * eap_sim_db_init(const char *config, void(*get_complete_cb)(void *ctx, void *session_ctx), void *ctx)
Initialize EAP-SIM DB / authentication gateway interface.
Definition: eap_sim_db.c:694
const char * eap_sim_db_get_permanent(struct eap_sim_db_data *data, const char *pseudonym)
EAP-SIM DB: Get permanent identity.
Definition: eap_sim_db.c:1226
void eap_sim_db_deinit(void *priv)
Deinitialize EAP-SIM DB/authentication gw interface.
Definition: eap_sim_db.c:760