wpa_supplicant / hostapd
2.5
|
3GPP AKA - Milenage algorithm (3GPP TS 35.205, .206, .207, .208) More...
Functions | |
int | milenage_f1 (const u8 *opc, const u8 *k, const u8 *_rand, const u8 *sqn, const u8 *amf, u8 *mac_a, u8 *mac_s) |
Milenage f1 and f1* algorithms. More... | |
int | milenage_f2345 (const u8 *opc, const u8 *k, const u8 *_rand, u8 *res, u8 *ck, u8 *ik, u8 *ak, u8 *akstar) |
Milenage f2, f3, f4, f5, f5* algorithms. More... | |
void | milenage_generate (const u8 *opc, const u8 *amf, const u8 *k, const u8 *sqn, const u8 *_rand, u8 *autn, u8 *ik, u8 *ck, u8 *res, size_t *res_len) |
Generate AKA AUTN,IK,CK,RES. More... | |
int | milenage_auts (const u8 *opc, const u8 *k, const u8 *_rand, const u8 *auts, u8 *sqn) |
Milenage AUTS validation. More... | |
int | gsm_milenage (const u8 *opc, const u8 *k, const u8 *_rand, u8 *sres, u8 *kc) |
Generate GSM-Milenage (3GPP TS 55.205) authentication triplet. More... | |
int | milenage_check (const u8 *opc, const u8 *k, const u8 *sqn, const u8 *_rand, const u8 *autn, u8 *ik, u8 *ck, u8 *res, size_t *res_len, u8 *auts) |
Generate AKA AUTN,IK,CK,RES. More... | |
3GPP AKA - Milenage algorithm (3GPP TS 35.205, .206, .207, .208)
This file implements an example authentication algorithm defined for 3GPP AKA. This can be used to implement a simple HLR/AuC into hlr_auc_gw to allow EAP-AKA to be tested properly with real USIM cards.
This implementations assumes that the r1..r5 and c1..c5 constants defined in TS 35.206 are used, i.e., r1=64, r2=0, r3=32, r4=64, r5=96, c1=00..00, c2=00..01, c3=00..02, c4=00..04, c5=00..08. The block cipher is assumed to be AES (Rijndael).
int gsm_milenage | ( | const u8 * | opc, |
const u8 * | k, | ||
const u8 * | _rand, | ||
u8 * | sres, | ||
u8 * | kc | ||
) |
Generate GSM-Milenage (3GPP TS 55.205) authentication triplet.
opc | OPc = 128-bit operator variant algorithm configuration field (encr.) |
k | K = 128-bit subscriber key |
_rand | RAND = 128-bit random challenge |
sres | Buffer for SRES = 32-bit SRES |
kc | Buffer for Kc = 64-bit Kc |
int milenage_auts | ( | const u8 * | opc, |
const u8 * | k, | ||
const u8 * | _rand, | ||
const u8 * | auts, | ||
u8 * | sqn | ||
) |
Milenage AUTS validation.
opc | OPc = 128-bit operator variant algorithm configuration field (encr.) |
k | K = 128-bit subscriber key |
_rand | RAND = 128-bit random challenge |
auts | AUTS = 112-bit authentication token from client |
sqn | Buffer for SQN = 48-bit sequence number |
int milenage_check | ( | const u8 * | opc, |
const u8 * | k, | ||
const u8 * | sqn, | ||
const u8 * | _rand, | ||
const u8 * | autn, | ||
u8 * | ik, | ||
u8 * | ck, | ||
u8 * | res, | ||
size_t * | res_len, | ||
u8 * | auts | ||
) |
Generate AKA AUTN,IK,CK,RES.
opc | OPc = 128-bit operator variant algorithm configuration field (encr.) |
k | K = 128-bit subscriber key |
sqn | SQN = 48-bit sequence number |
_rand | RAND = 128-bit random challenge |
autn | AUTN = 128-bit authentication token |
ik | Buffer for IK = 128-bit integrity key (f4), or NULL |
ck | Buffer for CK = 128-bit confidentiality key (f3), or NULL |
res | Buffer for RES = 64-bit signed response (f2), or NULL |
res_len | Variable that will be set to RES length |
auts | 112-bit buffer for AUTS |
int milenage_f1 | ( | const u8 * | opc, |
const u8 * | k, | ||
const u8 * | _rand, | ||
const u8 * | sqn, | ||
const u8 * | amf, | ||
u8 * | mac_a, | ||
u8 * | mac_s | ||
) |
Milenage f1 and f1* algorithms.
opc | OPc = 128-bit value derived from OP and K |
k | K = 128-bit subscriber key |
_rand | RAND = 128-bit random challenge |
sqn | SQN = 48-bit sequence number |
amf | AMF = 16-bit authentication management field |
mac_a | Buffer for MAC-A = 64-bit network authentication code, or NULL |
mac_s | Buffer for MAC-S = 64-bit resync authentication code, or NULL |
int milenage_f2345 | ( | const u8 * | opc, |
const u8 * | k, | ||
const u8 * | _rand, | ||
u8 * | res, | ||
u8 * | ck, | ||
u8 * | ik, | ||
u8 * | ak, | ||
u8 * | akstar | ||
) |
Milenage f2, f3, f4, f5, f5* algorithms.
opc | OPc = 128-bit value derived from OP and K |
k | K = 128-bit subscriber key |
_rand | RAND = 128-bit random challenge |
res | Buffer for RES = 64-bit signed response (f2), or NULL |
ck | Buffer for CK = 128-bit confidentiality key (f3), or NULL |
ik | Buffer for IK = 128-bit integrity key (f4), or NULL |
ak | Buffer for AK = 48-bit anonymity key (f5), or NULL |
akstar | Buffer for AK = 48-bit anonymity key (f5*), or NULL |
void milenage_generate | ( | const u8 * | opc, |
const u8 * | amf, | ||
const u8 * | k, | ||
const u8 * | sqn, | ||
const u8 * | _rand, | ||
u8 * | autn, | ||
u8 * | ik, | ||
u8 * | ck, | ||
u8 * | res, | ||
size_t * | res_len | ||
) |
Generate AKA AUTN,IK,CK,RES.
opc | OPc = 128-bit operator variant algorithm configuration field (encr.) |
amf | AMF = 16-bit authentication management field |
k | K = 128-bit subscriber key |
sqn | SQN = 48-bit sequence number |
_rand | RAND = 128-bit random challenge |
autn | Buffer for AUTN = 128-bit authentication token |
ik | Buffer for IK = 128-bit integrity key (f4), or NULL |
ck | Buffer for CK = 128-bit confidentiality key (f3), or NULL |
res | Buffer for RES = 64-bit signed response (f2), or NULL |
res_len | Max length for res; set to used length or 0 on failure |