ItsSecurity_TestCases.ttcn 1.35 MB
Newer Older
                v_securedGnPdu := f_sendSecuredCam(cc_taCert0202_BO, omit, e_certificate_chain);
                
                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() & ": 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_CERT_02_02_BO
            
            /**
filatov's avatar
filatov committed
             * @desc  Check that IUT discards a SecuredMessage if the issuer certificate of the authorization ticket certificate contains the subject type 'enrolment_authority'
             * <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_02_03_BO_AT
             * Expected results:
             *   ensure that
             *     when the IUT is receiving a SecuredMessage
             *       containing header_fields ['signer_info']
             *         containing signer
             *           containing type
             *             indicating 'certificate'
             *           and containing certificate (CERT_TS_02_03_BO_AT)
             *             containing signer_info.type
             *               indicating 'certificate_digest_with_sha256'
             *             and containing signer_info.digest
             *               referencing to certificate (CERT_TS_A_EA)
             *                 containing subject_info.subject_type
             *                   indicating 'enrolment_authority'
             *     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_CERT_02_03_BO
             * @reference   ETSI TS 103 097 v1.2.1, clause 6.3
             */
            testcase TC_SEC_ITSS_RCV_CERT_02_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_taCert0203_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 
                }
                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_CERT_02_03_BO
            
            /**
filatov's avatar
filatov committed
             * @desc  Check that IUT discards a SecuredMessage if the issuer certificate of the authorization authority certificate contains the subject type 'enrolment_authority'
             * <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_02_04_BO_AT
             * Expected results:
             *   ensure that
             *     when the IUT is receiving a SecuredMessage
             *       containing header_fields ['signer_info']
             *         containing signer
             *           containing type
             *             indicating 'certificate_chain'
             *           and containing certificates[0] (CERT_TS_02_04_BO_AA)
             *             containing signer_info.digest
             *               referencing to certificate CERT_TS_A_EA
             *                 containing subject_info.subject_type
             *                   indicating 'enrolment_authority'
             *           and containing certificates[1] (CERT_TS_02_04_BO_AT)
             *             containing signer_info.digest
             *               referencing to CERT_TS_02_04_BO_AA
             *     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_CERT_02_04_BO
             * @reference   ETSI TS 103 097 v1.2.1, clause 6.3
             */
            testcase TC_SEC_ITSS_RCV_CERT_02_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_taCert0204_BO, omit, e_certificate_chain);
                
                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() & ": 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_CERT_02_04_BO
            
            /**
filatov's avatar
filatov committed
             * @desc  Check that IUT discards a SecuredMessage if the issuer certificate of the authorization ticket certificate contains the subject type 'authorization_ticket'
             * <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_03_01_BO_AT
             * Expected results:
             *   ensure that
             *     when the IUT is receiving a SecuredMessage
             *       containing header_fields ['signer_info'].signer
             *         containing certificate (CERT_TS_03_01_BO_AT)
             *           containing signer_info.digest
             *             referencing to CERT_TS_03_BO_CA
             *               containing subject_info.subject_type
             *                 indicating 'authorization_ticket'
             *     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_CERT_03_01_BO
             * @reference   ETSI TS 103 097 v1.2.1, clause 6.3
             */
            testcase TC_SEC_ITSS_RCV_CERT_03_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_taCert0301_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 
                }
                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_CERT_03_01_BO
            
            /**
filatov's avatar
filatov committed
             * @desc  Check that IUT discards a SecuredMessage if the issuer certificate of the authorization authority certificate contains the subject type 'authorization_ticket'
             * <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_03_02_BO_AT
             * Expected results:
             *   ensure that
             *     when the IUT is receiving a SecuredMessage
             *       containing header_fields ['signer_info']
             *         containing signer
             *           containing type
             *             indicating 'certificate_chain'
             *           and containing certificates[0] (CERT_TS_03_02_BO_AA)
             *             containing signer_info.digest
             *               referencing to CERT_TS_03_BO_CA
             *                 containing subject_info.subject_type
             *                   indicating 'authorization_ticket'
             *           and containing certificates[1] (CERT_TS_03_02_BO_AT)
             *             containing signer_info.digest
             *             referencing to CERT_TS_03_02_BO_AA
             *     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_CERT_03_02_BO
             * @reference   ETSI TS 103 097 v1.2.1, clause 6.3
             */
            testcase TC_SEC_ITSS_RCV_CERT_03_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_taCert0302_BO, omit, e_certificate_chain);
                
                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() & ": 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_CERT_03_02_BO
            
            /**
filatov's avatar
filatov committed
             * @desc  Check that IUT discards a SecuredMessage if the issuer certificate of the AA certificate contains the subject type 'authorization_authority'
             * <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_04_01_BO_AT
             * Expected results:
             *   ensure that
             *     when the IUT is receiving a SecuredMessage
             *       containing header_fields ['signer_info']
             *         containing signer
             *           containing type
             *             indicating 'certificate_chain'
             *           and containing certificates[0] (CERT_TS_04_01_BO_AA)
             *             containing signer_info.digest
             *               referencing to CERT_TS_A_AA
             *           and containing certificates[1] (CERT_TS_04_01_BO_AT)
             *             containing signer_info.digest
             *               referencing to CERT_TS_04_01_BO_AA
             *     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_CERT_04_01_BO
             * @reference   ETSI TS 103 097 v1.2.1, clause 6.3
             */
            testcase TC_SEC_ITSS_RCV_CERT_04_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_taCert0401_BO, omit, e_certificate_chain);
                
                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() & ": 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_CERT_04_01_BO
            
            /**
filatov's avatar
filatov committed
             * @desc  Check that IUT discards the message when signing AT certificate has an invalid signature
             * <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
             *       containing header_fields ['signer_info']
             *         containing signer
             *           containing type
             *             indicating 'certificate'
             *           and containing certificate (CERT_TS_A_AT)
             *             containing signer_info.digest
             *               referencing to a CERT_TS_A_AA
             *             and containing signature
             *               NOT verifiable with CERT_TS_A_AA.subject_attributes['verification_key'].key
             *     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_CERT_05_01_BO
             * @reference   ETSI TS 103 097 v1.2.1, clauses 6.1 and 7.4.1
             */
            testcase TC_SEC_ITSS_RCV_CERT_05_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_prepareSecuredCam_Bo(
                    cc_taCert_A, 
                    -, 
                    1, 
                    -, 
                    e_certificate,
                    true,
                    true
                );
                f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast(v_securedGnPdu));
                
                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() & ": 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_CERT_05_01_BO
            
            /**
filatov's avatar
filatov committed
             * @desc  Check that IUT discards the message when the issuing AA certificate of the signing AT certificate has an invalid signature
             * <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
             *       containing header_fields ['signer_info']
             *         containing signer
             *           containing type
             *             indicating 'certificate_chain'
             *           and containing certificates[0] (CERT_TS_A_AA)
             *             containing signer_info.digest
             *               referencing to a CERT_ROOT
             *             and containing signature
             *               NOT verifiable with CERT_ROOT.subject_attributes['verification_key'].key
             *           and containing certificates[1] (CERT_TS_A_AT)
             *             containing signer_info.digest
             *               referencing to a CERT_TS_A_AA
             *     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_CERT_05_02_BO
             * @reference   ETSI TS 103 097 v1.2.1, clauses 6.1 and 7.4.1
             */
            testcase TC_SEC_ITSS_RCV_CERT_05_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_prepareSecuredCam_Bo(
                    cc_taCert_A, 
                    -, 
                    1, 
                    -, 
                    e_certificate_chain,
                    true,
                    false,
                    true
                );
                f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast(v_securedGnPdu));
                
                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() & ": 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_CERT_05_02_BO
            
            /**
filatov's avatar
filatov committed
             * @desc  Check that the IUT accepts a message when the signing certificate of this message contains the same circular region validity restriction as its issuing certificate
             * <pre>
             * Pics Selection: PICS_GN_SECURITY AND PICS_USE_CIRCULAR_REGION
             * 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_06_01_BV_AT
             *     and the IUT current location is inside the CURCULAR_REGION_AA
             * Expected results:
             *   ensure that
             *     when the IUT is receiving a SecuredMessage
             *       containing header_fields ['signer_info']
             *         containing signer
             *           containing type
             *             indicating 'certificate'
             *           containing certificate (CERT_TS_06_01_BV_AT)
             *             containing validity_restrictions['region']
             *               containing region_type
             *                 indicating 'circle'
             *               containing circular_region
             *                 indicating CURCULAR_REGION_AA
             *             containing signer_info.digest
             *               referencing to a CERT_TS_B_AA
             *                 containing validity_restrictions['region']
             *                   containing region_type
             *                     indicating 'circle'
             *                   and containing circular_region
             *                     indicating CURCULAR_REGION_AA
             *     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_CERT_06_01_BV
             * @reference   ETSI TS 103 097 v1.2.1, clause 7.4.1
             */
            testcase TC_SEC_ITSS_RCV_CERT_06_01_BV() 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) or not(PICS_USE_RECTANGULAR_REGION)) {
                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY and PICS_USE_RECTANGULAR_REGION' 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_taCert0601_BV, 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: GN was transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                }
                else {
                    log("*** " & testcasename() & ": FAIL: GN was not transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                }
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
            } // End of testcase TC_SEC_ITSS_RCV_CERT_06_01_BV
            
            /**
filatov's avatar
filatov committed
             * @desc  Check that the IUT accepts a message when the signing certificate of this message contains the circular region validity restriction which is fully inside in the circular region validity restriction of its issuing certificate
             * <pre>
             * Pics Selection: PICS_GN_SECURITY AND PICS_USE_CIRCULAR_REGION
             * 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_06_02_BV_AT
             *     and the IUT current location is inside the CURCULAR_REGION_AT
             * Expected results:
             *   ensure that
             *     when the IUT is receiving a SecuredMessage
             *       containing header_fields ['signer_info']
             *         containing signer
             *           containing type
             *             indicating 'certificate'
             *           and containing certificate (CERT_TS_06_02_BV_AT)
             *             containing validity_restrictions['region']
             *               containing region_type
             *                 indicating 'circle'
             *               and containing circular_region
             *                 indicating CURCULAR_REGION_AT
             *             and containing signer_info.digest
             *               referencing to a certificate CERT_TS_B_AA
             *                 containing validity_restrictions['region']
             *                   containing region_type
             *                     indicating 'circle'
             *                   and containing circular_region
             *                     indicating CURCULAR_REGION_AA
             *                       fully covering CURCULAR_REGION_AT
             *     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_CERT_06_02_BV
             * @reference   ETSI TS 103 097 v1.2.1, clause 7.4.1
             */
            testcase TC_SEC_ITSS_RCV_CERT_06_02_BV() 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) or not(PICS_USE_RECTANGULAR_REGION)) {
                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY and PICS_USE_RECTANGULAR_REGION' 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_taCert0602_BV, 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: GN was transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                }
                else {
                    log("*** " & testcasename() & ": FAIL: GN was not transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                }
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
            } // End of testcase TC_SEC_ITSS_RCV_CERT_06_02_BV
            
            /**
filatov's avatar
filatov committed
             * @desc  Check that the IUT accepts a message when the signing certificate of this message contains the circular region validity restriction which is fully inside in the rectangular region validity restriction of its issuing certificate
             * <pre>
             * Pics Selection: PICS_GN_SECURITY AND PICS_USE_CIRCULAR_REGION
             * 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_06_03_BV_AT
             *     and the IUT current location is inside the CURCULAR_REGION_AT
             * Expected results:
             *   ensure that
             *     when the IUT is receiving a SecuredMessage
             *       containing header_fields ['signer_info']
             *         containing signer
             *           containing type
             *             indicating 'certificate'
             *           and containing certificate (CERT_TS_06_03_BV_AT)
             *             containing validity_restrictions['region']
             *               containing region_type
             *                 indicating 'circle'
             *               and containing circular_region
             *                 indicating CURCULAR_REGION_AT
             *             and containing signer_info.digest
             *               referencing to a certificate CERT_TS_C_AA
             *                 containing validity_restrictions['region']
             *                   containing region_type
             *                     indicating 'rectangular'
             *                   and containing rectangular_region[0]
             *                     indicating RECT_REGION_AA
             *                       fully covering CURCULAR_REGION_AT
             *      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_CERT_06_03_BV
             * @reference   ETSI TS 103 097 v1.2.1, clause 7.4.1
             */
            testcase TC_SEC_ITSS_RCV_CERT_06_03_BV() 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) or not(PICS_USE_RECTANGULAR_REGION)) {
                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY and PICS_USE_RECTANGULAR_REGION' 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_taCert0603_BV, 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: GN was transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                }
                else {
                    log("*** " & testcasename() & ": FAIL: GN was not transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                }
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
            } // End of testcase TC_SEC_ITSS_RCV_CERT_06_03_BV
            
            /**
filatov's avatar
filatov committed
             * @desc  Check that the IUT accepts a message when the signing certificate of this message contains the circular region validity restriction which is fully inside in the polygonal region validity restriction of its issuing certificate
             * <pre>
             * Pics Selection: PICS_GN_SECURITY AND PICS_USE_CIRCULAR_REGION
             * 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_06_04_BV_AT
             *     and the IUT current location is inside the CURCULAR_REGION_AT
             * Expected results:
             *   ensure that
             *     when the IUT is receiving a SecuredMessage
             *       containing header_fields ['signer_info']
             *         containing signer
             *           containing type
             *             indicating 'certificate'
             *           and containing certificate (CERT_TS_06_04_BV_AT)
             *             containing validity_restrictions['region']
             *               containing region_type
             *                 indicating 'circle'
             *               and containing circular_region
             *                 indicating CURCULAR_REGION_AT
             *             and containing signer_info.digest
             *               referencing to a certificate CERT_TS_D_AA
             *                 containing validity_restrictions['region']
             *                   containing region_type
             *                     indicating 'polygon'
             *                   and containing polygonal_region
             *                     indicating POLYGON_REGION_AA
             *                       fully covering CURCULAR_REGION_AT
             *     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_CERT_06_04_BV
             * @reference   ETSI TS 103 097 v1.2.1, clause 7.4.1
             */
            testcase TC_SEC_ITSS_RCV_CERT_06_04_BV() 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) or not(PICS_USE_RECTANGULAR_REGION)) {
                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY and PICS_USE_RECTANGULAR_REGION' 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_taCert0604_BV, 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: GN was transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                }
                else {
                    log("*** " & testcasename() & ": FAIL: GN was not transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                }
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
            } // End of testcase TC_SEC_ITSS_RCV_CERT_06_04_BV
            
            /**
filatov's avatar
filatov committed
             * @desc  Check that the IUT accepts a message when the signing certificate of this message contains the circular region validity restriction which is fully inside in the identified region validity restriction of its issuing certificate
             * <pre>
             * Pics Selection: PICS_GN_SECURITY AND PICS_USE_CIRCULAR_REGION
             * 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_06_05_BV_AT
             *     and the IUT current location is inside the CURCULAR_REGION_AT
             * Expected results:
             *   ensure that
             *     when the IUT is receiving a SecuredMessage
             *       containing header_fields ['signer_info']
             *         containing signer
             *           containing type
             *             indicating 'certificate'
             *           containing certificate (CERT_TS_06_05_BV_AT)
             *             containing validity_restrictions['region']
             *               containing region_type
             *                 indicating 'circle'
             *               and containing circular_region
             *                 indicating CURCULAR_REGION_AT
             *             and containing signer_info.digest
             *               referencing to a certificate CERT_TS_E_AA
             *                 containing validity_restrictions['region']
             *                   and containing region_type
             *                     indicating 'id'
             *                   and containing id_region
             *                     containing region_dictionary
             *                       indicating 'iso_3166_1'
             *                     and containing local_region
             *                       indicating 0
             *                     and containing region_identifier
             *                       indicating ID_REGION_AT
             *                         fully covering CURCULAR_REGION_AT
             *     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_CERT_06_05_BV
             * @reference   ETSI TS 103 097 v1.2.1, clause 7.4.1
             */
            testcase TC_SEC_ITSS_RCV_CERT_06_05_BV() 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) or not(PICS_USE_RECTANGULAR_REGION)) {
                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY and PICS_USE_RECTANGULAR_REGION' 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_taCert0605_BV, 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: GN was transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                }
                else {
                    log("*** " & testcasename() & ": FAIL: GN was not transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                }
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
            } // End of testcase TC_SEC_ITSS_RCV_CERT_06_05_BV
            
            /**
filatov's avatar
filatov committed
             * @desc  Check that the IUT discards a message when the signing certificate of this message does not contain the region validity restriction but its issuing certificate contains the circular region validity restriction
             * <pre>
             * Pics Selection: PICS_GN_SECURITY AND PICS_USE_CIRCULAR_REGION
             * 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_06_06_BO_AT
             *     and the IUT current location is inside the CURCULAR_REGION_AT
             * Expected results:
             *   ensure that
             *     when the IUT is receiving a SecuredMessage
             *       containing header_fields ['signer_info']
             *         containing signer
             *           containing type
             *             indicating 'certificate'
             *           and containing certificate (CERT_TS_06_06_BO_AT)
             *             not containing validity_restrictions['region']
             *             and containing signer_info.digest
             *               referencing to a CERT_TS_B_AA
             *                 containing validity_restrictions['region']
             *                   containing region_type
             *                     indicating 'circle'
             *                   and containing circular_region
             *                     indicating CURCULAR_REGION_AT
             *     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_CERT_06_06_BO
             * @reference   ETSI TS 103 097 v1.2.1, clause 7.4.1
             */
            testcase TC_SEC_ITSS_RCV_CERT_06_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) or not(PICS_USE_RECTANGULAR_REGION)) {
                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY and PICS_USE_RECTANGULAR_REGION' required for executing the TC ***");
                    stop;
                }