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.
This commit is contained in:
Vijay Chadachan
2022-04-28 18:08:20 +02:00
parent 05567b59f1
commit a8f879ea12
2 changed files with 6 additions and 3 deletions
+4 -3
View File
@@ -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};
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
* different from the new received value in the AUTHENTICATION
* REQUEST message OR the received RAND is all "0" or "NULL"
* process the new received AUTHENTICATIOn REQUEST message
* REQUEST message OR if this is first time UE starting the
* Authentication process
*/
authentication_data->auth_process_started = TRUE;
OctetString auts;
auts.length = 0;
auts.value = (uint8_t *)malloc(AUTH_AUTS_SIZE);
+2
View File
@@ -18,6 +18,8 @@ typedef struct {
unsigned char mac_count:2; /* MAC failure counter (#20) */
unsigned char umts_count:2; /* UMTS challenge failure counter (#26) */
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;
#endif