From a51dc94e8bed5a8cf6839ced6bbddceb5e9374cc Mon Sep 17 00:00:00 2001 From: Robert Schmidt <robert.schmidt@eurecom.fr> Date: Tue, 3 Mar 2020 19:18:49 +0100 Subject: [PATCH] Set correct UE ID in Kenb Refresh Req NAS triggered the Kenb Refresh Req always for (hardcoded) UE 0. This fixes this by setting the correct UE ID. An effect of this was that the Kenb would always be set for UE 0, regardless for which UE it was actually intended. This led for integrity check failures for every UE with ID > 0. --- openair3/NAS/UE/EMM/SecurityModeControl.c | 2 +- openair3/NAS/UE/nas_itti_messaging.c | 4 ++-- openair3/NAS/UE/nas_itti_messaging.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/openair3/NAS/UE/EMM/SecurityModeControl.c b/openair3/NAS/UE/EMM/SecurityModeControl.c index 7bdd21572e2..67bfaf784e6 100644 --- a/openair3/NAS/UE/EMM/SecurityModeControl.c +++ b/openair3/NAS/UE/EMM/SecurityModeControl.c @@ -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.integrity = seia; #if defined(NAS_BUILT_IN_UE) - nas_itti_kenb_refresh_req(security_data->kenb.value); + nas_itti_kenb_refresh_req(security_data->kenb.value, user->ueid); #endif } diff --git a/openair3/NAS/UE/nas_itti_messaging.c b/openair3/NAS/UE/nas_itti_messaging.c index 55566700d7b..885ebbdd81f 100644 --- a/openair3/NAS/UE/nas_itti_messaging.c +++ b/openair3/NAS/UE/nas_itti_messaging.c @@ -100,7 +100,7 @@ int nas_itti_protected_msg(const char *buffer, const nas_message_t *msg, const i extern unsigned char NB_eNB_INST; -int nas_itti_kenb_refresh_req(const Byte_t kenb[32]) { +int nas_itti_kenb_refresh_req(const Byte_t kenb[32], int user_id) { MessageDef *message_p; message_p = itti_alloc_new_message(TASK_NAS_UE, NAS_KENB_REFRESH_REQ); memcpy(NAS_KENB_REFRESH_REQ(message_p).kenb, kenb, sizeof(NAS_KENB_REFRESH_REQ(message_p).kenb)); @@ -125,7 +125,7 @@ int nas_itti_kenb_refresh_req(const Byte_t kenb[32]) { kenb[20], kenb[21], kenb[22], kenb[23], kenb[24], kenb[25], kenb[26], kenb[27], kenb[28], kenb[29], kenb[30], kenb[31]); - return itti_send_msg_to_task(TASK_RRC_UE, NB_eNB_INST + 0 /* TODO to be virtualized */, message_p); + return itti_send_msg_to_task(TASK_RRC_UE, NB_eNB_INST + user_id, message_p); } int nas_itti_cell_info_req(const plmn_t plmnID, const Byte_t rat, int user_id) { diff --git a/openair3/NAS/UE/nas_itti_messaging.h b/openair3/NAS/UE/nas_itti_messaging.h index d958317e5a1..967bbb30596 100644 --- a/openair3/NAS/UE/nas_itti_messaging.h +++ b/openair3/NAS/UE/nas_itti_messaging.h @@ -48,7 +48,7 @@ int nas_itti_protected_msg( # if defined(NAS_BUILT_IN_UE) -int nas_itti_kenb_refresh_req(const Byte_t kenb[32]); +int nas_itti_kenb_refresh_req(const Byte_t kenb[32], int user_id); int nas_itti_cell_info_req(const plmn_t plmnID, const Byte_t rat, int user_id); -- GitLab