Commit d20a64c0 authored by Yann Garcia's avatar Yann Garcia
Browse files

Bug fixed in NAS raw codec

parent 9a9feaca
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -5,6 +5,12 @@
#NAS_Pics.PICS_NAS_AMF_IUT := true
NG_NAS_Pics.PICS_NGNAS := true

# 5GRegAuthSec_deReg.pcap
LibNGAP_Pixits.PX_AMF_NAME       := "Kontron5G-amf"
LibNGAP_Pixits.PX_RAN_UE_NGAP_ID := 0
LibNGAP_Pixits.PX_AMF_UE_NGAP_ID := 22


[LOGGING]
# In this section you can specify the name of the log file and the classes of events
# you want to log into the file or display on console (standard error).
@@ -21,8 +27,8 @@ LogEventTypes:= Yes

[TESTPORT_PARAMETERS]
# In this section you can specify parameters that are passed to Test Ports.
system.NGAP_gNB_1.params := "NGAP/SCTP_FILE/IP_OFFLINE/PCAP_FILE(file=../captures/TP_5GNAS_AMF_REG_REJ_01.pcapng)"
system.N2_gNBaMF_P.params := "NGAP/SCTP_FILE/IP_OFFLINE/PCAP_FILE(file=../captures/TP_5GNAS_AMF_REG_REJ_01.pcapng)"
system.NGAP_gNB_1.params := "NGAP/SCTP_FILE/IP_OFFLINE/ETH(mac_src=8c554ac1eee0,mac_dst=8c554ac1eee1)/PCAP_FILE(file=../captures/5GRegAuthSec_deReg.pcap)"
system.N2_gNBaMF_P.params := "NGAP/SCTP_FILE/IP_OFFLINE/ETH(mac_src=8c554ac1eee0,mac_dst=8c554ac1eee1)/PCAP_FILE(file=../captures/5GRegAuthSec_deReg.pcap)"
#aMFNASComponent.N2_gNBaMF_P.params := "NAS/SCTP_FILE/IP_FILE/ETH/PCAP_FILE(file=../captures/free5gc.pcap)"

[DEFINE]
@@ -55,11 +61,11 @@ system.N2_gNBaMF_P.params := "NGAP/SCTP_FILE/IP_OFFLINE/PCAP_FILE(file=../captur
#NG_NAS_TestCases.TC_5GNAS_AMF_AUT_REQ_03
#NG_NAS_TestCases.TC_5GNAS_AMF_AUT_REQ_04
#NG_NAS_TestCases.TC_5GNAS_AMF_AUT_REQ_05
#NG_NAS_TestCases.TC_NGNAS_AMF_AUT_SEQ_01
NG_NAS_TestCases.TC_NGNAS_AMF_AUT_SEQ_01
#NG_NAS_TestCases.TC_5GNAS_AMF_REG_ACC_01
#NG_NAS_TestCases.TC_5GNAS_AMF_REG_ACC_02
#NG_NAS_TestCases.TC_5GNAS_AMF_REG_ACC_03
NG_NAS_TestCases.TC_5GNAS_AMF_REG_REJ_01
#NG_NAS_TestCases.TC_5GNAS_AMF_REG_REJ_01
#NG_NAS_TestCases.TC_5GNAS_AMF_REG_REJ_02

