ItsSecurity_TestCases.ttcn3 987 KB
Newer Older
garciay's avatar
garciay committed
                    log("*** " & testcasename() & ": FAIL: GN was transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
garciay's avatar
garciay committed
                else {
garciay's avatar
garciay committed
                    log("*** " & testcasename() & ": PASS: GN was not transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                }
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
garciay's avatar
garciay committed
            } // End of testcase TC_SEC_ITSS_RCV_CAM_12_03_EB
garciay's avatar
garciay committed
             * @desc    Check that IUT discards a Secured CAM if the signer certificate of the message contains the subject type 'root_ca'
             * Pics Selection: PICS_GN_SECURITY
             * Config Id: CF01
garciay's avatar
garciay committed
             * Initial conditions:
             * with {
             *   the IUT being in the 'authorized' state
garciay's avatar
garciay committed
             *   and the IUT current time is inside the time validity period of CERT_TS_A_AT
             * Expected behaviour:
garciay's avatar
garciay committed
             * ensure that {
             *   when {
garciay's avatar
garciay committed
             *      the IUT is receiving a SecuredMessage (MSG_SEC_RCV_CAM_01)
             *          containing header_fields['signer_info']
             *              containing signer
garciay's avatar
garciay committed
             *                  containing type
             *                      indicating 'certificate'
garciay's avatar
garciay committed
             *              and certificate (CERT_TS_ROOT)
             *                  containing subject_info.subject_type
             *                      indicating 'root_ca'
             *   } then { 
             *      the IUT discards the message 
garciay's avatar
garciay committed
             * } 
garciay's avatar
garciay committed
             *
             * @see          ETSI TS 103 096-2 v1.2.2 TP_SEC_ITSS_RCV_CAM_12_04_BO
             * @reference    ETSI TS 103 097 [1], clauses 6.3
garciay's avatar
garciay committed
            testcase TC_SEC_ITSS_RCV_CAM_12_04_BO() runs on ItsGeoNetworking system ItsSecSystem {
garciay's avatar
garciay committed
                
                // Local variables
                var integer i;
                var GeoNetworkingPdu v_securedGnPdu;
                var GnRawPayload v_sentRawPayload;
garciay's avatar
garciay committed
                // Test adapter configuration
                if (not(PICS_GN_SECURITY)) {
                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
                    stop;
                }
                
garciay's avatar
garciay committed
                //  Test component configuration
                // Preamble
                f_prNeighbour();
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
garciay's avatar
garciay committed
                v_securedGnPdu := f_prepareSecuredCam(
                    cc_taCert_CA, 
                    {
                        m_header_field_generation_time(1000 * f_getCurrentTime()), // In us
                        m_header_field_its_aid_CAM
                    }, 
                    e_certificate,
                    true
                ); 
                f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast(v_securedGnPdu));
garciay's avatar
garciay committed
                
                f_sleep(PX_TNOAC);
                v_sentRawPayload := f_adaptPayloadForUtInd_m(v_securedGnPdu.gnPacket.packet.payload);
                for (i := 0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, v_sentRawPayload); i := i + 1) {
                    // empty on purpose 
garciay's avatar
garciay committed
                } // End of 'for' statement
garciay's avatar
garciay committed
                if (i < lengthof(vc_utInds)) {
garciay's avatar
garciay committed
                    log("*** " & testcasename() & ": FAIL: GN was transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
garciay's avatar
garciay committed
                else {
garciay's avatar
garciay committed
                    log("*** " & testcasename() & ": PASS: GN was not transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                }
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
            } // End of testcase TC_SEC_ITSS_RCV_CAM_12_04_EB
            
            /**
             * @desc    Check that IUT discards secured CAM signed with the not yet valid certificate
             * <pre>
             * Pics Selection: PICS_GN_SECURITY
             * Config Id: CF01
             * Initial conditions:
             *  with {
             *      the IUT being in the 'authorized' state
             *      and the IUT current time is inside the time validity period of CERT_TS_MSG_13_01_BO_AT
             *  }
             *  ensure that {
             *      when { 
             *          the IUT is receiving a SecuredMessage (MSG_SEC_RCV_CAM_01)
             *              containing header_fields['signer_info'].signer 
             *                  containing certificate (CERT_TS_MSG_13_01_BO_AT)
             *                      containing validity_restrictions['time_start_and_end']
             *                          containing start_validity
             *                              indicating START_VALIDITY_AT > CURRENT_TIME
             *                          and containing end_validity
             *                              indicating END_VALIDITY_AT > START_VALIDITY_AT
             *      } then {
             *          the IUT discards the message
             *      }
             *  }
             * </pre>
             *
             * @see          ETSI TS 103 096-2 v1.2.2 TP_SEC_ITSS_RCV_CAM_13_01_B)
             * @reference    ETSI TS 103 097 [1], clause 7.1
             */
            testcase TC_SEC_ITSS_RCV_CAM_13_01_BO() runs on ItsGeoNetworking system ItsSecSystem {
                
                // Local variables
                var integer i;
                var GeoNetworkingPdu v_securedGnPdu;
                var GnRawPayload v_sentRawPayload;
                
                // Test adapter configuration
                if (not(PICS_GN_SECURITY)) {
                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
                    stop;
                }
                
                //  Test component configuration
                f_cf01Up();
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
                v_securedGnPdu := f_sendSecuredCam(cc_taCertMsg1301_BO, omit, e_certificate);
                
                f_sleep(PX_TNOAC);
                v_sentRawPayload := f_adaptPayloadForUtInd_m(v_securedGnPdu.gnPacket.packet.payload);
                for (i := 0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, v_sentRawPayload); i := i + 1) {
                    // empty on purpose 
                } // End of 'for' statement
                if (i < lengthof(vc_utInds)) {
                    log("*** " & testcasename() & ": FAIL: GN was transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                }
garciay's avatar
garciay committed
                else {
                    log("*** " & testcasename() & ": PASS: GN was not transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                }
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
garciay's avatar
garciay committed
            } // End of testcase TC_SEC_ITSS_RCV_CAM_13_01_BO
garciay's avatar
garciay committed
             * @desc    Check that IUT discards secured CAM signed with the expired certificate
             * Pics Selection: PICS_GN_SECURITY
             * Config Id: CF01
garciay's avatar
garciay committed
             * Initial conditions:
             *  with {
             *      the IUT being in the 'authorized' state
             *      and the IUT current time is inside the time validity period of CERT_TS_MSG_13_02_BO_AT
             *  }
             *  ensure that {
             *      when { 
             *          the IUT is receiving a SecuredMessage (MSG_SEC_RCV_CAM_01)
             *              containing header_fields['signer_info'].signer 
             *                  containing certificate (CERT_TS_MSG_13_02_BO_AT)
             *                      containing validity_restrictions['time_start_and_end']
             *                          containing start_validity
             *                              indicating START_VALIDITY_AT < CURRENT_TIME
             *                          and containing end_validity
             *                              indicating END_VALIDITY_AT < START_VALIDITY_AT
             *      } then {
             *          the IUT discards the message
             *      }
             *  }
garciay's avatar
garciay committed
             *
             * @see          ETSI TS 103 096-2 v1.2.2 TP_SEC_ITSS_RCV_CAM_13_02_B)
             * @reference    ETSI TS 103 097 [1], clause 7.1
garciay's avatar
garciay committed
            testcase TC_SEC_ITSS_RCV_CAM_13_02_BO() runs on ItsGeoNetworking system ItsSecSystem {
garciay's avatar
garciay committed
                
                // Local variables
                var integer i;
                var GeoNetworkingPdu v_securedGnPdu;
                var GnRawPayload v_sentRawPayload;
garciay's avatar
garciay committed
                // Test adapter configuration
                if (not(PICS_GN_SECURITY)) {
                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
                    stop;
                }
                
garciay's avatar
garciay committed
                //  Test component configuration
                // Preamble
                f_prNeighbour();
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
garciay's avatar
garciay committed
                v_securedGnPdu := f_sendSecuredCam(cc_taCertMsg1302_BO, omit, e_certificate);
garciay's avatar
garciay committed
                
                f_sleep(PX_TNOAC);
                v_sentRawPayload := f_adaptPayloadForUtInd_m(v_securedGnPdu.gnPacket.packet.payload);
                for (i := 0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, v_sentRawPayload); i := i + 1) {
                    // empty on purpose 
garciay's avatar
garciay committed
                } // End of 'for' statement
garciay's avatar
garciay committed
                if (i < lengthof(vc_utInds)) {
garciay's avatar
garciay committed
                    log("*** " & testcasename() & ": FAIL: GN was transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                }
                else {
                    log("*** " & testcasename() & ": PASS: GN was not transmitted to upper layer ***");
garciay's avatar
garciay committed
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
garciay's avatar
garciay committed
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
            } // End of testcase TC_SEC_ITSS_RCV_CAM_13_02_BO
            
            /**
             * @desc    Check that IUT discards secured CAM when IUT location is outside the circular validity restriction of the signing certificate
             * <pre>
             * Pics Selection: PICS_GN_SECURITY
             * Config Id: CF01
             * Initial conditions:
             *  with {
             *      the IUT being in the 'authorized' state
             *      and the IUT current time is inside the time validity period of CERT_TS_MSG_13_03_BO_AT
             *      and the IUT current location is set to CURRENT_IUT_LOCATION
             *  }
             *  ensure that {
             *      when { 
             *          the IUT is receiving a SecuredMessage (MSG_SEC_RCV_CAM_01)
             *              containing header_fields['signer_info'].signer 
             *                  containing certificate (CERT_TS_MSG_13_03_BO_AT)
             *                      containing validity_restrictions['region']
             *                          containing region
             *                              containing region_type
             *                                  indicating 'circle'
             *                              and containing circular_region
             *                                  indicating REGION
             *                                      not containing the CURRENT_IUT_LOCATION
             *      } then {
             *          the IUT discards the message
             *      }
             *  }
             * </pre>
             *
             * @see          ETSI TS 103 096-2 v1.2.2 TP_SEC_ITSS_RCV_CAM_13_03_B)
             * @reference    ETSI TS 103 097 [1], clause 7.1
             */
            testcase TC_SEC_ITSS_RCV_CAM_13_03_BO() runs on ItsGeoNetworking system ItsSecSystem {
                
                // Local variables
                var integer i;
                var GeoNetworkingPdu v_securedGnPdu;
                var GnRawPayload v_sentRawPayload;
                
                // Test adapter configuration
                if (not(PICS_GN_SECURITY)) {
                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
                    stop;
                }
                
                //  Test component configuration
                f_cf01Up();
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
                v_securedGnPdu := f_sendSecuredCam(cc_taCertMsg1303_BO, omit, e_certificate);
                
                f_sleep(PX_TNOAC);
                v_sentRawPayload := f_adaptPayloadForUtInd_m(v_securedGnPdu.gnPacket.packet.payload);
                for (i := 0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, v_sentRawPayload); i := i + 1) {
                    // empty on purpose 
                } // End of 'for' statement
                if (i < lengthof(vc_utInds)) {
                    log("*** " & testcasename() & ": FAIL: GN was transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                }
garciay's avatar
garciay committed
                else {
garciay's avatar
garciay committed
                    log("*** " & testcasename() & ": PASS: GN was not transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                }
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
            } // End of testcase TC_SEC_ITSS_RCV_CAM_13_03_BO
            
            /**
             * @desc    Check that IUT discards secured CAM when IUT location is outside the rectangular validity restriction of the signing certificate
             * <pre>
             * Pics Selection: PICS_GN_SECURITY
             * Config Id: CF01
             * Initial conditions:
             *  with {
             *      the IUT being in the 'authorized' state
             *      and the IUT current time is inside the time validity period of CERT_TS_MSG_13_04_BO_AT
             *      and the IUT current location is set to CURRENT_IUT_LOCATION
             *  }
             *  ensure that {
             *      when { 
             *          the IUT is receiving a SecuredMessage (MSG_SEC_RCV_CAM_01)
             *              containing header_fields['signer_info'].signer 
             *                  containing certificate (CERT_TS_MSG_13_04_BO_AT)
             *                      containing validity_restrictions['region']
             *                          containing region
             *                              containing region_type
             *                                  indicating 'rectangle'
             *                              and containing rectanglar_region
             *                                  indicating REGION
             *                                      not containing the CURRENT_IUT_LOCATION
             *      } then {
             *          the IUT discards the message
             *      }
             *  }
             * </pre>
             *
             * @see          ETSI TS 103 096-2 v1.2.2 TP_SEC_ITSS_RCV_CAM_13_04_B)
             * @reference    ETSI TS 103 097 [1], clause 7.1
             */
            testcase TC_SEC_ITSS_RCV_CAM_13_04_BO() runs on ItsGeoNetworking system ItsSecSystem {
                
                // Local variables
                var integer i;
                var GeoNetworkingPdu v_securedGnPdu;
                var GnRawPayload v_sentRawPayload;
                
                // Test adapter configuration
                if (not(PICS_GN_SECURITY)) {
                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
                    stop;
                }
                
                //  Test component configuration
                f_cf01Up();
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
                v_securedGnPdu := f_sendSecuredCam(cc_taCertMsg1304_BO, omit, e_certificate);
                
                f_sleep(PX_TNOAC);
                v_sentRawPayload := f_adaptPayloadForUtInd_m(v_securedGnPdu.gnPacket.packet.payload);
                for (i := 0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, v_sentRawPayload); i := i + 1) {
                    // empty on purpose 
                } // End of 'for' statement
                if (i < lengthof(vc_utInds)) {
                    log("*** " & testcasename() & ": FAIL: GN was transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                }
garciay's avatar
garciay committed
                else {
                    log("*** " & testcasename() & ": PASS: GN was not transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                }
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
garciay's avatar
garciay committed
            } // End of testcase TC_SEC_ITSS_RCV_CAM_13_04_BO
garciay's avatar
garciay committed
             * @desc    Check that IUT discards secured CAM when IUT location is outside the polygonal validity restriction of the signing certificate
             * Pics Selection: PICS_GN_SECURITY
             * Config Id: CF01
garciay's avatar
garciay committed
             * Initial conditions:
             *  with {
             *      the IUT being in the 'authorized' state
             *      and the IUT current time is inside the time validity period of CERT_TS_MSG_13_05_BO_AT
             *      and the IUT current location is set to CURRENT_IUT_LOCATION
             *  }
             *  ensure that {
             *      when { 
             *          the IUT is receiving a SecuredMessage (MSG_SEC_RCV_CAM_01)
             *              containing header_fields['signer_info'].signer 
             *                  containing certificate (CERT_TS_MSG_13_05_BO_AT)
             *                      containing validity_restrictions['region']
             *                          containing region
garciay's avatar
garciay committed
             *                              containing region_type
             *                                  indicating 'polygon'
             *                              and containing polygonal_region
garciay's avatar
garciay committed
             *                                  indicating REGION
             *                                      not containing the CURRENT_IUT_LOCATION
             *      } then {
             *          the IUT discards the message
             *      }
             *  }
             * </pre>
             *
             * @see          ETSI TS 103 096-2 v1.2.2 TP_SEC_ITSS_RCV_CAM_13_05_B)
             * @reference    ETSI TS 103 097 [1], clause 7.1
             */
            testcase TC_SEC_ITSS_RCV_CAM_13_05_BO() runs on ItsGeoNetworking system ItsSecSystem {
                
                // Local variables
                var integer i;
                var GeoNetworkingPdu v_securedGnPdu;
                var GnRawPayload v_sentRawPayload;
                
                // Test adapter configuration
                if (not(PICS_GN_SECURITY)) {
                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
                    stop;
                }
                
                //  Test component configuration
                f_cf01Up();
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
                v_securedGnPdu := f_sendSecuredCam(cc_taCertMsg1305_BO, omit, e_certificate);
                
                f_sleep(PX_TNOAC);
                v_sentRawPayload := f_adaptPayloadForUtInd_m(v_securedGnPdu.gnPacket.packet.payload);
                for (i := 0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, v_sentRawPayload); i := i + 1) {
                    // empty on purpose 
                } // End of 'for' statement
                if (i < lengthof(vc_utInds)) {
                    log("*** " & testcasename() & ": FAIL: GN was transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                }
                else {
                    log("*** " & testcasename() & ": PASS: GN was not transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                }
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
            } // End of testcase TC_SEC_ITSS_RCV_CAM_13_05_BO
            
            /**
             * @desc    Check that IUT discards secured CAM when IUT location is outside the identified validity restriction of the signing certificate
             * <pre>
             * Pics Selection: PICS_GN_SECURITY
             * Config Id: CF01
             * Initial conditions:
             *  with {
             *      the IUT being in the 'authorized' state
             *      and the IUT current time is inside the time validity period of CERT_TS_MSG_13_06_BO_AT
             *      and the IUT current location is set to CURRENT_IUT_LOCATION
             *  }
             *  ensure that {
             *      when { 
             *          the IUT is receiving a SecuredMessage (MSG_SEC_RCV_CAM_01)
             *              containing header_fields['signer_info'].signer 
             *                  containing certificate (CERT_TS_MSG_13_06_BO_AT)
             *                      containing validity_restrictions['region']
             *                          containing region
             *                              containing region_type
             *                                  indicating 'id'
             *                              and containing id_region
             *                                  indicating REGION
             *                                      not containing the CURRENT_IUT_LOCATION
             *      } then {
             *          the IUT discards the message
             *      }
             *  }
             * </pre>
             *
             * @see          ETSI TS 103 096-2 v1.2.2 TP_SEC_ITSS_RCV_CAM_13_06_B)
             * @reference    ETSI TS 103 097 [1], clause 7.1
             */
            testcase TC_SEC_ITSS_RCV_CAM_13_06_BO() runs on ItsGeoNetworking system ItsSecSystem {
                
                // Local variables
                var integer i;
                var GeoNetworkingPdu v_securedGnPdu;
                var GnRawPayload v_sentRawPayload;
                
                // Test adapter configuration
                if (not(PICS_GN_SECURITY)) {
                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
                    stop;
                }
                
                //  Test component configuration
                f_cf01Up();
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
                v_securedGnPdu := f_sendSecuredCam(cc_taCertMsg1306_BO, omit, e_certificate);
                
                f_sleep(PX_TNOAC);
                v_sentRawPayload := f_adaptPayloadForUtInd_m(v_securedGnPdu.gnPacket.packet.payload);
                for (i := 0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, v_sentRawPayload); i := i + 1) {
                    // empty on purpose 
                } // End of 'for' statement
                if (i < lengthof(vc_utInds)) {
                    log("*** " & testcasename() & ": FAIL: GN was transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                }
                else {
                    log("*** " & testcasename() & ": PASS: GN was not transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                }
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
            } // End of testcase TC_SEC_ITSS_RCV_CAM_13_06_BO
            
        } // End of group recvCamProfile
        
        /**
         * @desc Receiving behaviour test cases for DENM profile
         * @see ETSI TS 103 096-2 V1.2.2 (2016-01) Clause 5.3.3 DENM Profile
         */
        group recvDenmProfile {
            
            /**
             * @desc    Check that IUT accepts a well-formed Secured DENM signed with the certificate without region validity restriction
             * <pre>
             * Pics Selection: PICS_GN_SECURITY
             * Config Id: CF01
             * Expected behavior:
             * with {
             *   the IUT being in the 'authorized' state
             *   and the IUT current time is inside the time validity period of CERT_TS_A_AT
             * }
             * ensure that {
             *   when {
             *     the IUT is receiving a SecuredMessage
             *          containing header_fields[0]
             *              containing type 
             *                  indicating 'signer_info'
             *              and containing signer
             *                  containing type
             *                      indicating 'certificate'
             *                  and containing certificate (CERT_AT_A)
             *                      containing subject_info.subject_type
             *                          indicating 'authorization_ticket' (2)
             *                      and containing subject_attributes['verification key'] (KEY)
             *             and not containing validity_restrictions['region']
             *       and containing header_fields [1]
             *         containing type 
             *           indicating 'generation_time'
             *              containing generation_time
             *                  indicating CURRENT_TIME
             *       and containing header_fields [2]
             *         containing type 
             *           indicating 'generation_location'
             *              containing generation_location
garciay's avatar
garciay committed
             *       and containing header_fields[3]
             *         containing type 
             *           indicating 'its_aid'
             *         containing its_aid
             *              indicating 'AID_DENM'
garciay's avatar
garciay committed
             *          and containing payload_field
garciay's avatar
garciay committed
             *              containing type
             *                  indicating 'signed'
             *              containing data
             *                  indicating length > 0
             *                  containing DENM payload
garciay's avatar
garciay committed
             *          and containing trailer_fields
             *              containing single instance of type TrailerField
garciay's avatar
garciay committed
             *                  containing type
             *                      indicating 'signature'
             *                  containing signature
             *                      verifiable using KEY
garciay's avatar
garciay committed
             *     the IUT accepts the message
garciay's avatar
garciay committed
12609 12610 12611 12612 12613 12614 12615 12616 12617 12618 12619 12620 12621 12622 12623 12624 12625 12626 12627 12628 12629 12630 12631 12632 12633 12634 12635 12636 12637 12638 12639 12640 12641 12642 12643 12644 12645 12646 12647 12648 12649 12650 12651 12652 12653 12654 12655 12656 12657 12658 12659 12660 12661 12662 12663 12664 12665 12666 12667 12668 12669 12670 12671 12672 12673 12674 12675 12676 12677 12678 12679 12680 12681 12682 12683 12684 12685 12686 12687 12688 12689 12690 12691 12692 12693 12694 12695 12696 12697 12698 12699 12700 12701 12702 12703 12704 12705 12706 12707 12708 12709 12710 12711 12712 12713 12714 12715 12716 12717 12718 12719 12720 12721 12722 12723 12724 12725 12726 12727 12728 12729 12730 12731 12732 12733 12734 12735 12736 12737 12738 12739 12740 12741 12742 12743 12744 12745 12746 12747 12748 12749 12750 12751 12752 12753 12754 12755 12756 12757 12758 12759 12760 12761 12762 12763 12764 12765 12766 12767 12768 12769 12770 12771 12772 12773 12774 12775 12776 12777 12778 12779 12780 12781 12782 12783 12784 12785 12786 12787 12788 12789 12790 12791 12792 12793 12794 12795 12796 12797 12798 12799 12800 12801 12802 12803 12804 12805 12806 12807 12808 12809 12810 12811 12812 12813 12814 12815 12816 12817 12818 12819 12820 12821 12822 12823 12824 12825 12826 12827 12828 12829 12830 12831 12832 12833 12834 12835 12836 12837 12838 12839 12840 12841 12842 12843 12844 12845 12846 12847 12848 12849 12850 12851 12852 12853 12854 12855 12856 12857 12858 12859 12860 12861 12862 12863 12864 12865 12866 12867 12868 12869 12870 12871 12872 12873 12874 12875 12876 12877 12878 12879 12880 12881 12882 12883 12884 12885 12886 12887 12888 12889 12890 12891 12892 12893 12894 12895 12896 12897 12898 12899 12900 12901 12902 12903 12904 12905 12906 12907 12908 12909 12910 12911 12912 12913 12914 12915 12916 12917 12918 12919 12920 12921 12922 12923 12924 12925 12926 12927 12928 12929 12930 12931 12932 12933 12934 12935 12936 12937 12938 12939 12940 12941 12942 12943 12944 12945 12946 12947 12948 12949 12950 12951 12952 12953 12954 12955 12956 12957 12958 12959 12960 12961 12962 12963 12964 12965 12966 12967 12968 12969 12970 12971 12972 12973 12974 12975 12976 12977 12978 12979 12980 12981 12982 12983 12984 12985 12986 12987 12988 12989 12990 12991 12992 12993 12994 12995 12996 12997 12998 12999 13000
             * @see          ETSI TS 103 096-2 v1.2.2 TP_SEC_ITSS_RCV_DENM_01_01_BV
             * @reference    ETSI TS 103 097 [1], clause 7.2
             */
            testcase TC_SEC_ITSS_RCV_DENM_01_01_BV() runs on ItsGeoNetworking system ItsSecSystem {
                
                // Local variables
                var integer i;
                var GeoNetworkingPdu v_securedGnPdu;
                var GnRawPayload v_sentRawPayload;
                
                // Test control
                if (not(PICS_GN_SECURITY)) {
                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
                    stop;
                }
                
                //  Test component configuration
                f_cf01Up();
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
                v_securedGnPdu := f_sendSecuredDenm(cc_taCert_A, omit, e_certificate);
                
                f_sleep(PX_TNOAC);
                v_sentRawPayload := f_adaptPayloadForUtInd_m(v_securedGnPdu.gnPacket.packet.payload);
                for (i := 0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, v_sentRawPayload); i := i + 1) {
                    // empty on purpose 
                }
                if (i < lengthof(vc_utInds)) {
                    log("*** " & testcasename() & ": PASS: DENM was transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                }
                else {
                    log("*** " & testcasename() & ": FAIL: DENM was not transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                }
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
            } // End of testcase TC_SEC_ITSS_RCV_DENM_01_01_BV
            
            /**
             * @desc    Check that IUT accepts a well-formed Secured DENM signe with the certificate with a circular region validity restriction
             * <pre>
             * Pics Selection: PICS_GN_SECURITY
             * Config Id: CF01
             * Expected behavior:
             * with {
             *   the IUT being in the 'authorized' state
             *   and the IUT current time is inside the time validity period of CERT_TS_B_AT
             *   and the IUT current location is inside the region validity period of CERT_TS_B_AT
             * }
             * ensure that {
             *   when {
             *     the IUT is receiving a SecuredMessage
             *       and containing header_fields[0]
             *              containing type 
             *                  indicating 'signer_info'
             *              and containing signer {
             *                  containing type
             *                      indicating 'certificate'
             *                  and containing certificate (CERT_AT_B) {
             *                      containing subject_info.subject_type
             *                          indicating 'authorization_ticket' (2)
             *                      and containing subject_attributes['verification key'] (KEY)
             *                      and containing validity_restrictions['region'] {
             *                          containing region{
             *                              containing region_type
             *                                  indicating 'circle'
             *                              and containing circular_region
             *                                  indicating REGION
             *                          }
             *                      }
             *                  }
             *       and containing header_fields [1]
             *         containing type 
             *           indicating 'generation_time'
             *              containing generation_time
             *                  indicating CURRENT_TIME
             *       and containing header_fields [2]
             *         containing type 
             *           indicating 'generation_location'
             *              containing generation_location
             *                  indicating position inside the REGION
             *       and containing header_fields[3]
             *         containing type 
             *           indicating 'its_aid'
             *         containing its_aid
             *              indicating 'AID_DENM'
             *       and not containing any other header_fields
             *       and containing payload_fields {
             *              containing type
             *                  indicating 'signed'
             *              containing data
             *                  indicating length > 0
             *                  containing DENM payload
             *          }
             *          and containing trailer_fields {
             *              containing single instance of type TrailerField {
             *                  containing type
             *                      indicating 'signature'
             *                  containing signature
             *                      verifiable using KEY
             *              }
             *          }
             *   } then {
             *     the IUT accepts the message
             *   }
             * }
             * </pre>
             * @see          ETSI TS 103 096-2 v1.2.2 TP_SEC_ITSS_RCV_DENM_01_02_BV
             * @reference    ETSI TS 103 097 [1], clause 7.2
             */
            testcase TC_SEC_ITSS_RCV_DENM_01_02_BV() runs on ItsGeoNetworking system ItsSecSystem {
                
                // Local variables
                var integer i;
                var GeoNetworkingPdu v_securedGnPdu;
                var GnRawPayload v_sentRawPayload;
                
                // Test control
                if (not(PICS_GN_SECURITY)) {
                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
                    stop;
                }
                
                //  Test component configuration
                f_cf01Up();
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
                v_securedGnPdu := f_sendSecuredDenm(cc_taCert_B, omit, e_certificate);
                
                f_sleep(PX_TNOAC);
                v_sentRawPayload := f_adaptPayloadForUtInd_m(v_securedGnPdu.gnPacket.packet.payload);
                for (i := 0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, v_sentRawPayload); i := i + 1) {
                    // empty on purpose 
                }
                if (i < lengthof(vc_utInds)) {
                    log("*** " & testcasename() & ": PASS: DENM was transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                }
                else {
                    log("*** " & testcasename() & ": FAIL: DENM was not transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                }
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
            } // End of testcase TC_SEC_ITSS_RCV_DENM_01_02_BV
            
            /**
             * @desc    Check that IUT accepts a well-formed Secured DENM signe with the certificate with a rectangular region validity restriction
             * <pre>
             * Pics Selection: PICS_GN_SECURITY
             * Config Id: CF01
             * Expected Behavior:
             * with {
             *   the IUT being in the 'authorized' state
             *   and the IUT current time is inside the time validity period of CERT_TS_C_AT
             *   and the IUT current location is inside the region validity period of CERT_TS_C_AT
             * }
             * ensure that {
             *   when {
             *     the IUT is receiving a SecuredMessage
             *       containing protocol_version 
             *         indicating value '2'
             *       and containing header_fields[0]
             *              containing type 
             *                  indicating 'signer_info'
             *              and containing signer
             *                  containing type
             *                      indicating 'certificate'
             *                  and containing certificate (CERT_AT_C)
             *                      containing subject_info.subject_type
             *                          indicating 'authorization_ticket' (2)
             *                      and containing subject_attributes['verification key'] (KEY)
             *                      and containing validity_restrictions['region']
             *                          containing region
             *                              containing region_type
             *                                  indicating 'rectangle'
             *                              and containing rectangular_regions
             *                                  indicating REGIONS
             *       and containing header_fields [1]
             *         containing type 
             *           indicating 'generation_time'
             *              containing generation_time
             *                  indicating CURRENT_TIME
             *       and containing header_fields [2]
             *         containing type 
             *           indicating 'generation_location'
             *              containing generation_location
             *           indicating position inside the REGION
             *       and containing header_fields[3]
             *         containing type 
             *           indicating 'its_aid'
             *         containing its_aid
             *              indicating 'AID_DENM'
             *       and not containing any other header_fields
             *          and containing payload_field
             *              containing type
             *                  indicating 'signed'
             *              containing data
             *                  indicating length > 0
             *                  containing DENM payload
             *          and containing trailer_fields
             *              containing single instance of type TrailerField
             *                  containing type
             *                      indicating 'signature'
             *                  containing signature
             *                      verifiable using KEY
             *   } then {
             *     the IUT accepts the message
             *   }
             * }
             * </pre>
             * @see          ETSI TS 103 096-2 v1.2.2 TP_SEC_ITSS_RCV_DENM_01_03_BV
             * @reference    ETSI TS 103 097 [1], clause 7.2
             */
            testcase TC_SEC_ITSS_RCV_DENM_01_03_BV() runs on ItsGeoNetworking system ItsSecSystem {
                
                // Local variables
                var integer i;
                var GeoNetworkingPdu v_securedGnPdu;
                var GnRawPayload v_sentRawPayload;
                
                // Test control
                if (not(PICS_GN_SECURITY)) {
                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
                    stop;
                }
                
                //  Test component configuration
                f_cf01Up();
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
                v_securedGnPdu := f_sendSecuredDenm(cc_taCert_C, omit, e_certificate);
                
                f_sleep(PX_TNOAC);
                v_sentRawPayload := f_adaptPayloadForUtInd_m(v_securedGnPdu.gnPacket.packet.payload);
                for (i := 0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, v_sentRawPayload); i := i + 1) {
                    // empty on purpose 
                }
                if (i < lengthof(vc_utInds)) {
                    log("*** " & testcasename() & ": PASS: DENM was transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                }
                else {
                    log("*** " & testcasename() & ": FAIL: DENM was not transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                }
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
            } // End of testcase TC_SEC_ITSS_RCV_DENM_01_03_BV
            
            /**
             * @desc    Check that IUT accepts a well-formed Secured DENM signe with the certificate with a polygonal region validity restriction 
             * <pre>
             * Pics Selection: PICS_GN_SECURITY
             * Config Id: CF01
             * Expected Behavior:
             * with {
             *   the IUT being in the 'authorized' state
             *   and the IUT current time is inside the time validity period of CERT_TS_D_AT
             *   and the IUT current location is inside the region validity period of CERT_TS_D_AT
             * }
             * ensure that {
             *   when {
             *     the IUT is receiving a SecuredMessage
             *       containing protocol_version 
             *         indicating value '2'
             *       and containing header_fields[0]
             *              containing type 
             *                  indicating 'signer_info'
             *              and containing signer
             *                  containing type
             *                      indicating 'certificate'
             *                  and containing certificate (CERT_AT_D) 
             *                      containing subject_info.subject_type
             *                          indicating 'authorization_ticket' (2)
             *                      and containing subject_attributes['verification key'] (KEY)
             *                      and containing validity_restrictions['region'] 
             *                          containing region
             *                              containing region_type
             *                                  indicating 'polygon'
             *                              and containing polygonal_region
             *                   indicating REGION
             *       and containing header_fields [1]
             *         containing type 
             *           indicating 'generation_time'
             *              containing generation_time
             *                  indicating CURRENT_TIME
             *       and containing header_fields [2]
             *         containing type 
             *           indicating 'generation_location'
             *              containing generation_location
             *           indicating position inside the REGION
             *       and containing header_fields[3]
             *         containing type 
             *           indicating 'its_aid'
             *         containing its_aid
             *              indicating 'AID_DENM'
             *       and not containing any other header_fields
             *          and containing payload_field 
             *              containing type
             *                  indicating 'signed'
             *              containing data
             *                  indicating length > 0
             *                  containing DENM payload
             *          and containing trailer_fields
             *              containing single instance of type TrailerField
             *                  containing type
             *                      indicating 'signature'
             *                  containing signature
             *                      verifiable using KEY
             *   } then {
             *     the IUT accepts the message
             *   }
             * }
             * </pre>
             * @see          ETSI TS 103 096-2 v1.2.2 TP_SEC_ITSS_RCV_DENM_01_04_BV
             * @reference    ETSI TS 103 097 [1], clause 7.2
             */
            testcase TC_SEC_ITSS_RCV_DENM_01_04_BV() runs on ItsGeoNetworking system ItsSecSystem {
                
                // Local variables
                var integer i;
                var GeoNetworkingPdu v_securedGnPdu;
                var GnRawPayload v_sentRawPayload;
                
                // Test control
                if (not(PICS_GN_SECURITY)) {
                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
                    stop;
                }
                
                //  Test component configuration
                f_cf01Up();
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
                v_securedGnPdu := f_sendSecuredDenm(cc_taCert_D, omit, e_certificate);
                
                f_sleep(PX_TNOAC);
                v_sentRawPayload := f_adaptPayloadForUtInd_m(v_securedGnPdu.gnPacket.packet.payload);
                for (i := 0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, v_sentRawPayload); i := i + 1) {
                    // empty on purpose 
                }
                if (i < lengthof(vc_utInds)) {
                    log("*** " & testcasename() & ": PASS: DENM was transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                }
                else {
                    log("*** " & testcasename() & ": FAIL: DENM was not transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                }
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
            } // End of testcase TC_SEC_ITSS_RCV_DENM_01_04_BV
            
            /**
             * @desc    Check that IUT accepts a well-formed Secured DENM signe with the certificate with a identified region validity restriction 
             * <pre>
             * Pics Selection: PICS_GN_SECURITY
             * Config Id: CF01