Commit 04605b03 authored by Yann Garcia's avatar Yann Garcia
Browse files

Review TP_5GNAS_AMF_SEC_REJ_01 and TC_5GNAS_AMF_SEC_REJ_01

parent eb01a065
Loading
Loading
Loading
Loading
+6.16 KiB

File added.

No diff preview for this file type.

+2 −2
Changes for etc/Ats_NG_NAS/Ats_NG_NAS_AMF_open5gs.cfg_: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -190,9 +190,9 @@ system.utHttpPort.params := "HTTP/TCP(server=127.0.0.1,port=12200,use_ssl=0,debu
# Verify that the IUT sends a SECURITY MODE COMMAND message correctly to indicate NAS security mode procedure upon receipt of a NAS AUTHENTICATION RESPONSE
#NG_NAS_TestCases.TC_5GNAS_AMF_SEC_COM_01
# Verify that the IUT, upon receiving the NAS SECURITY MODE COMPLETE message after completing the NAS Authentication and Security procedure, successfully completes the registration process by accepting the registration
NG_NAS_TestCases.TC_5GNAS_AMF_SEC_ACC_01
#NG_NAS_TestCases.TC_5GNAS_AMF_SEC_ACC_01
# Verify that the IUT, upon receiving the NAS SECURITY MODE REJECT Message after a failed NAS Authentication and security procedure, successfully aborts the registration process by rejecting the registration
#NG_NAS_TestCases.TC_5GNAS_AMF_SEC_REJ_01
NG_NAS_TestCases.TC_5GNAS_AMF_SEC_REJ_01
#NG_NAS_TestCases.TC_5GNAS_AMF_DLN_ACC_01
#NG_NAS_TestCases.TC_5GNAS_AMF_REG_ACC_01
#NG_NAS_TestCases.TC_5GNAS_AMF_REG_ACC_02
+12 −6
Changes for test_purposes/TP_AMF_NGNAS.tdltx: 12 added lines, 6 removed lines.
Original line number Diff line number Diff line
@@ -444,29 +444,35 @@ Package TP_AMF_NGNAS {
                Initial conditions
                with {                
                    the UE entity isNotRegisteredToAMF and
                    (.) at time point start_SMC_event : event SECURITY_MODE_COMMAND occurs
                    event AUTHENTICATION_REQUEST occurs and
                    event SECURITY_MODE_COMMAND occurs
                }    

                Expected behaviour
                ensure that {
                    when {
                        (.) at time point start_SMC_event : event SECURITY_MODE_COMMAND occurs and
                        the IUT entity receives a UPLINK_NAS_TRANSPORT containing {
                        (.) at time point reject_received : the IUT entity receives a UPLINK_NAS_TRANSPORT containing {
                            NAS_PDU containing {
                                extended_protocol_discriminator set to 5GS_MOBILITY_MANAGEMENT_MESSAGES, 
                                security_header_type set to INTEGRITY_PROTECTED_WITH_NEW_5G_NAS_SECURITY_CONTEXT,
                                security_header_type set to NOT_SECURITY_PROTECTED, //!the UE did not take the new 5G NAS security context into use (ETSI TS 124 501 clause 4.4.4.2)
                                message_type set to SECURITY_MODE_REJECT,    
                                5GMM_cause set to "UE security capabilities mismatch (23)"}}
                        from the GNB entity
                    }
                    then {
                        // PX_SEC_ABORT_TWAIT: observation timer to verify that no further registration progression occurs
                        (!) PX_SEC_ABORT_TWAIT after @start_SMC_event : the IUT entity does not send a INITIAL_CONTEXT_SETUP_REQUEST containing {
                        (!) PX_SEC_ABORT_TWAIT after @reject_received : the IUT entity does not send a INITIAL_CONTEXT_SETUP_REQUEST containing {
                            NAS_PDU containing {
                                extended_protocol_discriminator set to 5GS_MOBILITY_MANAGEMENT_MESSAGES, 
                                message_type set to REGISTRATION_ACCEPT}}
                        to the GNB entity and
                        the IUT entity does not send a DOWNLINK_NAS_TRANSPORT containing {
                            NAS_PDU containing {
                                extended_protocol_discriminator set to 5GS_MOBILITY_MANAGEMENT_MESSAGES,
                                message_type set to SECURITY_MODE_COMMAND}} //!no retransmission on expiry of T3560
                        to the GNB entity
                        //(Note 1: "The IUT is expected to abort the ongoing procedure and shall not proceed with registration completion.")
                        //(Note 1: "The IUT is expected to abort the ongoing procedure and shall not proceed with registration completion. It may release the UE context.")
                        //(Note 2: PX_SEC_ABORT_TWAIT is longer than T3560.)
                    }
                    
                }
+14 −0
Changes for ttcn/Ats_NG_NAS/NG_NAS_Steps.ttcn: 14 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -236,6 +236,20 @@ module NG_NAS_Steps {
            }
        } // End of function f_NG_NAS_amf_UE_SecurityModeComplete

        /**
         * @desc   SECURITY MODE REJECT with the 5GMM cause p_cause (offline: read from the capture). The SECURITY MODE COMMAND
         *         was received before (f_await_security_mode_command).
         */
        function f_NG_NAS_amf_UE_SecurityModeReject(
                                                    in NAS_CauseValue_Type p_cause
                                                    ) runs on aMF_NGNAS_NGAPComponent {
            if (PICS_OFFLINE_MODE) {
                f_await_security_mode_reject();
            } else {
                f_send_security_mode_reject(p_cause);
            }
        } // End of function f_NG_NAS_amf_UE_SecurityModeReject

        /**
         * @desc   Does the TAI list of a REGISTRATION ACCEPT contain the TAI p_plmnId/p_tac? (TS 24.501 clause 9.11.3.9: type 00
         *         lists TACs of one PLMN, type 01 consecutive TACs of one PLMN starting from a TAC, type 10 TAIs)
+55 −24
Changes for ttcn/Ats_NG_NAS/NG_NAS_TCFunctions.ttcn: 55 added lines, 24 removed lines.
Original line number Diff line number Diff line
@@ -574,43 +574,74 @@ module NG_NAS_TCFunctions {

                /**
                 * @desc Testcase function for TC_5GNAS_AMF_SEC_REJ_01
                 * @see  TP_5GNAS_AMF_SEC_REJ_01: after the SECURITY MODE COMMAND, a plain SECURITY MODE REJECT with 5GMM cause #23
                 *       "UE security capabilities mismatch" makes the IUT abort the registration: during PX_SEC_ABORT_TWAIT, no
                 *       INITIAL CONTEXT SETUP REQUEST, REGISTRATION ACCEPT or retransmitted SECURITY MODE COMMAND. A release of
                 *       the UE context is accepted as the abort.
                 */
                function f_TC_5GNAS_AMF_SEC_REJ_01() runs on aMF_NGNAS_NGAPComponent {
                    // Local variables
                    const NAS_CauseValue_Type c_cause_ue_security_capabilities_mismatch := '00010111'B; // 5GMM cause #23
                    var NG_NAS_DL_Message_Type v_message;
                    var NGAP_PDU v_PDU;
                    var boolean v_released := false;
                    timer t_observation := PX_SEC_ABORT_TWAIT;

                    // Preamble
                    // Preamble: NG SETUP, initial REGISTRATION REQUEST with the SUCI, authentication, SECURITY MODE COMMAND
                    f_NGNAS_amf_init();
                    f_NG_NAS_amf_UE_Register();
                    f_NG_NAS_amf_UE_Authentication();
                    f_await_NasSecurityModeCommand();
                    f_await_security_mode_command();
                    f_selfOrClientSyncAndVerdict(c_prDone, f_getVerdict());
                    log("*** " & __SCOPE__ & ": INFO: Preamble done. ***");

                    // Test Body
                    // Send SecurityModeComplete
                    vt_NgNasUl_Msg := m_NG_SECURITY_MODE_REJECT(
                                                                m_GMM_GSM_Cause(
                                                                                -,
                                                                                '00100011'B // FIXME Create const NAS_CauseValue_Type tsc_EmmCause_UESecurityCapabilitiesMismatch;

                                                                ));
                    vc_sendNAS_PDU := bit2oct(encvalue(valueof(vt_NgNasUl_Msg)));
                    f_send_NGAP_PDU(
                                    m_ngap_initMsg(
                                                    m_n2_UplinkNASTransport(
                                                                            PX_AMF_UE_NGAP_ID,
                                                                            PX_RAN_UE_NGAP_ID, 
                                                                            vc_sendNAS_PDU,
                                                                            m_uPTransportLayerInformation_userLocationInformationNR(
                                                                                                                                    m_userLocationInformationNR(
                                                                                                                                                                m_nR_CGI,
                                                                                                                                                                m_tAI
                                    )))));
                    // FIXME FSCOM How to check the IUT entity sends a DOWNLINK_NAS_TRANSPORT containing to the GNB entity
                    // When: SECURITY MODE REJECT #23
                    f_NG_NAS_amf_UE_SecurityModeReject(c_cause_ue_security_capabilities_mismatch);
                    // Then: the registration does not progress during PX_SEC_ABORT_TWAIT
                    t_observation.start;
                    alt {
                        [] N2_gNBaMF_P.receive(mw_ngap_initMsg_anyProcedure(id_InitialContextSetup)) {
                            t_observation.stop;
                            setverdict(fail, "*** " & __SCOPE__ & ": FAIL: INITIAL CONTEXT SETUP REQUEST after the SECURITY MODE REJECT: the registration was not aborted ***");
                        }
                        [] N2_gNBaMF_P.receive(
                                               mw_ngap_initMsg(
                                                               mw_n2_DownlinkNASTransport(
                                                                                          ?,
                                                                                          vc_RAN_UE_ID,
                                                                                          ?
                                               ))) -> value v_PDU {
                            f_NGAPPDU_Get(v_PDU);
                            f_NASPDU_Get(vc_recvNGAP_PDU);
                            if (f_Check_5GAKA_NAS_DL_Message(vc_recvNAS_PDU, mw_NG_SECURITY_MODE_COMMAND, vc_ng_nas_security_params_type, vc_previous_nas_count_dl, v_message, vc_inner_message)) {
                                t_observation.stop;
                                setverdict(fail, "*** " & __SCOPE__ & ": FAIL: SECURITY MODE COMMAND sent again after the SECURITY MODE REJECT: the procedure was not aborted ***");
                            } else if (f_Check_5GAKA_NAS_DL_Message(vc_recvNAS_PDU, mw_NG_REGISTRATION_ACCEPT, vc_ng_nas_security_params_type, vc_previous_nas_count_dl, v_message, vc_inner_message)) {
                                t_observation.stop;
                                setverdict(fail, "*** " & __SCOPE__ & ": FAIL: REGISTRATION ACCEPT after the SECURITY MODE REJECT: the registration was not aborted ***");
                            } else {
                                log("*** " & __SCOPE__ & ": INFO: other DOWNLINK NAS TRANSPORT after ", t_observation.read, " s (e.g. REGISTRATION REJECT), accepted ***");
                                repeat;
                            }
                        }
                        [not v_released] N2_gNBaMF_P.receive(mw_ngap_initMsg_anyProcedure(id_UEContextRelease)) -> value v_PDU {
                            f_NGAPPDU_Get(v_PDU);
                            v_released := true;
                            log("*** " & __SCOPE__ & ": INFO: the IUT releases the UE context after ", t_observation.read, " s ***");
                            repeat;
                        }
                        [] t_observation.timeout {
                            log("*** " & __SCOPE__ & ": PASS: no progression of the registration during ", PX_SEC_ABORT_TWAIT, " s after the SECURITY MODE REJECT ***");
                            setverdict(pass);
                        }
                    }
                    f_selfOrClientSyncAndVerdict(c_tbDone, f_getVerdict());
                    log("*** " & __SCOPE__ & ": INFO: Testbody done. ***");

                    // Postamble
                    //TODO: f_postamble_NGAP_gNB();
                    // Postamble: release of the UE context
                    f_NG_NAS_amf_UE_ReleaseContext(v_released);
                    f_postamble_NGAP_AMF();
                    f_selfOrClientSyncAndVerdict(c_poDone, f_getVerdict());
                    log("*** " & __SCOPE__ & ": INFO: Postamble done. ***");
                } // End of function f_TC_5GNAS_AMF_SEC_REJ_01
Loading