[GROUPS]
+2 −2
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ module NG_NAS_MsgContainers
  import from EPS_NAS_TypeDefs all;

  type union NG_NAS_UL_Message_Type {                                              /* NAS message with direction 'UE to network ' or 'both' */
    NG_SECURITY_PROTECTED_NAS_MESSAGE                      security_Protected_Nas_Message,
    NG_AUTHENTICATION_FAILURE                              authentication_Failure,
    NG_AUTHENTICATION_RESPONSE                             authentication_Response,
    NG_CONFIGURATION_UPDATE_COMPLETE                       configuration_Update_Complete,
@@ -42,7 +43,6 @@ module NG_NAS_MsgContainers
    NG_REGISTRATION_REQUEST                                registration_Request,
    NG_SECURITY_MODE_COMPLETE                              security_Mode_Complete,
    NG_SECURITY_MODE_REJECT                                security_Mode_Reject,
    NG_SECURITY_PROTECTED_NAS_MESSAGE                      security_Protected_Nas_Message,
    NG_SERVICE_REQUEST                                     service_Request,
    NG_UL_NAS_TRANSPORT                                    ul_Nas_Transport,

@@ -72,6 +72,7 @@ module NG_NAS_MsgContainers
  }

  type union NG_NAS_DL_Message_Type {                                              /* NAS message with direction 'network to UE' or 'both' */
    NG_SECURITY_PROTECTED_NAS_MESSAGE                      security_Protected_Nas_Message,
    NG_AUTHENTICATION_REJECT                               authentication_Reject,
    NG_AUTHENTICATION_REQUEST                              authentication_Request,
    NG_AUTHENTICATION_RESULT                               authentication_Result,
@@ -96,7 +97,6 @@ module NG_NAS_MsgContainers
    NG_REGISTRATION_ACCEPT                                 registration_Accept,
    NG_REGISTRATION_REJECT                                 registration_Reject,
    NG_SECURITY_MODE_COMMAND                               security_Mode_Command,
    NG_SECURITY_PROTECTED_NAS_MESSAGE                      security_Protected_Nas_Message,
    NG_SERVICE_ACCEPT                                      service_Accept,
    NG_SERVICE_REJECT                                      service_Reject,
    
+135 −88

File changed.

Preview size limit exceeded, changes collapsed.

+17 −17
Original line number Diff line number Diff line
@@ -105,23 +105,23 @@ module LIB_NG_NAS_Functions {
        log("f_Check_5GAKA_SecurityModeCommand: v_nas_pdu: ", v_nas_pdu);
        var bitstring v_bs := oct2bit(v_nas_pdu);
        var NG_NAS_DL_Message_Type v_response;
        var NG_SECURITY_PROTECTED_NAS_MESSAGE v_security_Protected_Nas_Message;
        if (decvalue(v_bs, v_security_Protected_Nas_Message) == 0) {
            log("f_Check_5GAKA_SecurityModeCommand: v_response: ", v_security_Protected_Nas_Message);
            v_nas_pdu := v_security_Protected_Nas_Message.plainNASMessage;
            log("f_Check_5GAKA_SecurityModeCommand: Next v_nas_pdu: ", v_nas_pdu);
            v_bs := oct2bit(v_nas_pdu);
        if (decvalue(v_bs, v_response) != 0) {
                log("f_Check_5GAKA_SecurityModeCommand: decvalue failure");
            log("f_Check_5GAKA_SecurityModeCommand (1): decvalue failure");
            return false;
        }
        } else {
            log("f_Check_5GAKA_SecurityModeCommand: decvalue failure");
        log("f_Check_5GAKA_SecurityModeCommand: v_response: ", v_response);
        if (not(ischosen(v_response.security_Protected_Nas_Message))) {
            log("f_Check_5GAKA_SecurityModeCommand: Wrong variant, security_Protected_Nas_Message exppected");
            return false;
        }
        v_bs := oct2bit(v_response.security_Protected_Nas_Message.plainNASMessage);
        if (decvalue(v_bs, v_response) != 0) {
            log("f_Check_5GAKA_SecurityModeCommand (2): decvalue failure");
            return false;
        }
        log("f_Check_5GAKA_SecurityModeCommand: v_response: ", v_response);       
        if (not(ischosen(v_response.security_Mode_Command))) {
            log("f_Check_5GAKA_SecurityModeCommand: Wrong variant");
            log("f_Check_5GAKA_SecurityModeCommand: Wrong variant, security_Mode_Command exppected");
            return false;           
        }
        p_ng_security_mode_command := v_response.security_Mode_Command;