Commit 0543adf8 authored by Yann Garcia's avatar Yann Garcia
Browse files

Validate CMAC calculation and checks

parent 7ae3a3e5
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -29,7 +29,9 @@ Lib_NG_NAS_Pixits.PX_FORCE_USING_OPERATOR_SECRET_KEY := true

Lib_NG_NAS_Pixits.PX_SUBSCRIPTION_KEY                := '00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'B
Lib_NG_NAS_Pixits.PX_PLMN                            := '00f110'O;
Lib_NG_NAS_Pixits.PX_BEARER_ID                       := '00001'B

Parameters.px_IMSI_Def                               := '696d73692d3939393730303030303030'H; // imsi-99970000000
NAS_5GC_Parameters.px_NAS_5GC_XRES_Length := 8 # In ETSI TS 135 206 V16.0.0 (2020-08) Table Table 5. f2 output, RES length is 8 octets (64 bits)

[LOGGING]
@@ -54,6 +56,9 @@ LogEventTypes:= Yes
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)"

#system.NGAP_gNB_1.params := "NGAP/SCTP_FILE/IP_OFFLINE/ETH(mac_src=8c554ac1eee0,mac_dst=8c554ac1eee1)/PCAP_FILE(file=../captures/open5gs.pcap)"
#system.N2_gNBaMF_P.params := "NGAP/SCTP_FILE/IP_OFFLINE/ETH(mac_src=8c554ac1eee0,mac_dst=8c554ac1eee1)/PCAP_FILE(file=../captures/open5gs.pcap)"

#system.NGAP_gNB_1.params := "NGAP/SCTP_FILE/IP_OFFLINE/LINUX_FRAME/PCAP_FILE(file=../captures/RegTrace4444333000_.pcapng)"
#system.N2_gNBaMF_P.params := "NGAP/SCTP_FILE/IP_OFFLINE/LINUX_FRAME/PCAP_FILE(file=../captures/RegTrace4444333000_.pcapng)"

@@ -96,11 +101,11 @@ system.N2_gNBaMF_P.params := "NGAP/SCTP_FILE/IP_OFFLINE/ETH(mac_src=8c554ac1eee0
# Verify the IUT correctly sets the UE Context after Authentication and Security procedure has been executed
#NGAP_TestCases.TC_NGAP_AMF_CMP_01
# Verify that the IUT can send a UE CONTEXT RELEASE COMMAND that contains both the AMF_UE_NGAP_ID IE and the RAN_UE_NGAP_ID IE or only AMF_UE_NGAP_ID
NGAP_TestCases.TC_NGAP_AMF_CMP_02
#NGAP_TestCases.TC_NGAP_AMF_CMP_02
# Verify that the IUT sends a UE CONTEXT RELEASE COMMAND after UE_CONTEXT_RELEASE_REQUEST to release the UE-associated logic NG-connection due to NG-RAN node generated reasons
#NGAP_TestCases.TC_NGAP_AMF_CMP_03
# Verify that the IUT can send a UE CONTEXT MODIFICATION REQUEST containing mandatory IEs
#NGAP_TestCases.TC_NGAP_AMF_CMP_04
NGAP_TestCases.TC_NGAP_AMF_CMP_04
# Verify that the IUT can send a CONNECTION ESTABLISHMENT INDICATION that contains mandatory IEs
#NGAP_TestCases.TC_NGAP_AMF_CMP_05
# Verify that the IUT can send an AMF CP RELOCATION INDICATION that contains mandatory IEs
+14 −13
Original line number Diff line number Diff line
@@ -22,7 +22,8 @@ Lib_NG_NAS_Pixits.PX_OPERATOR_SECRET_KEY := '00000000000000000000000
Lib_NG_NAS_Pixits.PX_FORCE_USING_OPERATOR_SECRET_KEY := true

Lib_NG_NAS_Pixits.PX_SUBSCRIPTION_KEY                := '00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'B
Lib_NG_NAS_Pixits.PX_PLMN                            := '00f110'O;
Lib_NG_NAS_Pixits.PX_PLMN                            := '00f110'O
Lib_NG_NAS_Pixits.PX_BEARER_ID                       := '11010'B

NAS_5GC_Parameters.px_NAS_5GC_XRES_Length := 8 # In ETSI TS 135 206 V16.0.0 (2020-08) Table Table 5. f2 output, RES length is 8 octets (64 bits)

