Commit f6e42ce9 authored by Cedric Roux's avatar Cedric Roux

fix compilation of oaisim

That's not the end of the story though.
parent c62b54a0
...@@ -150,7 +150,8 @@ int usim_api_write(const char *filename, const usim_data_t* data) ...@@ -150,7 +150,8 @@ int usim_api_write(const char *filename, const usim_data_t* data)
** Others: None ** ** Others: None **
** ** ** **
***************************************************************************/ ***************************************************************************/
int usim_api_authenticate_test(const OctetString* rand_pP, const OctetString* autn_pP, int usim_api_authenticate_test(usim_data_t *usim_data,
const OctetString* rand_pP, const OctetString* autn_pP,
OctetString* auts_pP, OctetString* res_pP, OctetString* auts_pP, OctetString* res_pP,
OctetString* ck_pP, OctetString* ik_pP) OctetString* ck_pP, OctetString* ik_pP)
{ {
...@@ -166,7 +167,7 @@ int usim_api_authenticate_test(const OctetString* rand_pP, const OctetString* au ...@@ -166,7 +167,7 @@ int usim_api_authenticate_test(const OctetString* rand_pP, const OctetString* au
// RES = XDOUT // RES = XDOUT
for (i=0; i<USIM_API_K_SIZE; i++) for (i=0; i<USIM_API_K_SIZE; i++)
{ {
res_pP->value[i] = rand_pP->value[i] ^ _usim_api_k[i]; res_pP->value[i] = rand_pP->value[i] ^ usim_data->keys.usim_api_k[i];
} }
//step2: res = f2(xdout,n) //step2: res = f2(xdout,n)
...@@ -257,19 +258,19 @@ int usim_api_authenticate_test(const OctetString* rand_pP, const OctetString* au ...@@ -257,19 +258,19 @@ int usim_api_authenticate_test(const OctetString* rand_pP, const OctetString* au
/* Concealed value of the counter SQNms in the USIM: /* Concealed value of the counter SQNms in the USIM:
* Conc(SQNMS) = SQNMS ⊕ f5*K(RAND) */ * Conc(SQNMS) = SQNMS ⊕ f5*K(RAND) */
f5star(_usim_api_k, rand_pP->value, ak); f5star(usim_data->keys.usim_api_k, rand_pP->value, ak, usim_data->keys.opc);
u8 sqn_ms[USIM_API_SQNMS_SIZE]; u8 sqn_ms[USIM_API_SQNMS_SIZE];
memset(sqn_ms, 0, USIM_API_SQNMS_SIZE); memset(sqn_ms, 0, USIM_API_SQNMS_SIZE);
//#define USIM_API_SQN_MS_SIZE 3 //#define USIM_API_SQN_MS_SIZE 3
printf("_usim_api_data.sqn_ms %p\n",_usim_api_data.sqn_ms); printf("usim_data->usim_sqn_data.sqn_ms %p\n", usim_data->usim_sqn_data.sqn_ms);
for (i = 0; i < USIM_API_SQNMS_SIZE; i++) { for (i = 0; i < USIM_API_SQNMS_SIZE; i++) {
//#warning "LG:BUG HERE TODO" //#warning "LG:BUG HERE TODO"
printf("i %d: ((uint8_t*)(_usim_api_data.sqn_ms))[USIM_API_SQNMS_SIZE - i] %d\n",i, ((uint8_t*)(_usim_api_data.sqn_ms))[USIM_API_SQNMS_SIZE - i]); printf("i %d: ((uint8_t*)(usim_data->usim_sqn_data.sqn_ms))[USIM_API_SQNMS_SIZE - i] %d\n",i, ((uint8_t*)(usim_data->usim_sqn_data.sqn_ms))[USIM_API_SQNMS_SIZE - i]);
sqn_ms[USIM_API_SQNMS_SIZE - i] = sqn_ms[USIM_API_SQNMS_SIZE - i] =
((uint8_t*)(_usim_api_data.sqn_ms))[USIM_API_SQNMS_SIZE - i]; ((uint8_t*)(usim_data->usim_sqn_data.sqn_ms))[USIM_API_SQNMS_SIZE - i];
} }
u8 sqnms[USIM_API_SQNMS_SIZE]; u8 sqnms[USIM_API_SQNMS_SIZE];
...@@ -285,8 +286,8 @@ int usim_api_authenticate_test(const OctetString* rand_pP, const OctetString* au ...@@ -285,8 +286,8 @@ int usim_api_authenticate_test(const OctetString* rand_pP, const OctetString* au
* MACS = f1*K(SQNMS || RAND || AMF) */ * MACS = f1*K(SQNMS || RAND || AMF) */
#define USIM_API_MACS_SIZE USIM_API_XMAC_SIZE #define USIM_API_MACS_SIZE USIM_API_XMAC_SIZE
u8 macs[USIM_API_MACS_SIZE]; u8 macs[USIM_API_MACS_SIZE];
f1star(_usim_api_k, rand_pP->value, sqn_ms, f1star(usim_data->keys.usim_api_k, rand_pP->value, sqn_ms,
&rand_pP->value[USIM_API_SQN_SIZE], macs); &rand_pP->value[USIM_API_SQN_SIZE], macs, usim_data->keys.opc);
LOG_TRACE(DEBUG, "USIM-API - MACS %02X%02X%02X%02X%02X%02X%02X%02X", LOG_TRACE(DEBUG, "USIM-API - MACS %02X%02X%02X%02X%02X%02X%02X%02X",
macs[0],macs[1],macs[2],macs[3], macs[0],macs[1],macs[2],macs[3],
macs[4],macs[5],macs[6],macs[7]); macs[4],macs[5],macs[6],macs[7]);
......
...@@ -366,7 +366,6 @@ typedef struct { ...@@ -366,7 +366,6 @@ typedef struct {
/* usim test mode */ /* usim test mode */
uint8_t usimtestmode; uint8_t usimtestmode;
usim_sqn_data_t usim_sqn_data; usim_sqn_data_t usim_sqn_data;
>>>>>>> UE/API: rename _usim_api_data to usim_sqn_data and move it to usim_data
} usim_data_t; } usim_data_t;
/****************************************************************************/ /****************************************************************************/
...@@ -384,7 +383,8 @@ int usim_api_write(const char *filename, const usim_data_t* data); ...@@ -384,7 +383,8 @@ int usim_api_write(const char *filename, const usim_data_t* data);
int usim_api_authenticate(usim_data_t *usim_data, const OctetString* rand_pP, const OctetString* autn_pP, int usim_api_authenticate(usim_data_t *usim_data, const OctetString* rand_pP, const OctetString* autn_pP,
OctetString* auts, OctetString* res, OctetString* auts, OctetString* res,
OctetString* ck, OctetString* ik); OctetString* ck, OctetString* ik);
int usim_api_authenticate_test(const OctetString* rand, const OctetString* autn, int usim_api_authenticate_test(usim_data_t *usim_data,
const OctetString* rand, const OctetString* autn,
OctetString* auts, OctetString* res, OctetString* auts, OctetString* res,
OctetString* ck, OctetString* ik); OctetString* ck, OctetString* ik);
......
...@@ -286,7 +286,7 @@ int emm_proc_security_mode_command(nas_user_t *user, int native_ksi, int ksi, ...@@ -286,7 +286,7 @@ int emm_proc_security_mode_command(nas_user_t *user, int native_ksi, int ksi,
user->emm_data->security->selected_algorithms.encryption = seea; user->emm_data->security->selected_algorithms.encryption = seea;
user->emm_data->security->selected_algorithms.integrity = seia; user->emm_data->security->selected_algorithms.integrity = seia;
#if defined(NAS_BUILT_IN_UE) #if defined(NAS_BUILT_IN_UE)
nas_itti_kenb_refresh_req(_security_data.kenb.value); nas_itti_kenb_refresh_req(security_data->kenb.value);
#endif #endif
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment