|
|
|
@ -49,6 +49,8 @@ void arrprint(uint8_t const * const a, uint32 len) {
|
|
|
|
|
/*
|
|
|
|
|
* Functions
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void test_set_2()
|
|
|
|
|
{
|
|
|
|
|
LIBLTE_ERROR_ENUM err_lte = LIBLTE_ERROR_INVALID_INPUTS;
|
|
|
|
@ -59,18 +61,17 @@ void test_set_2()
|
|
|
|
|
uint8_t sqn[] = {0xff, 0x9b, 0xb4, 0xd0, 0xb6, 0x07};
|
|
|
|
|
uint8_t amf[] = {0xb9, 0xb9};
|
|
|
|
|
uint8_t op[] = {0xcd, 0xc2, 0x02, 0xd5, 0x12, 0x3e, 0x20, 0xf6, 0x2b, 0x6d, 0x67, 0x6a, 0xc7, 0x2c, 0xb3, 0x18};
|
|
|
|
|
|
|
|
|
|
// f1
|
|
|
|
|
uint8_t mac_o[8];
|
|
|
|
|
|
|
|
|
|
uint8_t mac_o[8];
|
|
|
|
|
err_lte = liblte_security_milenage_f1(k,
|
|
|
|
|
AUTH_OP,
|
|
|
|
|
op,
|
|
|
|
|
rand,
|
|
|
|
|
sqn,
|
|
|
|
|
amf,
|
|
|
|
|
mac_o);
|
|
|
|
|
|
|
|
|
|
assert(err_lte == LIBLTE_SUCCESS);
|
|
|
|
|
|
|
|
|
|
arrprint(mac_o, sizeof(mac_o));
|
|
|
|
|
|
|
|
|
|
uint8_t mac_a[] = {0x4a, 0x9f, 0xfa, 0xc3, 0x54, 0xdf, 0xaf, 0xb3};
|
|
|
|
@ -80,9 +81,9 @@ void test_set_2()
|
|
|
|
|
assert(err_cmp == 0);
|
|
|
|
|
|
|
|
|
|
// f1 star
|
|
|
|
|
|
|
|
|
|
uint8_t mac_so[8];
|
|
|
|
|
err_lte = liblte_security_milenage_f1_star(k,
|
|
|
|
|
AUTH_OP,
|
|
|
|
|
op,
|
|
|
|
|
rand,
|
|
|
|
|
sqn,
|
|
|
|
@ -105,7 +106,6 @@ void test_set_2()
|
|
|
|
|
uint8_t ak_o[6];
|
|
|
|
|
|
|
|
|
|
err_lte = liblte_security_milenage_f2345(k,
|
|
|
|
|
AUTH_OP,
|
|
|
|
|
op,
|
|
|
|
|
rand,
|
|
|
|
|
res_o,
|
|
|
|
@ -145,11 +145,7 @@ void test_set_2()
|
|
|
|
|
// f star
|
|
|
|
|
uint8_t ak_star_o[6];
|
|
|
|
|
|
|
|
|
|
err_lte = liblte_security_milenage_f5_star(k,
|
|
|
|
|
AUTH_OP,
|
|
|
|
|
op,
|
|
|
|
|
rand,
|
|
|
|
|
ak_star_o);
|
|
|
|
|
err_lte = liblte_security_milenage_f5_star(k, op, rand, ak_star_o);
|
|
|
|
|
assert(err_lte == LIBLTE_SUCCESS);
|
|
|
|
|
|
|
|
|
|
arrprint(ak_star_o, sizeof(ak_star_o));
|
|
|
|
@ -162,10 +158,10 @@ void test_set_2()
|
|
|
|
|
/*
|
|
|
|
|
Own test sets
|
|
|
|
|
*/
|
|
|
|
|
int main(int argc, char * argv[]) {
|
|
|
|
|
|
|
|
|
|
test_set_2();
|
|
|
|
|
int main(int argc, char * argv[]) {
|
|
|
|
|
/*
|
|
|
|
|
test_set_2();
|
|
|
|
|
test_set_3();
|
|
|
|
|
test_set_4();
|
|
|
|
|
test_set_5();
|
|
|
|
|