@@ -74,7 +75,7 @@ system.N2_gNBaMF_P.params := "NGAP/SCTP_FILE/IP_OFFLINE/ETH(mac_src=8c554ac1eee0
# Verify that the IUT sends an AUTHENTICATION REQUEST message correctly upon receipt of a NAS Registration without an active security context
#NG_NAS_TestCases.TC_5GNAS_AMF_AUT_REQ_01
# Verify that the IUT sends an AUTHENTICATION REJECT message correctly upon receipt of an AUTHENTICATION RESPONSE message indicating a wrong ARP IEI
#################NG_NAS_TestCases.TC_5GNAS_AMF_AUT_REQ_02
#NG_NAS_TestCases.TC_5GNAS_AMF_AUT_REQ_02
# Verify that the IUT sends an IDENTITY REQUEST message correctly upon receipt of an AUTHENTICATION FAILURE message indicating a 5GMM cause value #20 - MAC failure
#NG_NAS_TestCases.TC_5GNAS_AMF_AUT_REQ_03
# Verify that the IUT sends an IDENTITY REQUEST message correctly upon receipt of an AUTHENTICATION FAILURE message indicating a 5GMM cause value #20 - MAC failure
@@ -86,7 +87,7 @@ system.N2_gNBaMF_P.params := "NGAP/SCTP_FILE/IP_OFFLINE/ETH(mac_src=8c554ac1eee0
# 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_NGNAS_AMF_AUT_SEQ_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_DLN_ACC_01
@@ -151,16 +152,16 @@ system.N2_gNBaMF_P.params := "NGAP/SCTP_FILE/IP_OFFLINE/ETH(mac_src=8c554ac1eee0
#NG_NAS_TestCases.TC_5G_AKA_CRYPTO_FUNCTIONS_TEST_21_01
#NG_NAS_TestCases.TC_5G_AKA_CRYPTO_FUNCTIONS_TEST_22_01
#NG_NAS_TestCases.TC_5G_AKA_CRYPTO_FUNCTIONS_TEST_23_01
NG_NAS_TestCases.TC_5G_AKA_CRYPTO_FUNCTIONS_TEST_24_01
NG_NAS_TestCases.TC_5G_AKA_CRYPTO_FUNCTIONS_TEST_25_01_01
NG_NAS_TestCases.TC_5G_AKA_CRYPTO_FUNCTIONS_TEST_25_01_02
NG_NAS_TestCases.TC_5G_AKA_CRYPTO_FUNCTIONS_TEST_25_02_01
NG_NAS_TestCases.TC_5G_AKA_CRYPTO_FUNCTIONS_TEST_25_03_01
NG_NAS_TestCases.TC_5G_AKA_CRYPTO_FUNCTIONS_TEST_26_01_01
NG_NAS_TestCases.TC_5G_AKA_CRYPTO_FUNCTIONS_TEST_26_01_02
NG_NAS_TestCases.TC_5G_AKA_CRYPTO_FUNCTIONS_TEST_26_01_03
NG_NAS_TestCases.TC_5G_AKA_CRYPTO_FUNCTIONS_TEST_26_02_01
NG_NAS_TestCases.TC_5G_AKA_CRYPTO_FUNCTIONS_TEST_26_03_01
#NG_NAS_TestCases.TC_5G_AKA_CRYPTO_FUNCTIONS_TEST_24_01
#NG_NAS_TestCases.TC_5G_AKA_CRYPTO_FUNCTIONS_TEST_25_01_01
#NG_NAS_TestCases.TC_5G_AKA_CRYPTO_FUNCTIONS_TEST_25_01_02
#NG_NAS_TestCases.TC_5G_AKA_CRYPTO_FUNCTIONS_TEST_25_02_01
#NG_NAS_TestCases.TC_5G_AKA_CRYPTO_FUNCTIONS_TEST_25_03_01
#NG_NAS_TestCases.TC_5G_AKA_CRYPTO_FUNCTIONS_TEST_26_01_01
#NG_NAS_TestCases.TC_5G_AKA_CRYPTO_FUNCTIONS_TEST_26_01_02
#NG_NAS_TestCases.TC_5G_AKA_CRYPTO_FUNCTIONS_TEST_26_01_03
#NG_NAS_TestCases.TC_5G_AKA_CRYPTO_FUNCTIONS_TEST_26_02_01
#NG_NAS_TestCases.TC_5G_AKA_CRYPTO_FUNCTIONS_TEST_26_03_01

