sim_card_t API gained support for pseudonym/fast reauthentication
This commit is contained in:
@@ -154,6 +154,10 @@ eap_aka_3gpp2_card_t *eap_aka_3gpp2_card_create(eap_aka_3gpp2_functions_t *f)
|
|||||||
this->public.card.get_triplet = (bool(*)(sim_card_t*, identification_t *imsi, char rand[SIM_RAND_LEN], char sres[SIM_SRES_LEN], char kc[SIM_KC_LEN]))return_false;
|
this->public.card.get_triplet = (bool(*)(sim_card_t*, identification_t *imsi, char rand[SIM_RAND_LEN], char sres[SIM_SRES_LEN], char kc[SIM_KC_LEN]))return_false;
|
||||||
this->public.card.get_quintuplet = (status_t(*)(sim_card_t*, identification_t *imsi, char rand[AKA_RAND_LEN], char autn[AKA_AUTN_LEN], char ck[AKA_CK_LEN], char ik[AKA_IK_LEN], char res[AKA_RES_LEN]))get_quintuplet;
|
this->public.card.get_quintuplet = (status_t(*)(sim_card_t*, identification_t *imsi, char rand[AKA_RAND_LEN], char autn[AKA_AUTN_LEN], char ck[AKA_CK_LEN], char ik[AKA_IK_LEN], char res[AKA_RES_LEN]))get_quintuplet;
|
||||||
this->public.card.resync = (bool(*)(sim_card_t*, identification_t *imsi, char rand[AKA_RAND_LEN], char auts[AKA_AUTS_LEN]))resync;
|
this->public.card.resync = (bool(*)(sim_card_t*, identification_t *imsi, char rand[AKA_RAND_LEN], char auts[AKA_AUTS_LEN]))resync;
|
||||||
|
this->public.card.get_pseudonym = (identification_t*(*)(sim_card_t*, identification_t *perm))return_null;
|
||||||
|
this->public.card.set_pseudonym = (void(*)(sim_card_t*, identification_t *perm, identification_t *pseudonym))nop;
|
||||||
|
this->public.card.get_reauth = (identification_t*(*)(sim_card_t*, identification_t *perm, char mk[HASH_SIZE_SHA1], u_int16_t *counter))return_null;
|
||||||
|
this->public.card.set_reauth = (void(*)(sim_card_t*, identification_t *perm, identification_t* next, char mk[HASH_SIZE_SHA1], u_int16_t counter))nop;
|
||||||
this->public.destroy = (void(*)(eap_aka_3gpp2_card_t*))destroy;
|
this->public.destroy = (void(*)(eap_aka_3gpp2_card_t*))destroy;
|
||||||
|
|
||||||
this->f = f;
|
this->f = f;
|
||||||
|
|||||||
@@ -94,6 +94,10 @@ eap_sim_file_card_t *eap_sim_file_card_create(eap_sim_file_triplets_t *triplets)
|
|||||||
this->public.card.get_triplet = (bool(*)(sim_card_t*, identification_t *imsi, char rand[SIM_RAND_LEN], char sres[SIM_SRES_LEN], char kc[SIM_KC_LEN]))get_triplet;
|
this->public.card.get_triplet = (bool(*)(sim_card_t*, identification_t *imsi, char rand[SIM_RAND_LEN], char sres[SIM_SRES_LEN], char kc[SIM_KC_LEN]))get_triplet;
|
||||||
this->public.card.get_quintuplet = (status_t(*)(sim_card_t*, identification_t *imsi, char rand[AKA_RAND_LEN], char autn[AKA_AUTN_LEN], char ck[AKA_CK_LEN], char ik[AKA_IK_LEN], char res[AKA_RES_LEN]))get_quintuplet;
|
this->public.card.get_quintuplet = (status_t(*)(sim_card_t*, identification_t *imsi, char rand[AKA_RAND_LEN], char autn[AKA_AUTN_LEN], char ck[AKA_CK_LEN], char ik[AKA_IK_LEN], char res[AKA_RES_LEN]))get_quintuplet;
|
||||||
this->public.card.resync = (bool(*)(sim_card_t*, identification_t *imsi, char rand[AKA_RAND_LEN], char auts[AKA_AUTS_LEN]))return_false;
|
this->public.card.resync = (bool(*)(sim_card_t*, identification_t *imsi, char rand[AKA_RAND_LEN], char auts[AKA_AUTS_LEN]))return_false;
|
||||||
|
this->public.card.get_pseudonym = (identification_t*(*)(sim_card_t*, identification_t *perm))return_null;
|
||||||
|
this->public.card.set_pseudonym = (void(*)(sim_card_t*, identification_t *perm, identification_t *pseudonym))nop;
|
||||||
|
this->public.card.get_reauth = (identification_t*(*)(sim_card_t*, identification_t *perm, char mk[HASH_SIZE_SHA1], u_int16_t *counter))return_null;
|
||||||
|
this->public.card.set_reauth = (void(*)(sim_card_t*, identification_t *perm, identification_t* next, char mk[HASH_SIZE_SHA1], u_int16_t counter))nop;
|
||||||
this->public.destroy = (void(*)(eap_sim_file_card_t*))destroy;
|
this->public.destroy = (void(*)(eap_sim_file_card_t*))destroy;
|
||||||
|
|
||||||
this->triplets = triplets;
|
this->triplets = triplets;
|
||||||
|
|||||||
@@ -91,6 +91,45 @@ struct sim_card_t {
|
|||||||
*/
|
*/
|
||||||
bool (*resync)(sim_card_t *this, identification_t *imsi,
|
bool (*resync)(sim_card_t *this, identification_t *imsi,
|
||||||
char rand[AKA_RAND_LEN], char auts[AKA_AUTS_LEN]);
|
char rand[AKA_RAND_LEN], char auts[AKA_AUTS_LEN]);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the pseudonym to use for next authentication.
|
||||||
|
*
|
||||||
|
* @param perm permanent identity of the peer (imsi)
|
||||||
|
* @param pseudo pseudonym identity received from the server
|
||||||
|
*/
|
||||||
|
void (*set_pseudonym)(sim_card_t *this, identification_t *perm,
|
||||||
|
identification_t *pseudo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the pseudonym previously stored via set_pseudonym().
|
||||||
|
*
|
||||||
|
* @param perm permanent identity of the peer (imsi)
|
||||||
|
* @return associated pseudonym identity, NULL if none stored
|
||||||
|
*/
|
||||||
|
identification_t* (*get_pseudonym)(sim_card_t *this, identification_t *perm);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Store parameters to use for the next fast reauthentication.
|
||||||
|
*
|
||||||
|
* @param perm permanent identity of the peer (imsi)
|
||||||
|
* @param next next fast reauthentication identity to use
|
||||||
|
* @param mk master key MK to store for reauthentication
|
||||||
|
* @param counter counter value to store, host order
|
||||||
|
*/
|
||||||
|
void (*set_reauth)(sim_card_t *this, identification_t *perm,
|
||||||
|
identification_t *next, char mk[HASH_SIZE_SHA1],
|
||||||
|
u_int16_t counter);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve parameters for fast reauthentication stored via set_reauth().
|
||||||
|
*
|
||||||
|
* @param perm permanent identity of the peer (imsi)
|
||||||
|
* @param mk buffer receiving master key MK
|
||||||
|
* @param counter pointer receiving counter value, in host order
|
||||||
|
*/
|
||||||
|
identification_t* (*get_reauth)(sim_card_t *this, identification_t *perm,
|
||||||
|
char mk[HASH_SIZE_SHA1], u_int16_t *counter);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user