ItsSecurity_TestCases.ttcn 1.35 MB
Newer Older
filatov's avatar
filatov committed
             * </pre>
filatov's avatar
filatov committed
             * @see         ETSI TS 103 096-2 v1.3.1 TP_SEC_ITSS_RCV_CAM_13_01_BO
             * @reference   ETSI TS 103 097 v1.2.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);
                }
                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_01_BO
            
            /**
filatov's avatar
filatov committed
             * @desc  Check that IUT discards secured CAM signed with the expired certificate
             * <pre>
             * Pics Selection: PICS_GN_SECURITY
             * Config Id: CF01
             * Initial conditions:
filatov's avatar
filatov committed
             *   with
             *     the IUT being in the 'authorized' state
             *     and the IUT current time is before the time validity period of CERT_TS_MSG_13_02_BO_AT
             * Expected results:
             *   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 < CURRENT_TIME
             *     then
             *       the IUT discards the message
             * </pre>
filatov's avatar
filatov committed
             * @see         ETSI TS 103 096-2 v1.3.1 TP_SEC_ITSS_RCV_CAM_13_02_BO
             * @reference   ETSI TS 103 097 v1.2.1, clause 7.1
             */
            testcase TC_SEC_ITSS_RCV_CAM_13_02_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_taCertMsg1302_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_02_BO
            
            /**
filatov's avatar
filatov committed
             * @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:
filatov's avatar
filatov committed
             *   with
             *     the IUT being in the 'authorized' state
             *     and the IUT current time is inside the validity period of CERT_TS_MSG_13_03_BO_AT
             *     and the IUT current location is set to CURRENT_IUT_LOCATION
             * Expected results:
             *   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>
filatov's avatar
filatov committed
             * @see         ETSI TS 103 096-2 v1.3.1 TP_SEC_ITSS_RCV_CAM_13_03_BO
             * @reference   ETSI TS 103 097 v1.2.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);
                }
                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_03_BO
            
            /**
filatov's avatar
filatov committed
             * @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:
filatov's avatar
filatov committed
             *   with
             *     the IUT being in the 'authorized' state
             *     and the IUT current time is inside the validity period of CERT_TS_MSG_13_04_BO_AT
             *     and the IUT current location is set to CURRENT_IUT_LOCATION
             * Expected results:
             *   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 rectangular_regions
             *                   indicating REGION
             *                     not containing the CURRENT_IUT_LOCATION
             *     then
             *       the IUT discards the message
             * </pre>
filatov's avatar
filatov committed
             * @see         ETSI TS 103 096-2 v1.3.1 TP_SEC_ITSS_RCV_CAM_13_04_BO
             * @reference   ETSI TS 103 097 v1.2.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);
                }
                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_04_BO
            
            /**
filatov's avatar
filatov committed
             * @desc  Check that IUT discards secured CAM when IUT location is outside the polygonal validity restriction of the signing certificate
             * <pre>
             * Pics Selection: PICS_GN_SECURITY
             * Config Id: CF01
             * Initial conditions:
filatov's avatar
filatov committed
             *   with
             *     the IUT being in the 'authorized' state
             *     and the IUT current time is inside the validity period of CERT_TS_MSG_13_05_BO_AT
             *     and the IUT current location is set to CURRENT_IUT_LOCATION
             * Expected results:
             *   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
             *                 containing region_type
             *                   indicating 'polygon'
             *                 and containing polygonal_region
             *                   indicating REGION
             *                     not containing the CURRENT_IUT_LOCATION
             *     then
             *       the IUT discards the message
             * </pre>
filatov's avatar
filatov committed
             * @see         ETSI TS 103 096-2 v1.3.1 TP_SEC_ITSS_RCV_CAM_13_05_BO
             * @reference   ETSI TS 103 097 v1.2.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
            
            /**
filatov's avatar
filatov committed
             * @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:
filatov's avatar
filatov committed
             *   with
             *     the IUT being in the 'authorized' state
             *     and the IUT current time is inside the validity period of CERT_TS_MSG_13_06_BO_AT
             *     and the IUT current location is set to CURRENT_IUT_LOCATION
             * Expected results:
             *   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>
filatov's avatar
filatov committed
             * @see         ETSI TS 103 096-2 v1.3.1 TP_SEC_ITSS_RCV_CAM_13_06_BO
             * @reference   ETSI TS 103 097 v1.2.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 {
            
            /**
filatov's avatar
filatov committed
             * @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
filatov's avatar
filatov 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_A_AT
             * Expected results:
             *   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_TS_A_AT)
             *               containing subject_info.subject_type
             *                 indicating 'authorization_ticket'
             *               and containing subject_attributes['verification key']
             *                 containing key (KEY)
             *               and not containing validity_restrictions['region']
             *         and containing header_fields [1]
             *           containing type
             *             indicating 'generation_time'
             *           and containing generation_time
             *             indicating CURRENT_TIME
             *         and containing header_fields [2]
             *           containing type
             *             indicating 'generation_location'
             *           and containing generation_location
             *         and containing header_fields[3]
             *           containing type
             *             indicating 'its_aid'
             *           and containing its_aid
             *             indicating 'AID_DENM'
             *         and containing payload_field
             *           containing type
             *             indicating 'signed'
             *           and containing data
             *             indicating length > 0
             *             and containing DENM payload
             *         and containing trailer_fields
             *           containing single instance of type TrailerField
             *             containing type
             *               indicating 'signature'
             *             and containing signature
             *               verifiable using KEY
             *     then
             *       the IUT accepts the message
             * </pre>
filatov's avatar
filatov committed
             * @see         ETSI TS 103 096-2 v1.3.1 TP_SEC_ITSS_RCV_DENM_01_01_BV
             * @reference   ETSI TS 103 097 v1.2.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
            
            /**
filatov's avatar
filatov committed
             * @desc  Check that IUT accepts a well-formed Secured DENM signed with the certificate with a circular region validity restriction
             * <pre>
             * Pics Selection: PICS_GN_SECURITY
             * Config Id: CF01
filatov's avatar
filatov 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_B_AT
             *     and the IUT current location is inside the region validity period of CERT_TS_B_AT
             * Expected results:
             *   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_TS_B_AT)
             *               containing subject_info.subject_type
             *                 indicating 'authorization_ticket'
             *               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'
             *           and containing generation_time
             *             indicating CURRENT_TIME
             *         and containing header_fields [2]
             *           containing type
             *             indicating 'generation_location'
             *           and containing generation_location
             *             indicating position inside the REGION
             *         and containing header_fields[3]
             *           containing type
             *             indicating 'its_aid'
             *           and containing its_aid
             *             indicating 'AID_DENM'
             *         and not containing any other header_fields
             *         and containing payload_fields
             *           containing type
             *             indicating 'signed'
             *           and containing data
             *             indicating length > 0
             *             and containing DENM payload
             *         and containing trailer_fields
             *           containing single instance of type TrailerField
             *             containing type
             *               indicating 'signature'
             *             and containing signature
             *               verifiable using KEY
             *     then
             *       the IUT accepts the message
             * </pre>
filatov's avatar
filatov committed
             * @see         ETSI TS 103 096-2 v1.3.1 TP_SEC_ITSS_RCV_DENM_01_02_BV
             * @reference   ETSI TS 103 097 v1.2.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
            
            /**
filatov's avatar
filatov committed
             * @desc  Check that IUT accepts a well-formed Secured DENM signed with the certificate with a rectangular region validity restriction
             * <pre>
             * Pics Selection: PICS_GN_SECURITY
             * Config Id: CF01
filatov's avatar
filatov 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_C_AT
             *     and the IUT current location is inside the region validity period of CERT_TS_C_AT
             * Expected results:
             *   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_TS_C_AT)
             *               containing subject_info.subject_type
             *                 indicating 'authorization_ticket'
             *               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'
             *           and containing generation_time
             *             indicating CURRENT_TIME
             *         and containing header_fields [2]
             *           containing type
             *             indicating 'generation_location'
             *           and containing generation_location
             *             indicating position inside the REGION
             *         and containing header_fields[3]
             *           containing type
             *             indicating 'its_aid'
             *           and containing its_aid
             *             indicating 'AID_DENM'
             *         and not containing any other header_fields
             *         and containing payload_field
             *           containing type
             *             indicating 'signed'
             *           and containing data
             *             indicating length > 0
             *             and containing DENM payload
             *         and containing trailer_fields
             *           containing single instance of type TrailerField
             *             containing type
             *               indicating 'signature'
             *             and containing signature
             *               verifiable using KEY
             *     then
             *       the IUT accepts the message
             * </pre>
filatov's avatar
filatov committed
             * @see         ETSI TS 103 096-2 v1.3.1 TP_SEC_ITSS_RCV_DENM_01_03_BV
             * @reference   ETSI TS 103 097 v1.2.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
            
            /**
filatov's avatar
filatov committed
             * @desc  Check that IUT accepts a well-formed Secured DENM signed with the certificate with a polygonal region validity restriction
             * <pre>
             * Pics Selection: PICS_GN_SECURITY
             * Config Id: CF01
filatov's avatar
filatov 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_D_AT
             *     and the IUT current location is inside the region validity period of CERT_TS_D_AT
             * Expected results:
             *   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_TS_D_AT)
             *               containing subject_info.subject_type
             *                 indicating 'authorization_ticket'
             *               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'
             *           and containing generation_time
             *             indicating CURRENT_TIME
             *         and containing header_fields [2]
             *           containing type
             *             indicating 'generation_location'
             *           and containing generation_location
             *             indicating position inside the REGION
             *         and containing header_fields[3]
             *           containing type
             *             indicating 'its_aid'
             *           and containing its_aid
             *             indicating 'AID_DENM'
             *         and not containing any other header_fields
             *         and containing payload_field
             *           containing type
             *             indicating 'signed'
             *           and containing data
             *             indicating length > 0
             *             and containing DENM payload
             *         and containing trailer_fields
             *           containing single instance of type TrailerField
             *             containing type
             *               indicating 'signature'
             *             and containing signature
             *               verifiable using KEY
             *     then
             *       the IUT accepts the message
             * </pre>
filatov's avatar
filatov committed
             * @see         ETSI TS 103 096-2 v1.3.1 TP_SEC_ITSS_RCV_DENM_01_04_BV
             * @reference   ETSI TS 103 097 v1.2.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
            
            /**
filatov's avatar
filatov committed
             * @desc  Check that IUT accepts a well-formed Secured DENM signed with the certificate with a identified region validity restriction
             * <pre>
             * Pics Selection: PICS_GN_SECURITY
             * Config Id: CF01
filatov's avatar
filatov 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_E_AT
             *     and the IUT current location is inside the region validity period of CERT_TS_E_AT
             * Expected results:
             *   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_TS_E_AT)
             *               containing subject_info.subject_type
             *                 indicating 'authorization_ticket'
             *               and containing subject_attributes['verification key'] (KEY)
             *               and containing validity_restrictions['region']
             *                 containing region
             *                   containing region_type
             *                     indicating 'id_region'
             *                   and containing identified_region
             *                     indicating REGION
             *         and containing header_fields [1]
             *           containing type
             *             indicating 'generation_time'
             *           and containing generation_time
             *             indicating CURRENT_TIME
             *         and containing header_fields [2]
             *           containing type
             *             indicating 'generation_location'
             *           and containing generation_location
             *             indicating position inside the REGION
             *         and containing header_fields[3]
             *           containing type
             *             indicating 'its_aid'
             *           and containing its_aid
             *             indicating 'AID_DENM'
             *         and not containing any other header_fields
             *         and containing payload_field
             *           containing type
             *             indicating 'signed'
             *           and containing data
             *             indicating length > 0
             *             and containing DENM payload
             *         and containing trailer_fields
             *           containing single instance of type TrailerField
             *             containing type
             *               indicating 'signature'
             *             and containing signature
             *               verifiable using KEY
             *     then
             *       the IUT accepts the message
             * </pre>
filatov's avatar
filatov committed
             * @see         ETSI TS 103 096-2 v1.3.1 TP_SEC_ITSS_RCV_DENM_01_05_BV
             * @reference   ETSI TS 103 097 v1.2.1, clause 7.2
             */
            testcase TC_SEC_ITSS_RCV_DENM_01_05_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_05_BV
            
            /**
filatov's avatar
filatov committed
             * @desc  Check that IUT discards a Secured DENM containing protocol version set to a value less than 2
             * <pre>
             * Pics Selection: PICS_GN_SECURITY
             * Config Id: CF01
             * Initial conditions:
filatov's avatar
filatov committed
             *   with
             *     the IUT being in the 'authorized' state
             *     and the IUT current time is inside the time validity period of CERT_TS_A_AT
             * Expected results:
             *   ensure that
             *     when
             *       the IUT is receiving a SecuredMessage (MSG_SEC_RCV_DENM_A)
             *         containing protocol_version
             *           indicating 1
             *     then
             *       the IUT discards a SecuredMessage
             * </pre>
filatov's avatar
filatov committed
             * @see         ETSI TS 103 096-2 v1.3.1 TP_SEC_ITSS_RCV_DENM_02_01_BO
             * @reference   ETSI TS 103 097 v1.2.1, clause 5.1
             */
            testcase TC_SEC_ITSS_RCV_DENM_02_01_BO() 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);