Rework protection of initial NAS signaling messages (REGISTRATION REQUEST) as per 3GPP TS 33.501

* Without a valid 5G NAS security context:
  * Send REGISTRATION REQUEST with cleartext IEs only.
  * After activating a security context via Security Mode Control:
    wrap the entire REGISTRATION REQUEST (with both non-cleartext and cleartext)
    in a NAS message container IE, include it in SECURITY MODE COMPLETE

* With a valid 5G NAS security context:
  * If non-cleartext IEs are needed, wrap the entire message in a NAS message container IE and cipher it.
  * If only cleartext IEs are needed, send the message directly without the NAS message container IE.
This commit is contained in:
Guido Casati
2025-02-10 10:05:02 +01:00
parent 16b1b0e9ce
commit 81ec8d2e13
3 changed files with 46 additions and 37 deletions
+2 -1
View File
@@ -1106,7 +1106,8 @@ static void rrc_ue_generate_RRCSetupComplete(const NR_UE_RRC_INST_t *rrc, const
if (IS_SA_MODE(get_softmodem_params())) {
as_nas_info_t initialNasMsg;
nr_ue_nas_t *nas = get_ue_nas_info(rrc->ue_id);
generateRegistrationRequest(&initialNasMsg, nas);
// Send Initial NAS message (Registration Request) before Security Mode control procedure
generateRegistrationRequest(&initialNasMsg, nas, false);
nas_msg = (char *)initialNasMsg.nas_data;
nas_msg_length = initialNasMsg.length;
} else {