ItsSecurity_TestCases.ttcn 1.59 MB
Newer Older
//                    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_06_04_BO
//            
//            /**
//             * @desc    Check that IUT discards secured CAM when its_aid value is not AID_CAM
//             * <pre>
//             * Pics Selection: PICS_GN_SECURITY
//             * Config Id: CF01
//             * Initial conditions:
//             * with { 
//             *  the IUT being in the 'authorized' state 
//             *  and the IUT current time is inside the time validity period of CERT_TS_A_AT
//             * } 
//             * ensure that { 
//             *     when {  
//             *         the IUT is receiving a Ieee1609Dot2Data (MSG_SEC_RCV_CAM_01) 
//             *             containing header_fields['its_aid'] 
//             *                 indicating AID_DENM 
//             *             and containing payload_field { 
//             *                 containing type 
//             *                     indicating 'signed' 
//             *                 containing data 
//             *                     containing CAM payload 
//             *             } 
//             *     } then { 
//             *         the IUT discards the message 
//             *     } 
//             * } 
//             * </pre>
//             *
garciay's avatar
garciay committed
//             * @see          ETSI TS 103 096-2 v1.3.2 TP_SEC_ITSS_RCV_CAM_07_01_BO
//             * @reference    ETSI TS 103 097 [1] Clause 7.1
//             */
//            testcase TC_SEC_ITSS_RCV_CAM_07_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(
//                    cc_taCert_A, 
//                    {
//                        m_header_info_its_aid_DENM
//                    },
//                    e_certificate_digest_with_sha256
//                ); 
//                f_sendGeoNetMessage(valueof(m_geoNwReq_linkLayerBroadcast(v_securedGnPdu)));
//                
//                f_sleep(PX_TNOAC);
//                v_sentRawPayload := valueof(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_07_01_BO
//            
//            /**
//             * @desc    Check that IUT discards secured CAM when its_aid value is undefined
//             * <pre>
//             * Pics Selection: PICS_GN_SECURITY
//             * Config Id: CF01
//             * Initial conditions:
//             * with { 
//             *  the IUT being in the 'authorized' state 
//             *  and the IUT current time is inside the time validity period of CERT_TS_A_AT
//             * } 
//             * ensure that { 
//             *     when {  
//             *         the IUT is receiving a Ieee1609Dot2Data (MSG_SEC_RCV_CAM_01) 
//             *             containing header_fields['its_aid'] 
//             *                 indicating 'AID_UNDEFINED' 
//             *             and containing payload_field { 
//             *                 containing type 
//             *                     indicating 'signed' 
//             *                 containing data 
//             *                     containing CAM payload 
//             *             } 
//             *     } then { 
//             *         the IUT discards the message 
//             *     } 
//             * } 
//             * </pre>
//             *
garciay's avatar
garciay committed
//             * @see          ETSI TS 103 096-2 v1.3.2 TP_SEC_ITSS_RCV_CAM_07_02_BO
//             * @reference    ETSI TS 103 097 [1] Clause 7.1
//             */
//            testcase TC_SEC_ITSS_RCV_CAM_07_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(
//                    cc_taCert_A, 
//                    {
//                        m_header_info_its_aid_Other
//                    },
//                    e_certificate_digest_with_sha256
//                ); 
//                f_sendGeoNetMessage(valueof(m_geoNwReq_linkLayerBroadcast(v_securedGnPdu)));
//                
//                f_sleep(PX_TNOAC);
//                v_sentRawPayload := valueof(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_07_02_BO
//            
//            /**
//            * @desc    Check that IUT discards the Secured CAM containing empty payload of type 'signed'.
//            * <pre>
//            * Pics Selection: PICS_GN_SECURITY
//            * Config Id: CF01
//            * Initial conditions:
//            *   with {
//            *       the IUT being in the 'authorized' state
//            *       and the IUT current time is inside the time validity period of CERT_TS_A_AT
//            *   }
//            *   ensure that {
//            *       when {
//            *           the IUT is receiving a Ieee1609Dot2Data (MSG_SEC_RCV_CAM_01)
//            *               containing payload_field
//            *                   containing type
//            *                       indicating 'signed'
//            *                   and containing data
//            *                       indicating length 0
//            *       } then {
//            *           the IUT discards the message
//            *       }
//            *   }
//            * </pre>
//            *
garciay's avatar
garciay committed
//            * @see          ETSI TS 103 096-2 v1.3.2 TP_SEC_ITSS_RCV_CAM_09_02_BO
//            * @reference    ETSI TS 103 097 [1] Clause 7.1
//            */
//            testcase TC_SEC_ITSS_RCV_CAM_09_02_BO() runs on ItsGeoNetworking system ItsSecSystem {
//                
//                // Local variables
//                var integer i;
//                var GeoNetworkingPdu v_securedGnPdu;
//                var GnNonSecuredPacket v_gnNonSecuredPacket;
//                var octetstring v_gnPayload;
//                var template (value) Ieee1609Dot2Data v_securedMessage;
//                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_gnNonSecuredPacket := valueof(m_geoNwShbPacket(f_getPosition(c_compNodeC)));
//                v_gnNonSecuredPacket.payload := valueof(
//                    valueof(
//                        bit2oct(
//                            encvalue(
//                                m_camReq(
//                                    m_camMsg_vehicle_HF_BV(
//                                        f_getTsStationId(),
//                                        f_getCurrentTime() mod 65536, // See ETSI EN 302 637-2 V1.3.0 - Clause B.3 generationDelatTime
//                                        LibItsCam_Templates.m_tsPosition
//                ))))));
//                v_gnPayload := bit2oct(encvalue(v_gnNonSecuredPacket));
//                f_buildGnSecuredCam(
//                    v_securedMessage,
//                    m_payload_signed(
//                        ''O
//                    )
//                );
//                v_securedGnPdu := valueof(m_geoNwSecPdu(v_gnNonSecuredPacket, v_securedMessage));
//                f_sendGeoNetMessage(valueof(m_geoNwReq_linkLayerBroadcast(v_securedGnPdu)));
//                
//                f_sleep(PX_TNOAC);
//                v_sentRawPayload := valueof(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_CAM_09_02_BO
//            
//            /**
//            * @desc    Check that IUT discards the Secured CAM containing non-empty payload of type 'unsecured'
//            * <pre>
//            * Pics Selection: PICS_GN_SECURITY
//            * Config Id: CF01
//            * Initial conditions:
//            *   with {
//            *       the IUT being in the 'authorized' state
//            *       and the IUT current time is inside the time validity period of CERT_TS_A_AT
//            *   }
//            *   ensure that {
//            *       when {
//            *           the IUT is receiving a Ieee1609Dot2Data (MSG_SEC_RCV_CAM_01)
//            *               containing payload_field
//            *                   containing type
//            *                       indicating 'unsecured'
//            *                   and containing data
//            *                       indicating length > 0
//            *       } then {
//            *           the IUT discards the message
//            *       }
//            *   }
//            * </pre>
//            *
garciay's avatar
garciay committed
//            * @see          ETSI TS 103 096-2 v1.3.2 TP_SEC_ITSS_RCV_CAM_09_03_BO
//            * @reference    ETSI TS 103 097 [1] Clause 7.1
//            */
//            testcase TC_SEC_ITSS_RCV_CAM_09_03_BO() runs on ItsGeoNetworking system ItsSecSystem {
//                
//                // Local variables
//                var integer i;
//                var GeoNetworkingPdu v_securedGnPdu;
//                var GnNonSecuredPacket v_gnNonSecuredPacket;
//                var octetstring v_gnPayload;
//                var template (value) Ieee1609Dot2Data v_securedMessage;
//                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_gnNonSecuredPacket := valueof(m_geoNwShbPacket(f_getPosition(c_compNodeC)));
//                v_gnNonSecuredPacket.payload := valueof(
//                    valueof(
//                        bit2oct(
//                            encvalue(
//                                m_camReq(
//                                    m_camMsg_vehicle_HF_BV(
//                                        f_getTsStationId(),
//                                        f_getCurrentTime() mod 65536, // See ETSI EN 302 637-2 V1.3.0 - Clause B.3 generationDelatTime
//                                        LibItsCam_Templates.m_tsPosition
//                ))))));
//                v_gnPayload := bit2oct(encvalue(v_gnNonSecuredPacket));
//                f_buildGnSecuredCam(
//                    v_securedMessage,
//                    m_payload_unsecured(
//                        v_gnPayload
//                    )
//                );
//                v_securedGnPdu := valueof(m_geoNwSecPdu(v_gnNonSecuredPacket, v_securedMessage));
//                f_sendGeoNetMessage(valueof(m_geoNwReq_linkLayerBroadcast(v_securedGnPdu)));
//                
//                f_sleep(PX_TNOAC);
//                v_sentRawPayload := valueof(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_CAM_09_03_BO
//
//            /**
//            * @desc    Check that IUT discards the Secured CAM containing non-empty payload of type 'encrypted'
//            * <pre>
//            * Pics Selection: PICS_GN_SECURITY
//            * Config Id: CF01
//            * Initial conditions:
//            *   with {
//            *       the IUT being in the 'authorized' state
//            *       and the IUT current time is inside the time validity period of CERT_TS_A_AT
//            *   }
//            *   ensure that {
//            *       when {
//            *           the IUT is receiving a Ieee1609Dot2Data (MSG_SEC_RCV_CAM_01)
//            *               and containing payload_field
//            *                   containing type
//            *                       indicating 'encrypted'
//            *                   and containing data
//            *                       indicating length > 0
//            *       } then {
//            *           the IUT discards the message
//            *       }
//            *   }
//            * </pre>
//            *
garciay's avatar
garciay committed
//            * @see          ETSI TS 103 096-2 v1.3.2 TP_SEC_ITSS_RCV_CAM_09_04_BO
//            * @reference    ETSI TS 103 097 [1] Clause 7.1
//            */
//            testcase TC_SEC_ITSS_RCV_CAM_09_04_BO() runs on ItsGeoNetworking system ItsSecSystem {
//                
//                // Local variables
//                var integer i;
//                var GeoNetworkingPdu v_securedGnPdu;
//                var GnNonSecuredPacket v_gnNonSecuredPacket;
//                var octetstring v_gnPayload;
//                var template (value) Ieee1609Dot2Data v_securedMessage;
//                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_gnNonSecuredPacket := valueof(m_geoNwShbPacket(f_getPosition(c_compNodeC)));
//                v_gnNonSecuredPacket.payload := valueof(
//                    valueof(
//                        bit2oct(
//                            encvalue(
//                                m_camReq(
//                                    m_camMsg_vehicle_HF_BV(
//                                        f_getTsStationId(),
//                                        f_getCurrentTime() mod 65536, // See ETSI EN 302 637-2 V1.3.0 - Clause B.3 generationDelatTime
//                                        LibItsCam_Templates.m_tsPosition
//                ))))));
//                v_gnPayload := bit2oct(encvalue(v_gnNonSecuredPacket));
//                f_buildGnSecuredCam(
//                    v_securedMessage,
//                    m_payload_encrypted(
//                        v_gnPayload
//                    )
//                );
//                v_securedGnPdu := valueof(m_geoNwSecPdu(v_gnNonSecuredPacket, v_securedMessage));
//                f_sendGeoNetMessage(valueof(m_geoNwReq_linkLayerBroadcast(v_securedGnPdu)));
//                
//                f_sleep(PX_TNOAC);
//                v_sentRawPayload := valueof(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_CAM_09_04_BO
//            
//            /**
//            * @desc    Check that IUT discards the Secured CAM containing exactly one non-empty payload of type 'signed_external'
//            * <pre>
//            * Pics Selection: PICS_GN_SECURITY
//            * Config Id: CF01
//            * Initial conditions:
//            *   with {
//            *       the IUT being in the 'authorized' state
//            *       and the IUT current time is inside the time validity period of CERT_TS_A_AT
//            *   }
//            *   ensure that {
//            *       when {
//            *           the IUT is receiving a Ieee1609Dot2Data (MSG_SEC_RCV_CAM_01)
//            *              containing payload_field
//            *                   containing type
//            *                       indicating 'signed_external'
//            *                   and containing data
//            *                       indicating length > 0
//            *       } then {
//            *           the IUT discards the message
//            *       }
//            *   }
//            * </pre>
//            *
garciay's avatar
garciay committed
//            * @see          ETSI TS 103 096-2 v1.3.2 TP_SEC_ITSS_RCV_CAM_09_05_BO
//            * @reference    ETSI TS 103 097 [1] Clause 7.1
//            */
//            testcase TC_SEC_ITSS_RCV_CAM_09_05_BO() runs on ItsGeoNetworking system ItsSecSystem {
//                
//                // Local variables
//                var integer i;
//                var GeoNetworkingPdu v_securedGnPdu;
//                var GnNonSecuredPacket v_gnNonSecuredPacket;
//                var octetstring v_gnPayload;
//                var template (value) Ieee1609Dot2Data v_securedMessage;
//                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_gnNonSecuredPacket := valueof(m_geoNwShbPacket(f_getPosition(c_compNodeC)));
//                v_gnNonSecuredPacket.payload := valueof(
//                    valueof(
//                        bit2oct(
//                            encvalue(
//                                m_camReq(
//                                    m_camMsg_vehicle_HF_BV(
//                                        f_getTsStationId(),
//                                        f_getCurrentTime() mod 65536, // See ETSI EN 302 637-2 V1.3.0 - Clause B.3 generationDelatTime
//                                        LibItsCam_Templates.m_tsPosition
//                ))))));
//                v_gnPayload := bit2oct(encvalue(v_gnNonSecuredPacket));
//                f_buildGnSecuredCam(
//                    v_securedMessage,
//                    m_payload_signed_external(
//                        v_gnPayload
//                    )
//                );
//                v_securedGnPdu := valueof(m_geoNwSecPdu(v_gnNonSecuredPacket, v_securedMessage));
//                f_sendGeoNetMessage(valueof(m_geoNwReq_linkLayerBroadcast(v_securedGnPdu)));
//                
//                f_sleep(PX_TNOAC);
//                v_sentRawPayload := valueof(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_CAM_09_05_BO
//            
//            /**
//            * @desc    Check that IUT discards the Secured CAM containing non-empty payload of type 'signed_and_encrypted'
//            * <pre>
//            * Pics Selection: PICS_GN_SECURITY
//            * Config Id: CF01
//            * Initial conditions:
//            *   with {
//            *       the IUT being in the 'authorized' state
//            *       and the IUT current time is inside the time validity period of CERT_TS_A_AT
//            *   }
//            *   ensure that {
//            *       when {
//            *           the IUT is receiving a Ieee1609Dot2Data (MSG_SEC_RCV_CAM_01)
//            *              containing payload_field
//            *                   containing type
//            *                       indicating 'signed_and_encrypted'
//            *                   and containing data
//            *                       indicating length > 0
//            *       } then {
//            *           the IUT discards the message
//            *       }
//            *   }
//            * </pre>
//            *
garciay's avatar
garciay committed
//            * @see          ETSI TS 103 096-2 v1.3.2 TP_SEC_ITSS_RCV_CAM_09_06_BO
//            * @reference    ETSI TS 103 097 [1] Clause 7.1
//            */
//            testcase TC_SEC_ITSS_RCV_CAM_09_06_BO() runs on ItsGeoNetworking system ItsSecSystem {
//                
//                // Local variables
//                var integer i;
//                var GeoNetworkingPdu v_securedGnPdu;
//                var GnNonSecuredPacket v_gnNonSecuredPacket;
//                var octetstring v_gnPayload;
//                var template (value) Ieee1609Dot2Data v_securedMessage;
//                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_gnNonSecuredPacket := valueof(m_geoNwShbPacket(f_getPosition(c_compNodeC)));
//                v_gnNonSecuredPacket.payload := valueof(
//                    valueof(
//                        bit2oct(
//                            encvalue(
//                                m_camReq(
//                                    m_camMsg_vehicle_HF_BV(
//                                        f_getTsStationId(),
//                                        f_getCurrentTime() mod 65536, // See ETSI EN 302 637-2 V1.3.0 - Clause B.3 generationDelatTime
//                                        LibItsCam_Templates.m_tsPosition
//                ))))));
//                v_gnPayload := bit2oct(encvalue(v_gnNonSecuredPacket));
//                f_buildGnSecuredCam(
//                    v_securedMessage,
//                    m_payload_signed_and_encrypted(
//                        v_gnPayload
//                    )
//                );
//                v_securedGnPdu := valueof(m_geoNwSecPdu(v_gnNonSecuredPacket, v_securedMessage));
//                f_sendGeoNetMessage(valueof(m_geoNwReq_linkLayerBroadcast(v_securedGnPdu)));
//                
//                f_sleep(PX_TNOAC);
//                v_sentRawPayload := valueof(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_CAM_09_06_BO
//            
//            /**
//            * @desc    Check that IUT discards the Secured CAM containing non-empty payload of unknown type
//            * <pre>
//            * Pics Selection: PICS_GN_SECURITY
//            * Config Id: CF01
//            * Initial conditions:
//            *   with {
//            *       the IUT being in the 'authorized' state
//            *       and the IUT current time is inside the time validity period of CERT_TS_A_AT
//            *   }
//            *   ensure that {
//            *       when {
//            *           the IUT is receiving a Ieee1609Dot2Data (MSG_SEC_RCV_CAM_01)
//            *              containing payload_field
//            *                   containing type
//            *                       indicating X_UNKNOWN_PAYLOAD_TYPE
//            *                   and containing data
//            *                       indicating length > 0
//            *       } then {
//            *           the IUT discards the message
//            *       }
//            *   }
//            * </pre>
//            *
garciay's avatar
garciay committed
//            * @see          ETSI TS 103 096-2 v1.3.2 TP_SEC_ITSS_RCV_CAM_09_07_BO
//            * @reference    ETSI TS 103 097 [1] Clause 7.1
//            */
//            testcase TC_SEC_ITSS_RCV_CAM_09_07_BO() runs on ItsGeoNetworking system ItsSecSystem {
//                
//                // Local variables
//                var integer i;
//                var GeoNetworkingPdu v_securedGnPdu;
//                var GnNonSecuredPacket v_gnNonSecuredPacket;
//                var octetstring v_gnPayload;
//                var template (value) Ieee1609Dot2Data v_securedMessage;
//                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_gnNonSecuredPacket := valueof(m_geoNwShbPacket(f_getPosition(c_compNodeC)));
//                v_gnNonSecuredPacket.payload := valueof(
//                    valueof(
//                        bit2oct(
//                            encvalue(
//                                m_camReq(
//                                    m_camMsg_vehicle_HF_BV(
//                                        f_getTsStationId(),
//                                        f_getCurrentTime() mod 65536, // See ETSI EN 302 637-2 V1.3.0 - Clause B.3 generationDelatTime
//                                        LibItsCam_Templates.m_tsPosition
//                ))))));
//                v_gnPayload := bit2oct(encvalue(v_gnNonSecuredPacket));
//                f_buildGnSecuredCam(
//                    v_securedMessage,
//                    m_payload_unknown(
//                        v_gnPayload
//                    )
//                );
//                v_securedGnPdu := valueof(m_geoNwSecPdu(v_gnNonSecuredPacket, v_securedMessage));
//                f_sendGeoNetMessage(valueof(m_geoNwReq_linkLayerBroadcast(v_securedGnPdu)));
//                
//                f_sleep(PX_TNOAC);
//                v_sentRawPayload := valueof(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_CAM_09_07_BO
//            
//            /**
//            * @desc    Check that IUT discards the Secured CAM doesn't containing the TrailerField of type 'signature'
//            * <pre>
//            * Pics Selection: PICS_GN_SECURITY
//            * Config Id: CF01
//            * Initial conditions:
//            *    with {
//            *        the IUT being in the 'authorized' state
//            *        and the IUT current time is inside the time validity period of CERT_TS_A_AT
//            *    }
//            *    ensure that {
//            *        when {
//            *            the IUT is receiving a Ieee1609Dot2Data (MSG_SEC_RCV_CAM_01)
//            *                containing trailer_fields
//            *                    not containing any instance of type TrailerField
//            *                        containing type
//            *                            indicating 'signature'
//            *        } then {
//            *            the IUT discards the message
//            *        }
//            *    }
//            * </pre>
//            *
garciay's avatar
garciay committed
//            * @see          ETSI TS 103 096-2 v1.3.2 TP_SEC_ITSS_RCV_CAM_10_01_BO
//            * @reference    ETSI TS 103 097 [1] Clause 7.1
//            */
//            testcase TC_SEC_ITSS_RCV_CAM_10_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_Bo(cc_taCert_A, -, 0); 
//                
//                f_sleep(PX_TNOAC);
//                v_sentRawPayload := valueof(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_CAM_10_01_BO
//            
//            /**
//            * @desc    Check that IUT discards the Secured CAM containing more then one instance of TrailerField of type 'signature'
//            * <pre>
//            * Pics Selection: PICS_GN_SECURITY
//            * Config Id: CF01
//            * Initial conditions:
//            *   with {
//            *       the IUT being in the 'authorized' state
//            *       and the IUT current time is inside the time validity period of CERT_TS_A_AT
//            *   }
//            *   ensure that {
//            *       when {
//            *           the IUT is receiving a Ieee1609Dot2Data (MSG_SEC_RCV_CAM_01)
//            *              containing trailer_fields[0].type
//            *                  containing type
//            *                      indicating 'signature'
//            *              and containing trailer_fields[1].type
//            *                  containing type
//            *                      indicating 'signature'
//            *       } then {
//            *           the IUT discards the message
//            *       }
//            *   }
//            * </pre>
//            *
garciay's avatar
garciay committed
//            * @see          ETSI TS 103 096-2 v1.3.2 TP_SEC_ITSS_RCV_CAM_10_02_BO
//            * @reference    ETSI TS 103 097 [1] Clause 7.1
//            */
//            testcase TC_SEC_ITSS_RCV_CAM_10_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_Bo(cc_taCert_A, -, 2); 
//                
//                f_sleep(PX_TNOAC);
//                v_sentRawPayload := valueof(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_CAM_10_02_BO
//            
//            /**
//            * @desc    Check that the IUT discards Secured message containing signature that is not verified using the 
//            *          verification key from the certificate contained in the message's signer info
//            * <pre>
//            * Pics Selection: PICS_GN_SECURITY
//            * Config Id: CF01
//            * Initial conditions:
//            *   with {
//            *       the IUT being in the 'authorized' state
//            *       and the IUT current time is inside the time validity period of CERT_TS_A_AT
//            *   }
//            *   ensure that {
//            *       when {
//            *           the IUT is receiving a Ieee1609Dot2Data (MSG_SEC_RCV_CAM_01)
//            *               containing header_fields ['signer_info']
//            *                   containing certificate
//            *                       containing subject_attributes['verification key'] (KEY)
//            *               and containing trailer_fields[0]
//            *                   containing type
//            *                       indicating 'signature'
//            *                   and containing signature
//            *                       NOT verifiable using KEY
//            *       } then {
//            *           the IUT discards the message
//            *       }
//            *   }
//            * </pre>
//            *
garciay's avatar
garciay committed
//            * @see          ETSI TS 103 096-2 v1.3.2 TP_SEC_ITSS_RCV_CAM_11_01_BO
//            * @reference    ETSI TS 103 097 [1] Clause 7.1
//            */
//            testcase TC_SEC_ITSS_RCV_CAM_11_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
//                );
//                f_sendGeoNetMessage(valueof(m_geoNwReq_linkLayerBroadcast(v_securedGnPdu)));
//                
//                f_sleep(PX_TNOAC);
//                v_sentRawPayload := valueof(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_CAM_11_01_BO
//            
//            /**
//            * @desc    Check that the IUT discards Secured message containing signature that is not verified using the 
//            *          verification key from the certificate, referenced by the digest contained in the message's signer info
//            * <pre>
//            * Pics Selection: PICS_GN_SECURITY
//            * Config Id: CF01
//            * Initial conditions:
//            *   with {
//            *       the IUT being in the 'authorized' state
//            *       and the IUT current time is inside the time validity period of CERT_TS_A_AT
//            *   }
//            *   ensure that {
//            *       when {
//            *           the IUT is receiving a Ieee1609Dot2Data (MSG_SEC_RCV_CAM_02)
//            *               containing header_fields ['signer_info'].signer
//            *                   containing digest
//            *                       referencing to the certificate (CERT_TS_AT_A)
//            *                           containing subject_attributes['verification key'] (KEY)
//            *               and containing trailer_fields[0]
//            *                   containing type
//            *                       indicating 'signature'
//            *                   and containing signature
//            *                       NOT verifiable using KEY
//            *       } then {
//            *           the IUT discards the message
//            *       }
//            *   }
//            * </pre>
//            *
garciay's avatar
garciay committed
//            * @see          ETSI TS 103 096-2 v1.3.2 TP_SEC_ITSS_RCV_CAM_11_02_BO
//            * @reference    ETSI TS 103 097 [1] Clause 7.1
//            */
//            testcase TC_SEC_ITSS_RCV_CAM_11_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;