ItsSecurity_TestCases.ttcn 1.6 MB
Newer Older
//                f_cf01Down();
//            } // End of testcase TC_SEC_ITSS_RCV_CAM_01_03_BV
//            
//            /**
//             * @desc    Check that IUT discards a Secured CAM containing protocol version set to a value less then 2
//             * <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 protocol_version 
//             *                  indicating 1
//             *      } then {
//             *          the IUT discards a Ieee1609Dot2Data
//             *      }
//             *  }
//             * </pre>
//             *
garciay's avatar
garciay committed
//             * @see          ETSI TS 103 096-2 v1.3.2 TP_SEC_ITSS_RCV_CAM_02_01_BO
//             * @reference    ETSI TS 103 097 [1] Clause 5.1
//             */
//            testcase TC_SEC_ITSS_RCV_CAM_02_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, PX_WRONG_PROTOCOL_VERSION);
//                
//                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_02_01_BO
//            
//            /**
//             * @desc    Check that IUT discards a Secured CAM containing protocol version set to a value greater then 2
//             * <pre>
//             * Pics Selection: PICS_GN_SECURITY
//             * Config Id: CF01
//             * Initial conditions:
//             *  with {
//             *      the IUT being in the 'authorized' state
//             *  }
//             *  ensure that {
//             *      when { 
//             *          the IUT is receiving a Ieee1609Dot2Data (MSG_SEC_RCV_CAM_01)
//             *              containing protocol_version 
//             *                  indicating 3
//             *      } then {
//             *          the IUT discards a Ieee1609Dot2Data
//             *      }
//             *  }
//             * </pre>
//             *
garciay's avatar
garciay committed
//             * @see          ETSI TS 103 096-2 v1.3.2 TP_SEC_ITSS_RCV_CAM_02_02_BO
//             * @reference    ETSI TS 103 097 [1] Clause 5.1
//             */
//            testcase TC_SEC_ITSS_RCV_CAM_02_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, PX_WRONG_PROTOCOL_VERSION); // Change PX_WRONG_PROTOCOL_VERSION to 3
//                
//                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_02_02_BO
//            
//            /**
//             * @desc    Check that IUT discards a secured CAM if the header_fields contains more than one element of header field type: 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[0].type
//             *              indicating 'signer_info'
//             *          and containing header_fields[1].type
//             *              indicating 'signer_info'
//             *          and containing header_fields[2].type
//             *              indicating 'generation_time'
//             *          and containing header_fields[3]
//             *              containing type
//             *                  indicating 'its_aid'
//             *              containing its_aid
//             *                  indicating 'AID_CAM'
//             *          and not containing other header fields
//             *  } 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_04_01_BO
//             * @reference    ETSI TS 103 097 [1] Clause 7.1
//             */
//            testcase TC_SEC_ITSS_RCV_CAM_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_prepareSecuredCam(
//                    cc_taCert_A, 
//                    {
//                        m_header_info_signer_info(
//                            m_issuerIdentifier_sha256AndDigest(
//                                vc_atCertificate.signer_info.signerInfo.digest
//                        )), 
//                        m_header_info_signer_info(
//                            m_signerIdentifier_certificate(
//                                vc_atCertificate
//                        )), 
//                        m_header_info_generation_time(1000 * f_getCurrentTime()), // In us
//                        m_header_info_its_aid_CAM
//                    }, 
//                    e_certificate_digest_with_sha256,
//                    false
//                ); 
//                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_04_01_BO
//            
//            /**
//             * @desc    Check that IUT discards a secured CAM if the header_fields does not contain the header field type: 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[0].type
//             *              indicating 'generation_time'
//             *          and containing header_fields[1]
//             *              containing type
//             *                  indicating 'its_aid'
//             *              containing its_aid
//             *                  indicating 'AID_CAM'
//             *          and not containing other header fields
//             *  } 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_04_02_BO
//             * @reference    ETSI TS 103 097 [1] Clause 7.1
//             */
//            testcase TC_SEC_ITSS_RCV_CAM_04_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();
//                if (PICS_DEBUG_ADDON) {
//                    f_sendCertificateAndWaitForCertificateChainRequest(cc_taCert_F, f_generateDefaultCam());
//                }
//                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
//                
//                // Test Body
//                v_securedGnPdu := f_prepareSecuredCam(
//                    cc_taCert_A, 
//                    {
//                        m_header_info_generation_time(1000 * f_getCurrentTime()), // In us
//                        m_header_info_its_aid_CAM
//                    }, 
//                    e_certificate_digest_with_sha256,
//                    false
//                ); 
//                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_04_02_BO
//            
//            /**
//             * @desc    Check that IUT is able to receive a secured CAM if the signer_info header field is not encoded first
//             * <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[0].type
//             *        indicating 'signer_info'
//             *      and containing header_fields[1].type
//             *        indicating 'generation_time'
//             *      and containing header_fields[2].type
//             *        indicating 'signer_info'
//             *      and containing header_fields[3]
//             *        containing type
//             *          indicating 'its_aid'
//             *        containing its_aid
//             *          indicating 'AID_CAM'
//             *      and not containing other header fields
//             *  } 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_04_03_BO
//             * @reference    ETSI TS 103 097 [1] Clause 7.1
//             */
//            testcase TC_SEC_ITSS_RCV_CAM_04_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_prepareSecuredCam(
//                    cc_taCert_A, 
//                    {
//                        m_header_info_generation_time(1000 * f_getCurrentTime()), // In us
//                        m_header_info_its_aid_CAM,
//                        m_header_info_signer_info(
//                            m_issuerIdentifier_sha256AndDigest(
//                                vc_atCertificate.signer_info.signerInfo.digest
//                        ))
//                    }, 
//                    e_certificate_digest_with_sha256,
//                    false
//                ); 
//                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_04_03_BO
//            
//            /**
//             * @desc    Check that IUT discards a secured CAM if the header_fields doesn't contain the element of header field of type: generation_time
//             * <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[0].type
//             *              indicating 'signer_info'
//             *          and containing header_fields[1]
//             *              containing type
//             *                  indicating 'its_aid'
//             *              containing its_aid
//             *                  indicating 'AID_CAM'
//             *       and not containing other header fields
//             *  } 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_04_04_BO
//             * @reference    ETSI TS 103 097 [1] Clause 7.1
//             */
//            testcase TC_SEC_ITSS_RCV_CAM_04_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_prepareSecuredCam(
//                    cc_taCert_A, 
//                    {
//                        m_header_info_signer_info(
//                            m_issuerIdentifier_sha256AndDigest(
//                                vc_atCertificate.signer_info.signerInfo.digest
//                        )), 
//                        m_header_info_its_aid_CAM
//                    }, 
//                    e_certificate_digest_with_sha256,
//                    false
//                ); 
//                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_04_04_BO
//            
//            /**
//             * @desc    Check that IUT discards a secured CAM if the header_fields does not contain the header field type: generation_time
//             * <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[0].type
//             *              indicating 'signer_info'
//             *          and containing header_fields[1]
//             *              containing type
//             *                  indicating 'its_aid'
//             *              containing its_aid
//             *                  indicating 'AID_CAM'
//             *          and not containing other header fields
//             *  } 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_04_05_BO
//             * @reference    ETSI TS 103 097 [1] Clause 7.1
//             */
//            testcase TC_SEC_ITSS_RCV_CAM_04_05_BO() runs on ItsGeoNetworking system ItsSecSystem {
//                
//                // Local variables
//                var integer i;
//                var GeoNetworkingPdu v_securedGnPdu;
//                var GnRawPayload v_sentRawPayload;
//                
//                // Test adapter configuration
//                if (not(PICS_GN_SECURITY)) {
//                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
//                    stop;
//                }
//                
//                // Test component configuration
//                f_cf01Up();
//                
//                // Test adapter configuration
//                
//                // Preamble
//                f_prNeighbour();
//                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
//                
//                // Test Body
//                v_securedGnPdu := f_prepareSecuredCam(
//                    cc_taCert_A, 
//                    {
//                        m_header_info_signer_info(
//                            m_issuerIdentifier_sha256AndDigest(
//                                vc_atCertificate.signer_info.signerInfo.digest
//                        )), 
//                        m_header_info_its_aid_CAM
//                    }, 
//                    e_certificate_digest_with_sha256,
//                    false
//                ); 
//                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_04_05_BO
//            
//            /**
//             * @desc    Check that IUT discards a secured CAM if the header_fields contain more than one element of header field of type: its_aid
//             * <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[0].type
//             *              indicating 'signer_info'
//             *          and containing header_fields[1].type
//             *              indicating 'generation_time'
//             *          and containing header_fields[2]
//             *              containing type
//             *                  indicating 'its_aid'
//             *              containing its_aid
//             *                  indicating 'AID_CAM'
//             *          and containing header_fields[3]
//             *              containing type
//             *                  indicating 'its_aid'
//             *              containing its_aid
//             *                  indicating 'AID_DENM'
//             *       and not containing other header fields
//             *  } 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_04_06_BO
//             * @reference    ETSI TS 103 097 [1] Clause 7.1
//             */
//            testcase TC_SEC_ITSS_RCV_CAM_04_06_BO() runs on ItsGeoNetworking system ItsSecSystem {
//                
//                // Local variables
//                var integer i;
//                var GeoNetworkingPdu v_securedGnPdu;
//                var GnRawPayload v_sentRawPayload;
//                
//                // Test adapter configuration
//                if (not(PICS_GN_SECURITY)) {
//                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
//                    stop;
//                }
//                
//                // Test component configuration
//                f_cf01Up();
//                
//                // Test adapter configuration
//                
//                // Preamble
//                f_prNeighbour();
//                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
//                
//                // Test Body
//                v_securedGnPdu := f_prepareSecuredCam(
//                    cc_taCert_A, 
//                    {
//                        m_header_info_signer_info(
//                            m_issuerIdentifier_sha256AndDigest(
//                                vc_atCertificate.signer_info.signerInfo.digest
//                        )), 
//                        m_header_info_generation_time(1000 * f_getCurrentTime()), // In us
//                        m_header_info_its_aid_CAM,
//                        m_header_info_its_aid_DENM
//                    }, 
//                    e_certificate_digest_with_sha256,
//                    false
//                ); 
//                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_04_06_BO
//            
//            /**
//             * @desc    Check that IUT discards a secured CAM if the header_fields contain more than one element of header field of type: its_aid
//             * <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[0].type
//             *              indicating 'signer_info'
//             *          and containing header_fields[1].type
//             *              indicating 'generation_time'
//             *       and not containing other header fields
//             *  } 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_04_06a_BO
//             * @reference    ETSI TS 103 097 [1] Clause 7.1
//             */
//            testcase TC_SEC_ITSS_RCV_CAM_04_06a_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_signer_info(
//                            m_issuerIdentifier_sha256AndDigest(
//                                vc_atCertificate.signer_info.signerInfo.digest
//                        )), 
//                        m_header_info_generation_time(1000 * f_getCurrentTime()) // In us
//                    }, 
//                    e_certificate_digest_with_sha256,
//                    false
//                ); 
//                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_04_06a_BO
//            
//            /**
//             * @desc    Check that IUT discards a secured CAM if the header fields are not in the ascending order according to the numbering of the enumeration
//             * <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[0].type
//             *              indicating 'signer_info'
//             *          and containing header_fields[1]
//             *              containing type
//             *                  indicating 'its_aid'
//             *              containing its_aid
//             *                  indicating 'AID_CAM'
//             *          and containing header_fields[2].type
//             *              indicating 'generation_time'
//             *       and not containing other header fields
//             *  } 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_04_07_BO
//             * @reference    ETSI TS 103 097 [1] Clause 7.1
//             */
//            testcase TC_SEC_ITSS_RCV_CAM_04_07_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_signer_info(
//                            m_issuerIdentifier_sha256AndDigest(
//                                vc_atCertificate.signer_info.signerInfo.digest
//                        )), 
//                        m_header_info_its_aid_CAM,
//                        m_header_info_generation_time(1000 * f_getCurrentTime()) // In us
//                    }, 
//                    e_certificate_digest_with_sha256,
//                    false
//                ); 
//                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_04_07_BO
//            
//            /**
//             * @desc    Check that IUT ignores the HeaderInfo generation_time_standard_deviation of received Secured 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[0].type
//             *              indicating 'signer_info'
//             *          and containing header_fields[1].type
//             *              indicating 'generation_time'
//             *                  indicating TIME_1 inside the validity period of the signer certificate
//             *          and containing header_fields[2].type
//             *              indicating 'generation_time_with_standard_deviation'
//             *                  indicating TIME_2 inside the validity period of the signer certificate
//             *          and containing header_fields[3]
//             *              containing type
//             *                  indicating 'its_aid'
//             *              containing its_aid
//             *                  indicating 'AID_CAM'
//             *       and not containing other header fields
//             *  } 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_04_08_BO
//             * @reference    ETSI TS 103 097 [1] Clause 7.1
//             */
//            testcase TC_SEC_ITSS_RCV_CAM_04_08_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_signer_info(
//                            m_issuerIdentifier_sha256AndDigest(
//                                vc_atCertificate.signer_info.signerInfo.digest
//                        )), 
//                        m_header_info_generation_time(1000 * f_getCurrentTime()), // In us
//                        m_header_info_generation_time_with_standard_deviation(
//                            m_time64WithStandardDeviation(
//                                1000, // In us
//                                0
//                        )), 
//                        m_header_info_its_aid_CAM
//                    }, 
//                    e_certificate_digest_with_sha256,
//                    false
//                ); 
//                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_04_08_BO
//            
//            /**
//             * @desc    Check that IUT ignores the HeaderInfo generation_time_standard_deviation of received Secured 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[0].type
//             *              indicating 'signer_info'
//             *          and containing header_fields[1].type
//             *              indicating 'generation_time'
//             *                  indicating TIME_1 outside the validity period of the signer certificate
//             *          and containing header_fields[2].type
//             *              indicating 'generation_time_with_standard_deviation'
//             *                  indicating TIME_2 inside the validity period of the signer certificate
//             *          and containing header_fields[3]
//             *              containing type
//             *                  indicating 'its_aid'
//             *              containing its_aid
//             *                  indicating 'AID_CAM'
//             *       and not containing other header fields
//             *  } 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_04_09_BO
//             * @reference    ETSI TS 103 097 [1] Clause 7.1
//             */
//            testcase TC_SEC_ITSS_RCV_CAM_04_09_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