Commit a8f879ea authored by Vijay Chadachan's avatar Vijay Chadachan

Update for the code review comment.

Instead of NULL RAND value check, added the flag to indicate if the
AUTH process started. The flag is used manage the timer handling
for authentication process when stored RAND values is same as received
RAND value in AUTH_REQ.
parent 05567b59
...@@ -180,13 +180,14 @@ int emm_proc_authentication_request(nas_user_t *user, int native_ksi, int ksi, ...@@ -180,13 +180,14 @@ int emm_proc_authentication_request(nas_user_t *user, int native_ksi, int ksi,
OctetString res = {AUTH_RES_SIZE, authentication_data->res}; OctetString res = {AUTH_RES_SIZE, authentication_data->res};
if ((memcmp(authentication_data->rand, rand->value, AUTH_CK_SIZE) != 0) || if ((memcmp(authentication_data->rand, rand->value, AUTH_CK_SIZE) != 0) ||
(memcmp(nullRand,authentication_data->rand, AUTH_CK_SIZE) == 0)) { (authentication_data->auth_process_started == FALSE)) {
/* /*
* There is no valid stored RAND in the ME or the stored RAND is * There is no valid stored RAND in the ME or the stored RAND is
* different from the new received value in the AUTHENTICATION * different from the new received value in the AUTHENTICATION
* REQUEST message OR the received RAND is all "0" or "NULL" * REQUEST message OR if this is first time UE starting the
* process the new received AUTHENTICATIOn REQUEST message * Authentication process
*/ */
authentication_data->auth_process_started = TRUE;
OctetString auts; OctetString auts;
auts.length = 0; auts.length = 0;
auts.value = (uint8_t *)malloc(AUTH_AUTS_SIZE); auts.value = (uint8_t *)malloc(AUTH_AUTS_SIZE);
......
...@@ -18,6 +18,8 @@ typedef struct { ...@@ -18,6 +18,8 @@ typedef struct {
unsigned char mac_count:2; /* MAC failure counter (#20) */ unsigned char mac_count:2; /* MAC failure counter (#20) */
unsigned char umts_count:2; /* UMTS challenge failure counter (#26) */ unsigned char umts_count:2; /* UMTS challenge failure counter (#26) */
unsigned char sync_count:2; /* Sync failure counter (#21) */ unsigned char sync_count:2; /* Sync failure counter (#21) */
unsigned char auth_process_started:1; /* Authentication started */
unsigned char reserve:1; /* For future use, byte aligned */
} authentication_data_t; } authentication_data_t;
#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