[GROUPS]
# In this section you can specify groups of hosts. These groups can be used inside the
+3 −1
Original line number Diff line number Diff line
@@ -298,7 +298,7 @@ module NGAP_Steps {
            }
            log("f_NGAP_gnb_UE_Register: f_send_NGSetupRequest_await_NGSetupRespone done");
            f_await_registration_request();
            log("f_NGAP_gnb_UE_Register: f_await_registration_request done");
            log("<<< f_NGAP_gnb_UE_Register");
        } // End of function f_NGAP_gnb_UE_Register

        /**
@@ -311,6 +311,7 @@ module NGAP_Steps {
            } else { // Await authentication request and send response
                f_await_authentication_request_send_authentication_response();
            }
            log("<<< f_NGAP_gnb_UE_Authentication");
        } // End of function f_NGAP_gnb_UE_Authentication

        /**
@@ -323,6 +324,7 @@ module NGAP_Steps {
            } else { // Await security mode and send response
                f_await_securitymode_command_send_securitymode_complete();
            }
            log("<<< f_NGAP_gnb_UE_SecurityMode");
        } // End of function f_NGAP_gnb_UE_SecurityMode

        /**
+67 −55
Original line number Diff line number Diff line
@@ -1514,6 +1514,7 @@ module NGAP_TCFunctions {
                  f_NGAP_amf_init();
                  f_NGAP_amf_UE_Register();
                  f_NGAP_gnb_UE_InitialContextSetup();
                  f_NGAP_gnb_RegistrationComplete(); // f_send_registration_complete
                   f_selfOrClientSyncAndVerdict(c_prDone, f_getVerdict());


@@ -1556,10 +1557,10 @@ module NGAP_TCFunctions {
                f_NGAP_amf_init();
                f_NGAP_amf_UE_Register();
                f_NGAP_gnb_UE_InitialContextSetup();
                f_NGAP_gnb_RegistrationComplete(); // f_send_registration_complete
                f_selfOrClientSyncAndVerdict(c_prDone, f_getVerdict());
                log("*** " & __SCOPE__ & ": INFO: Preamble done. ***");  


                  // Body
                  f_send_NGAP_PDU(
                      m_ngap_initMsg(
@@ -1597,6 +1598,7 @@ module NGAP_TCFunctions {
                   f_NGAP_amf_init();
                   f_NGAP_amf_UE_Register();
                   f_NGAP_gnb_UE_InitialContextSetup();
                   f_NGAP_gnb_RegistrationComplete(); // f_send_registration_complete
                   f_selfOrClientSyncAndVerdict(c_prDone, f_getVerdict());
                   log("*** " & __SCOPE__ & ": INFO: Preamble done. ***");

@@ -1729,6 +1731,7 @@ module NGAP_TCFunctions {
                   f_NGAP_amf_init();
                   f_NGAP_amf_UE_Register();
                   f_NGAP_gnb_UE_InitialContextSetup();
                   f_NGAP_gnb_RegistrationComplete(); // f_send_registration_complete

                   f_selfOrClientSyncAndVerdict(c_prDone, f_getVerdict());
                   log("*** " & __SCOPE__ & ": INFO: Preamble done. ***");
@@ -1772,6 +1775,7 @@ module NGAP_TCFunctions {
                   f_NGAP_amf_init();
                   f_NGAP_amf_UE_Register();
                   f_NGAP_gnb_UE_InitialContextSetup();
                   f_NGAP_gnb_RegistrationComplete(); // f_send_registration_complete
                   f_selfOrClientSyncAndVerdict(c_prDone, f_getVerdict());
                   log("*** " & __SCOPE__ & ": INFO: Preamble done. ***");

@@ -1880,6 +1884,7 @@ module NGAP_TCFunctions {
                   f_NGAP_amf_init();
                   f_NGAP_amf_UE_Register();
                   f_NGAP_gnb_UE_InitialContextSetup();
                   f_NGAP_gnb_RegistrationComplete(); // f_send_registration_complete

                   f_selfOrClientSyncAndVerdict(c_prDone, f_getVerdict());
                   log("*** " & __SCOPE__ & ": INFO: Preamble done. ***");
@@ -1929,8 +1934,7 @@ module NGAP_TCFunctions {
                   f_NGAP_amf_init();
                   f_NGAP_amf_UE_Register();
                   f_NGAP_gnb_UE_InitialContextSetup();


                   f_NGAP_gnb_RegistrationComplete(); // f_send_registration_complete
                   f_selfOrClientSyncAndVerdict(c_prDone, f_getVerdict());
                   log("*** " & __SCOPE__ & ": INFO: Preamble done. ***");

@@ -4447,6 +4451,7 @@ module NGAP_TCFunctions {
                  f_NGAP_gnb_UE_Authentication(); // f_await_authentication_request_send_authentication_response();
                  f_NGAP_gnb_UE_SecurityMode(); // f_await_securitymode_command_send_securitymode_complete();
                  f_NGAP_gnb_UE_InitialContextSetup(); // f_await_initial_context_setup_request_send_initial_context_setup_resonse
                  f_NGAP_gnb_RegistrationComplete(); // f_send_registration_complete

                  f_selfOrClientSyncAndVerdict(c_prDone, f_getVerdict());
                  log("*** " & __SCOPE__ & ": INFO: Preamble done. ***");
@@ -4487,6 +4492,7 @@ module NGAP_TCFunctions {
                  f_NGAP_gnb_UE_Authentication(); // f_await_authentication_request_send_authentication_response();
                  f_NGAP_gnb_UE_SecurityMode(); // f_await_securitymode_command_send_securitymode_complete();
                  f_NGAP_gnb_UE_InitialContextSetup(); // f_await_initial_context_setup_request_send_initial_context_setup_resonse
                  f_NGAP_gnb_RegistrationComplete(); // f_send_registration_complete

                  f_selfOrClientSyncAndVerdict(c_prDone, f_getVerdict());
                  log("*** " & __SCOPE__ & ": INFO: Preamble done. ***");
@@ -4533,6 +4539,7 @@ module NGAP_TCFunctions {
                  f_NGAP_gnb_UE_Authentication(); // f_await_authentication_request_send_authentication_response();
                  f_NGAP_gnb_UE_SecurityMode(); // f_await_securitymode_command_send_securitymode_complete();
                  f_NGAP_gnb_UE_InitialContextSetup(); // f_await_initial_context_setup_request_send_initial_context_setup_resonse
                  f_NGAP_gnb_RegistrationComplete(); // f_send_registration_complete

                  // TODO: hasEstablishedInitialContext
                  if (not(f_NGAP_gnb_UE_Has_EstablishedContextInproperly())) { // TODO FSCOM To check, not sure it address hasEstablishedInitialContext properly
@@ -4584,6 +4591,7 @@ module NGAP_TCFunctions {
                  f_NGAP_gnb_UE_Authentication(); // f_await_authentication_request_send_authentication_response();
                  f_NGAP_gnb_UE_SecurityMode(); // f_await_securitymode_command_send_securitymode_complete();
                  f_NGAP_gnb_UE_InitialContextSetup(); // f_await_initial_context_setup_request_send_initial_context_setup_resonse
                  f_NGAP_gnb_RegistrationComplete(); // f_send_registration_complete

                  f_selfOrClientSyncAndVerdict(c_prDone, f_getVerdict());
                  log("*** " & __SCOPE__ & ": INFO: Preamble done. ***");
@@ -4626,6 +4634,7 @@ module NGAP_TCFunctions {
                  f_NGAP_gnb_UE_Authentication(); // f_await_authentication_request_send_authentication_response();
                  f_NGAP_gnb_UE_SecurityMode(); // f_await_securitymode_command_send_securitymode_complete();
                  f_NGAP_gnb_UE_InitialContextSetup(); // f_await_initial_context_setup_request_send_initial_context_setup_resonse
                  f_NGAP_gnb_RegistrationComplete(); // f_send_registration_complete

                  f_selfOrClientSyncAndVerdict(c_prDone, f_getVerdict());
                  log("*** " & __SCOPE__ & ": INFO: Preamble done. ***");
@@ -4670,6 +4679,7 @@ module NGAP_TCFunctions {
                  f_NGAP_gnb_UE_Authentication(); // f_await_authentication_request_send_authentication_response();
                  f_NGAP_gnb_UE_SecurityMode(); // f_await_securitymode_command_send_securitymode_complete();
                  f_NGAP_gnb_UE_InitialContextSetup(); // f_await_initial_context_setup_request_send_initial_context_setup_resonse
                  f_NGAP_gnb_RegistrationComplete(); // f_send_registration_complete

                  f_selfOrClientSyncAndVerdict(c_prDone, f_getVerdict());
                  log("*** " & __SCOPE__ & ": INFO: Preamble done. ***");
@@ -4723,6 +4733,7 @@ module NGAP_TCFunctions {
                  f_NGAP_gnb_UE_Authentication(); // f_await_authentication_request_send_authentication_response();
                  f_NGAP_gnb_UE_SecurityMode(); // f_await_securitymode_command_send_securitymode_complete();
                  f_NGAP_gnb_UE_InitialContextSetup(); // f_await_initial_context_setup_request_send_initial_context_setup_resonse
                  f_NGAP_gnb_RegistrationComplete(); // f_send_registration_complete

                  f_selfOrClientSyncAndVerdict(c_prDone, f_getVerdict());
                  log("*** " & __SCOPE__ & ": INFO: Preamble done. ***");
@@ -4773,6 +4784,7 @@ module NGAP_TCFunctions {
                  f_NGAP_gnb_UE_Authentication(); // f_await_authentication_request_send_authentication_response();
                  f_NGAP_gnb_UE_SecurityMode(); // f_await_securitymode_command_send_securitymode_complete();
                  f_NGAP_gnb_UE_InitialContextSetup(); // f_await_initial_context_setup_request_send_initial_context_setup_resonse
                  f_NGAP_gnb_RegistrationComplete(); // f_send_registration_complete

                  f_NGAP_gnb_UE_HasPendingDataTransmission();

+76 −30

File changed.

Preview size limit exceeded, changes collapsed.

Loading