wpa_supplicant / hostapd 2.0
Functions

milenage.h File Reference

UMTS AKA - Milenage algorithm (3GPP TS 35.205, .206, .207, .208) More...

Go to the source code of this file.

Functions

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.
int milenage_auts (const u8 *opc, const u8 *k, const u8 *_rand, const u8 *auts, u8 *sqn)
 Milenage AUTS validation.
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.
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.
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.
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.

Detailed Description

UMTS AKA - Milenage algorithm (3GPP TS 35.205, .206, .207, .208)

Copyright
Copyright (c) 2006-2007 <j@w1.fi>

This software may be distributed under the terms of the BSD license. See README for more details.


Function Documentation

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.

Parameters:
opcOPc = 128-bit operator variant algorithm configuration field (encr.)
kK = 128-bit subscriber key
_randRAND = 128-bit random challenge
sresBuffer for SRES = 32-bit SRES
kcBuffer for Kc = 64-bit Kc
Returns:
0 on success, -1 on failure
int milenage_auts ( const u8 *  opc,
const u8 *  k,
const u8 *  _rand,
const u8 *  auts,
u8 *  sqn 
)

Milenage AUTS validation.

Parameters:
opcOPc = 128-bit operator variant algorithm configuration field (encr.)
kK = 128-bit subscriber key
_randRAND = 128-bit random challenge
autsAUTS = 112-bit authentication token from client
sqnBuffer for SQN = 48-bit sequence number
Returns:
0 = success (sqn filled), -1 on failure
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.

Parameters:
opcOPc = 128-bit operator variant algorithm configuration field (encr.)
kK = 128-bit subscriber key
sqnSQN = 48-bit sequence number
_randRAND = 128-bit random challenge
autnAUTN = 128-bit authentication token
ikBuffer for IK = 128-bit integrity key (f4), or NULL
ckBuffer for CK = 128-bit confidentiality key (f3), or NULL
resBuffer for RES = 64-bit signed response (f2), or NULL
res_lenVariable that will be set to RES length
auts112-bit buffer for AUTS
Returns:
0 on success, -1 on failure, or -2 on synchronization failure
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.

Parameters:
opcOPc = 128-bit value derived from OP and K
kK = 128-bit subscriber key
_randRAND = 128-bit random challenge
sqnSQN = 48-bit sequence number
amfAMF = 16-bit authentication management field
mac_aBuffer for MAC-A = 64-bit network authentication code, or NULL
mac_sBuffer for MAC-S = 64-bit resync authentication code, or NULL
Returns:
0 on success, -1 on failure
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.

Parameters:
opcOPc = 128-bit value derived from OP and K
kK = 128-bit subscriber key
_randRAND = 128-bit random challenge
resBuffer for RES = 64-bit signed response (f2), or NULL
ckBuffer for CK = 128-bit confidentiality key (f3), or NULL
ikBuffer for IK = 128-bit integrity key (f4), or NULL
akBuffer for AK = 48-bit anonymity key (f5), or NULL
akstarBuffer for AK = 48-bit anonymity key (f5*), or NULL
Returns:
0 on success, -1 on failure
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.

Parameters:
opcOPc = 128-bit operator variant algorithm configuration field (encr.)
amfAMF = 16-bit authentication management field
kK = 128-bit subscriber key
sqnSQN = 48-bit sequence number
_randRAND = 128-bit random challenge
autnBuffer for AUTN = 128-bit authentication token
ikBuffer for IK = 128-bit integrity key (f4), or NULL
ckBuffer for CK = 128-bit confidentiality key (f3), or NULL
resBuffer for RES = 64-bit signed response (f2), or NULL
res_lenMax length for res; set to used length or 0 on failure
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines