ItsSecurity_TestCases.ttcn 1.59 MB
Newer Older
//                                    v_longPosVectorNodeB.latitude,
//                                    v_longPosVectorNodeB.longitude,
//                                    '0000'O
//                                ))
//                            ),
//                            m_header_info_its_aid_Other
//                        }, 
//                        e_certificate_digest_with_sha256,
//                        false
//                    ); 
//                    f_sendGeoNetMessage(valueof(m_geoNwReq_linkLayerBroadcast(v_securedGnPdu)));
//                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
//                    
//                    // Postamble
//                    f_selfOrClientSyncAndVerdict(c_poDone, e_success);
//                    
//                } // End of testcase f_TC_SEC_ITSS_RCV_GENMSG_06_01_BO
//                
//            } // End of group g_TC_SEC_ITSS_RCV_GENMSG_06_01_BO 
//            
//            /**
//             * @desc    Check that IUT discards the secured GN Message containing generation_time after the message signing certificate validity period
//             * <pre>
//             * Pics Selection: PICS_GN_SECURITY and PICS_GN_GBC_SRC
//             * 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_GENMSG_A) 
//             *          containing header_fields['signer_info'].type
//             *              indicating 'signer_info'
//             *                  containing certificate (CERT_TS_MSG_06_02_BO_AT)
//             *                      containing validity_restrictions['time_start_and_end']
//             *                          containing start_validity
//             *                              indicating START_VALIDITY_AT
//             *                          and containing end_validity
//             *                              indicating END_VALIDITY_AT
//             *                  and containing header_fields ['generation_time']
//             *                      containing generation_time
//             *                          indicating GEN_TIME > TIME_CERT_TS_E_ATND
//             *  } 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_GENMSG_06_02_BO
//             * @reference    ETSI TS 103 097 [1] Clauses 5.4 & 7.3
//             */
//            testcase TC_SEC_ITSS_RCV_GENMSG_06_02_BO() runs on ItsMtc system ItsSecSystem {
//                
//                // Local variables
//                var ItsGeoNetworking v_nodeB;
//                var ItsGeoNetworking v_nodeD;
//                
//                // Test control
//                if (not(PICS_GN_SECURITY) or not(PICS_GN_GBC_SRC)) {
//                    log("*** " & testcasename() & ": 'PICS_GN_SECURITY and PICS_GN_GBC_SRC' required for executing the TC ***");
//                    setverdict(inconc);
//                    stop;
//                }
//                
//                // Test component configuration
//                f_cf02Up();
//                
//                // Preamble
//                
//                // Start components
//                v_nodeB := f_getComponent(c_compNodeB);
//                v_nodeD := f_getComponent(c_compNodeD);
//                v_nodeB.start(f_TC_SEC_ITSS_RCV_GENMSG_06_02_BO());
//                v_nodeD.start(f_TC_SEC_ITSS_RCV_GENMSG_xxx_BO_nodeD());
//                
//                // Synchronization
//                f_serverSync2ClientsAndStop({c_prDone, c_tbDone, c_poDone});
//                
//                // Cleanup
//                f_cf02Down();
//                
//            } // End of testcase TC_SEC_ITSS_RCV_GENMSG_06_02_BO
//            
//            group g_TC_SEC_ITSS_RCV_GENMSG_06_02_BO {
//                
//                    /**
//                     * @desc    Behavior function for NodeB (TC_GEONW_PON_GBC_BV_01)
//                     */
//                function f_TC_SEC_ITSS_RCV_GENMSG_06_02_BO() runs on ItsGeoNetworking {
//                    
//                    // Local variables
//                    var GeoNetworkingPdu v_securedGnPdu;
//                    var LongPosVector v_longPosVectorNodeB := f_getPosition(c_compNodeB); // Use NodeB
//                    var ValidityRestriction v_validity;
//                    
//                    // Test component configuration
//                    f_cf01Up();
//                    
//                    // Test adapter configuration
//                    
//                    // Preamble
//                    f_prNeighbour();
//                    f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
//                    
//                    // Test Body
//                    f_getCertificateValidityRestriction(vc_atCertificate, e_time_start_and_end, v_validity);
//                    v_securedGnPdu := f_prepareSecuredBeacon(
//                        cc_taCert0602_BO, 
//                        {
//                            m_header_info_signer_info(
//                                m_issuerIdentifier_sha256AndDigest(
//                                    vc_atCertificate.signer_info.signerInfo.digest
//                            )), 
//                            m_header_info_generation_time(
//                                (v_validity.validity.time_start_and_end.end_validity + 3600) * 1000
//                            ), // In us
//                            m_header_info_generation_location(
//                                valueof(m_threeDLocation(
//                                    v_longPosVectorNodeB.latitude,
//                                    v_longPosVectorNodeB.longitude,
//                                    '0000'O
//                                ))
//                            ),
//                            m_header_info_its_aid_Other
//                        }, 
//                        e_certificate_digest_with_sha256,
//                        false
//                    ); 
//                    f_sendGeoNetMessage(valueof(m_geoNwReq_linkLayerBroadcast(v_securedGnPdu)));
//                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
//                    
//                    // Postamble
//                    f_selfOrClientSyncAndVerdict(c_poDone, e_success);
//                    
//                } // End of testcase f_TC_SEC_ITSS_RCV_GENMSG_06_02_BO
//                
//            } // End of group g_TC_SEC_ITSS_RCV_GENMSG_06_02_BO 
//            
//            /**
//             * @desc    Check that IUT discards Secured GN Message if the generation_time is more than 10 minute in the past (C2C only)
//             * <pre>
//             * Pics Selection: PICS_GN_SECURITY and PICS_GN_GBC_SRC
//             * 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_GENMSG_A) 
//             *          containing header_fields ['generation_time']
//             *              containing generation_time
//             *                  indicating TIME_1 (TIME_1 < CUR_TIME - 10min)
//             *  } 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_GENMSG_06_03_BO
//             * @reference    ETSI TS 103 097 [1] Clause 7.3
//             */
//            testcase TC_SEC_ITSS_RCV_GENMSG_06_03_BO() runs on ItsMtc system ItsSecSystem {
//                
//                // Local variables
//                var ItsGeoNetworking v_nodeB;
//                var ItsGeoNetworking v_nodeD;
//                
//                // Test control
//                if (not(PICS_GN_SECURITY) or not(PICS_GN_GBC_SRC)) {
//                    log("*** " & testcasename() & ": 'PICS_GN_SECURITY and PICS_GN_GBC_SRC' required for executing the TC ***");
//                    setverdict(inconc);
//                    stop;
//                }
//                
//                // Test component configuration
//                f_cf02Up();
//                
//                // Preamble
//                
//                // Start components
//                v_nodeB := f_getComponent(c_compNodeB);
//                v_nodeD := f_getComponent(c_compNodeD);
//                v_nodeB.start(f_TC_SEC_ITSS_RCV_GENMSG_06_03_BO());
//                v_nodeD.start(f_TC_SEC_ITSS_RCV_GENMSG_xxx_BO_nodeD());
//                
//                // Synchronization
//                f_serverSync2ClientsAndStop({c_prDone, c_tbDone, c_poDone});
//                
//                // Cleanup
//                f_cf02Down();
//                
//            } // End of testcase TC_SEC_ITSS_RCV_GENMSG_06_03_BO
//            
//            group g_TC_SEC_ITSS_RCV_GENMSG_06_03_BO {
//                
//                    /**
//                     * @desc    Behavior function for NodeB (TC_GEONW_PON_GBC_BV_01)
//                     */
//                function f_TC_SEC_ITSS_RCV_GENMSG_06_03_BO() runs on ItsGeoNetworking {
//                    
//                    // Local variables
//                    var GeoNetworkingPdu v_securedGnPdu;
//                    var LongPosVector v_longPosVectorNodeB := f_getPosition(c_compNodeB); // Use NodeB
//                    
//                    // Test component configuration
//                    f_cf01Up();
//                    
//                    // Test adapter configuration
//                    
//                    // Preamble
//                    f_prNeighbour();
//                    f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
//                    
//                    // Test Body
//                    v_securedGnPdu := f_prepareSecuredBeacon(
//                        cc_taCert_A, 
//                        {
//                            m_header_info_generation_time( 
//                                (1000 * f_getCurrentTime() - 600) * 1000
//                            ) // In us
//                        }, 
//                        e_certificate
//                    ); 
//                    f_sendGeoNetMessage(valueof(m_geoNwReq_linkLayerBroadcast(v_securedGnPdu)));
//                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
//                    
//                    // Postamble
//                    f_selfOrClientSyncAndVerdict(c_poDone, e_success);
//                    
//                } // End of testcase f_TC_SEC_ITSS_RCV_GENMSG_06_03_BO
//                
//            } // End of group g_TC_SEC_ITSS_RCV_GENMSG_06_03_BO 
//            
//            /**
//             * @desc    Check that IUT discards Secured GN Message if the generation_time is more than 10 minute in the future(C2C only)
//             * <pre>
//             * Pics Selection: PICS_GN_SECURITY and PICS_GN_GBC_SRC
//             * 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_GENMSG_A) 
//             *          containing header_fields ['generation_time']
//             *              containing generation_time
//             *                  indicating TIME_1 (TIME_1 > CUR_TIME + 10min)
//             *  } 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_GENMSG_06_04_BO
//             * @reference    ETSI TS 103 097 [1] Clause 7.3
//             */
//            testcase TC_SEC_ITSS_RCV_GENMSG_06_04_BO() runs on ItsMtc system ItsSecSystem {
//                
//                // Local variables
//                var ItsGeoNetworking v_nodeB;
//                var ItsGeoNetworking v_nodeD;
//                
//                // Test control
//                if (not(PICS_GN_SECURITY) or not(PICS_GN_GBC_SRC)) {
//                    log("*** " & testcasename() & ": 'PICS_GN_SECURITY and PICS_GN_GBC_SRC' required for executing the TC ***");
//                    setverdict(inconc);
//                    stop;
//                }
//                
//                // Test component configuration
//                f_cf02Up();
//                
//                // Preamble
//                
//                // Start components
//                v_nodeB := f_getComponent(c_compNodeB);
//                v_nodeD := f_getComponent(c_compNodeD);
//                v_nodeB.start(f_TC_SEC_ITSS_RCV_GENMSG_06_04_BO());
//                v_nodeD.start(f_TC_SEC_ITSS_RCV_GENMSG_xxx_BO_nodeD());
//                
//                // Synchronization
//                f_serverSync2ClientsAndStop({c_prDone, c_tbDone, c_poDone});
//                
//                // Cleanup
//                f_cf02Down();
//                
//            } // End of testcase TC_SEC_ITSS_RCV_GENMSG_06_04_BO
//            
//            group g_TC_SEC_ITSS_RCV_GENMSG_06_04_BO {
//                
//                    /**
//                     * @desc    Behavior function for NodeB (TC_GEONW_PON_GBC_BV_01)
//                     */
//                function f_TC_SEC_ITSS_RCV_GENMSG_06_04_BO() runs on ItsGeoNetworking {
//                    
//                    // Local variables
//                    var GeoNetworkingPdu v_securedGnPdu;
//                    var LongPosVector v_longPosVectorNodeB := f_getPosition(c_compNodeB); // Use NodeB
//                    
//                    // Test component configuration
//                    f_cf01Up();
//                    
//                    // Test adapter configuration
//                    
//                    // Preamble
//                    f_prNeighbour();
//                    f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
//                    
//                    // Test Body
//                    v_securedGnPdu := f_prepareSecuredBeacon(
//                        cc_taCert_A, 
//                        {
//                            m_header_info_generation_time( 
//                                (1000 * f_getCurrentTime() + 600) * 1000
//                            ) // In us
//                        }, 
//                        e_certificate
//                    ); 
//                    f_sendGeoNetMessage(valueof(m_geoNwReq_linkLayerBroadcast(v_securedGnPdu)));
//                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
//                    
//                    // Postamble
//                    f_selfOrClientSyncAndVerdict(c_poDone, e_success);
//                    
//                } // End of testcase f_TC_SEC_ITSS_RCV_GENMSG_06_04_BO
//                
//            } // End of group g_TC_SEC_ITSS_RCV_GENMSG_06_04_BO 
//            
//            /**
//             * @desc    Check that IUT discards Ieee1609Dot2Data when its_aid value is undefined
//             * <pre>
//             * Pics Selection: PICS_GN_SECURITY and PICS_GN_GBC_SRC
//             * 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_GENMSG_A)
//             *          containing header_fields['its_aid']
//             *              indicating indicating 'AID_UNDEFINED'
//             *  } 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_GENMSG_07_01_BO
//             * @reference    ETSI TS 103 097 [1] Clause 7.3
//             */
//            testcase TC_SEC_ITSS_RCV_GENMSG_07_01_BO() runs on ItsMtc system ItsSecSystem {
//                
//                // Local variables
//                var ItsGeoNetworking v_nodeB;
//                var ItsGeoNetworking v_nodeD;
//                
//                // Test control
//                if (not(PICS_GN_SECURITY) or not(PICS_GN_GBC_SRC)) {
//                    log("*** " & testcasename() & ": 'PICS_GN_SECURITY and PICS_GN_GBC_SRC' required for executing the TC ***");
//                    setverdict(inconc);
//                    stop;
//                }
//                
//                // Test component configuration
//                f_cf02Up();
//                
//                // Preamble
//                
//                // Start components
//                v_nodeB := f_getComponent(c_compNodeB);
//                v_nodeD := f_getComponent(c_compNodeD);
//                v_nodeB.start(f_TC_SEC_ITSS_RCV_GENMSG_07_01_BO());
//                v_nodeD.start(f_TC_SEC_ITSS_RCV_GENMSG_xxx_BO_nodeD());
//                
//                // Synchronization
//                f_serverSync2ClientsAndStop({c_prDone, c_tbDone, c_poDone});
//                
//                // Cleanup
//                f_cf02Down();
//                
//            } // End of testcase TC_SEC_ITSS_RCV_GENMSG_07_01_BO
//            
//            group g_TC_SEC_ITSS_RCV_GENMSG_07_01_BO {
//                
//                    /**
//                     * @desc    Behavior function for NodeB (TC_GEONW_PON_GBC_BV_01)
//                     */
//                function f_TC_SEC_ITSS_RCV_GENMSG_07_01_BO() runs on ItsGeoNetworking {
//                    
//                    // Local variables
//                    var GeoNetworkingPdu v_securedGnPdu;
//                    var LongPosVector v_longPosVectorNodeB := f_getPosition(c_compNodeB); // Use NodeB
//                    
//                    // Test component configuration
//                    f_cf01Up();
//                    
//                    // Test adapter configuration
//                    
//                    // Preamble
//                    f_prNeighbour();
//                    f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
//                    
//                    // Test Body
//                    v_securedGnPdu := f_prepareSecuredBeacon(
//                        cc_taCert_A, 
//                        {
//                            m_header_info_its_aid_Other
//                        }, 
//                        e_certificate_digest_with_sha256
//                    ); 
//                    f_sendGeoNetMessage(valueof(m_geoNwReq_linkLayerBroadcast(v_securedGnPdu)));
//                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
//                    
//                    // Postamble
//                    f_selfOrClientSyncAndVerdict(c_poDone, e_success);
//                    
//                } // End of testcase f_TC_SEC_ITSS_RCV_GENMSG_07_01_BO
//                
//            } // End of group g_TC_SEC_ITSS_RCV_GENMSG_07_01_BO 
//            
//            /**
//             * @desc    Check that IUT discards Secured GN Message if the HeaderInfo generation_location is outside of the circular validity region of the signing certificate
//             * <pre>
//             * Pics Selection: PICS_GN_SECURITY and PICS_GN_GBC_SRCand PICS_USE_CIRCULAR_REGION
//             * Config Id: CF01
//             * Initial conditions:
//             * with { 
//             *    the IUT being in the 'authorized' state 
//             *    and the IUT current time is inside the time validity period of CERT_TS_B_AT
//             *    and the IUT current location is inside the validity region of CERT_TS_B_AT
//             * } 
//             * ensure that { 
//             *  when { 
//             *      the IUT is receiving a Ieee1609Dot2Data ((MSG_SEC_RCV_GENMSG_B)) 
//             *          containing header_fields[0].type
//             *              indicating 'signer_info'
//             *                  containing certificate (CERT_TS_B_AT)
//             *                      containing validity_restrictions ['region']
//             *                          containing region
//             *                              containing region_type
//             *                                  indicating 'circle'
//             *                              and containing circular_region
//             *                                  indicating REGION
//             *          and containing header_fields ['generation_location']
//             *              indicating location outside of the REGION
//             *  } 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_GENMSG_08_01_BO
//             * @reference    ETSI TS 103 097 [1] Clause 7.3
//             */
//            testcase TC_SEC_ITSS_RCV_GENMSG_08_01_BO() runs on ItsMtc system ItsSecSystem {
//                
//                // Local variables
//                var ItsGeoNetworking v_nodeB;
//                var ItsGeoNetworking v_nodeD;
//                
//                // Test control
//                if (not(PICS_GN_SECURITY) or not(PICS_GN_GBC_SRC) or not(PICS_USE_CIRCULAR_REGION)) {
//                    log("*** " & testcasename() & ": 'PICS_GN_SECURITY and PICS_GN_GBC_SRC and PICS_USE_CIRCULAR_REGION' required for executing the TC ***");
//                    setverdict(inconc);
//                    stop;
//                }
//                
//                // Test component configuration
//                f_cf02Up();
//                
//                // Preamble
//                
//                // Start components
//                v_nodeB := f_getComponent(c_compNodeB);
//                v_nodeD := f_getComponent(c_compNodeD);
//                v_nodeB.start(f_TC_SEC_ITSS_RCV_GENMSG_08_xx_BO(cc_taCert_B));
//                v_nodeD.start(f_TC_SEC_ITSS_RCV_GENMSG_xxx_BO_nodeD());
//                
//                // Synchronization
//                f_serverSync2ClientsAndStop({c_prDone, c_tbDone, c_poDone});
//                
//                // Cleanup
//                f_cf02Down();
//                
//            } // End of testcase TC_SEC_ITSS_RCV_GENMSG_08_01_BO
//            
//            /**
//             * @desc    Check that IUT discards Secured GN Message if the HeaderInfo generation_location is outside of the rectangular validity region of the signing certificate
//             * <pre>
//             * Pics Selection: PICS_GN_SECURITY and PICS_GN_GBC_SRC and PICS_USE_RECTANGULAR_REGION
//             * Config Id: CF01
//             * Initial conditions:
//             * with { 
//             *    the IUT being in the 'authorized' state 
//             *    and the IUT current time is inside the time validity period of CERT_TS_C_AT
//             *    and the IUT current location is inside the validity region of CERT_TS_C_AT
//             * } 
//             * ensure that { 
//             *  when { 
//             *      the IUT is receiving a Ieee1609Dot2Data ((MSG_SEC_RCV_GENMSG_C)) 
//             *          containing header_fields[0].type
//             *              indicating 'signer_info'
//             *                  containing certificate (CERT_TS_C_AT)
//             *                      containing validity_restrictions ['region']
//             *                          containing region
//             *                              containing region_type
//             *                                  indicating 'rectangle'
//             *                              and containing rectanglar_region
//             *                                  indicating REGION
//             *          and containing header_fields ['generation_location']
//             *              indicating location outside of the REGION
//             *  } 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_GENMSG_08_02_BO
//             * @reference    ETSI TS 103 097 [1] Clause 7.3
//             */
//            testcase TC_SEC_ITSS_RCV_GENMSG_08_02_BO() runs on ItsMtc system ItsSecSystem {
//                
//                // Local variables
//                var ItsGeoNetworking v_nodeB;
//                var ItsGeoNetworking v_nodeD;
//                
//                // Test control
//                if (not(PICS_GN_SECURITY) or not(PICS_GN_GBC_SRC) or not(PICS_USE_RECTANGULAR_REGION)) {
//                    log("*** " & testcasename() & ": 'PICS_GN_SECURITY and PICS_GN_GBC_SRC and PICS_USE_RECTANGULAR_REGION' required for executing the TC ***");
//                    setverdict(inconc);
//                    stop;
//                }
//                
//                // Test component configuration
//                f_cf02Up();
//                
//                // Preamble
//                
//                // Start components
//                v_nodeB := f_getComponent(c_compNodeB);
//                v_nodeD := f_getComponent(c_compNodeD);
//                v_nodeB.start(f_TC_SEC_ITSS_RCV_GENMSG_08_xx_BO(cc_taCert_C));
//                v_nodeD.start(f_TC_SEC_ITSS_RCV_GENMSG_xxx_BO_nodeD());
//                
//                // Synchronization
//                f_serverSync2ClientsAndStop({c_prDone, c_tbDone, c_poDone});
//                
//                // Cleanup
//                f_cf02Down();
//                
//            } // End of testcase TC_SEC_ITSS_RCV_GENMSG_08_02_BO
//            
//            /**
//             * @desc    Check that IUT discards Secured GN Message if the HeaderInfo generation_location is outside of the rectangular validity region of the signing certificate
//             * <pre>
//             * Pics Selection: PICS_GN_SECURITY and PICS_GN_GBC_SRC and PICS_USE_POLYGONAL_REGION
//             * Config Id: CF01
//             * Initial conditions:
//             * with { 
//             *    the IUT being in the 'authorized' state 
//             *    and the IUT current time is inside the time validity period of CERT_TS_D_AT
//             *    and the IUT current location is inside the validity region of CERT_TS_D_AT
//             * } 
//             * ensure that { 
//             *  when { 
//             *      the IUT is receiving a Ieee1609Dot2Data ((MSG_SEC_RCV_GENMSG_D)) 
//             *          containing header_fields[0].type
//             *              indicating 'signer_info'
//             *                  containing certificate (CERT_TS_D_AT)
//             *                      containing validity_restrictions ['region']
//             *                          containing region
//             *                              containing region_type
//             *                                  indicating 'polygon'
//             *                              and containing polygonal_region
//             *                                  indicating REGION
//             *          and containing header_fields ['generation_location']
//             *              indicating location outside of the REGION
//             *  } 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_GENMSG_08_03_BO
//             * @reference    ETSI TS 103 097 [1] Clause 7.3
//             */
//            testcase TC_SEC_ITSS_RCV_GENMSG_08_03_BO() runs on ItsMtc system ItsSecSystem {
//                
//                // Local variables
//                var ItsGeoNetworking v_nodeB;
//                var ItsGeoNetworking v_nodeD;
//                
//                // Test control
//                if (not(PICS_GN_SECURITY) or not(PICS_GN_GBC_SRC) or not(PICS_USE_POLYGONAL_REGION)) {
//                    log("*** " & testcasename() & ": 'PICS_GN_SECURITY and PICS_GN_GBC_SRC and PICS_USE_POLYGONAL_REGION' required for executing the TC ***");
//                    setverdict(inconc);
//                    stop;
//                }
//                
//                // Test component configuration
//                f_cf02Up();
//                
//                // Preamble
//                
//                // Start components
//                v_nodeB := f_getComponent(c_compNodeB);
//                v_nodeD := f_getComponent(c_compNodeD);
//                v_nodeB.start(f_TC_SEC_ITSS_RCV_GENMSG_08_xx_BO(cc_taCert_D));
//                v_nodeD.start(f_TC_SEC_ITSS_RCV_GENMSG_xxx_BO_nodeD());
//                
//                // Synchronization
//                f_serverSync2ClientsAndStop({c_prDone, c_tbDone, c_poDone});
//                
//                // Cleanup
//                f_cf02Down();
//                
//            } // End of testcase TC_SEC_ITSS_RCV_GENMSG_08_03_BO
//            
//            /**
//             * @desc    Check that IUT discards Secured GN Message if the optional HeaderInfo generation_location is outside of the identified validity region of the signing certificate
//             * <pre>
//             * Pics Selection: PICS_GN_SECURITY and PICS_GN_GBC_SRC and PICS_USE_IDENTIFIED_REGION
//             * Config Id: CF01
//             * Initial conditions:
//             * with { 
//             *    the IUT being in the 'authorized' state 
//             *    and the IUT current time is inside the time validity period of CERT_TS_E_AT
//             *    and the IUT current location is inside the validity region of CERT_TS_E_AT
//             * } 
//             * ensure that { 
//             *  when { 
//             *      the IUT is receiving a Ieee1609Dot2Data ((MSG_SEC_RCV_GENMSG_E)) 
//             *          containing header_fields[0].type
//             *              indicating 'signer_info'
//             *                  containing certificate (CERT_TS_E_AT)
//             *                      containing validity_restrictions ['region']
//             *                          containing region
//             *                              containing region_type
//             *                                  indicating 'id_region'
//             *                              and containing identified_region
//             *                                  indicating REGION
//             *          and containing header_fields ['generation_location']
//             *              indicating location outside of the REGION
//             *  } 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_GENMSG_08_04_BO
//             * @reference    ETSI TS 103 097 [1] Clause 7.3
//             */
//            testcase TC_SEC_ITSS_RCV_GENMSG_08_04_BO() runs on ItsMtc system ItsSecSystem {
//                
//                // Local variables
//                var ItsGeoNetworking v_nodeB;
//                var ItsGeoNetworking v_nodeD;
//                
//                // Test control
//                if (not(PICS_GN_SECURITY) or not(PICS_GN_GBC_SRC)) {
//                    log("*** " & testcasename() & ": 'PICS_GN_SECURITY and PICS_GN_GBC_SRC' required for executing the TC ***");
//                    setverdict(inconc);
//                    stop;
//                }
//                
//                // Test component configuration
//                f_cf02Up();
//                
//                // Preamble
//                
//                // Start components
//                v_nodeB := f_getComponent(c_compNodeB);
//                v_nodeD := f_getComponent(c_compNodeD);
//                v_nodeB.start(f_TC_SEC_ITSS_RCV_GENMSG_08_xx_BO(cc_taCert_E));
//                v_nodeD.start(f_TC_SEC_ITSS_RCV_GENMSG_xxx_BO_nodeD());
//                
//                // Synchronization
//                f_serverSync2ClientsAndStop({c_prDone, c_tbDone, c_poDone});
//                
//                // Cleanup
//                f_cf02Down();
//                
//            } // End of testcase TC_SEC_ITSS_RCV_GENMSG_08_04_BO
//            
//            /**
//             * @desc    Check that IUT accepts a Secured DENM if the distance between the current position of IUT and the value of optional HeaderInfo generation_location is 29.9 km (C2C only)
//             * <pre>
//             * Pics Selection: PICS_GN_SECURITY
//             * Config Id: CF01
//             * Expected behavior:
//             * with {
//             *   the IUT being in the 'authorized' state
//             *   and the IUT current time is inside the time validity period of CERT_TS_A_AT
//             * }
//             * ensure that {
//             *   when {
//             *     the IUT is receiving a Ieee1609Dot2Data (MSG_SEC_RCV_GENMSG_A)
//             *          containing header_fields[generation_location].type 
//             *              indicating 'generation_location'
//             *          and containing generation_location
//             *              indicating position in 29.9 km from the current position of IUT
//             *   } then {
//             *     the IUT accepts the message
//             *   }
//             * }
//             * </pre>
garciay's avatar
garciay committed
//             * @see          ETSI TS 103 096-2 v1.3.2 TP_SEC_ITSS_RCV_GENMSG_08_05_BV
//             * @reference    ETSI TS 103 097 [1] Clause 7.2
//             */
//            testcase TC_SEC_ITSS_RCV_GENMSG_08_05_BV() runs on ItsMtc system ItsSecSystem {
//                
//                // Local variables
//                var ItsGeoNetworking v_nodeB;
//                var ItsGeoNetworking v_nodeD;
//                
//                // Test control
//                if (not(PICS_GN_SECURITY) or not(PICS_GN_GBC_SRC) or not(PICS_USE_IDENTIFIED_REGION)) {
//                    log("*** " & testcasename() & ": 'PICS_GN_SECURITY and PICS_GN_GBC_SRC and PICS_USE_IDENTIFIED_REGION' required for executing the TC ***");
//                    setverdict(inconc);
//                    stop;
//                }
//                
//                // Test component configuration
//                f_cf02Up();
//                
//                // Preamble
//                
//                // Start components
//                v_nodeB := f_getComponent(c_compNodeB);
//                v_nodeD := f_getComponent(c_compNodeD);
//                v_nodeB.start(f_TC_SEC_ITSS_RCV_GENMSG_08_05_BV());
//                v_nodeD.start(f_TC_SEC_ITSS_RCV_GENMSG_xxx_BV_nodeD());
//                
//                // Synchronization
//                f_serverSync2ClientsAndStop({c_prDone, c_tbDone, c_poDone});
//                
//                // Cleanup
//                f_cf02Down();
//                
//            } // End of testcase TC_SEC_ITSS_RCV_GENMSG_08_05_BV
//            
//            /**
//             * @desc    Check that IUT discards Secured DENM if the distance between the current position of IUT and the value of optional HeaderInfo generation_location is more than 30 km
//             * <pre>
//             * Pics Selection: PICS_GN_SECURITY
//             * Config Id: CF01
//             * Expected behavior:
//             * with {
//             *   the IUT being in the 'authorized' state
//             *   and the IUT current time is inside the time validity period of CERT_TS_A_AT
//             * }
//             * ensure that {
//             *   when {
//             *     the IUT is receiving a Ieee1609Dot2Data (MSG_SEC_RCV_GENMSG_A)
//             *          containing header_fields[generation_location].type 
//             *              indicating 'generation_location'
//             *          and containing generation_location
//             *              indicating position in 31 km from the current position of IUT
//             *   } 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_GENMSG_08_06_BO
//             * @reference    ETSI TS 103 097 [1] Clause 7.2
//             */
//            testcase TC_SEC_ITSS_RCV_GENMSG_08_06_BO() runs on ItsMtc system ItsSecSystem {
//                
//                // Local variables
//                var ItsGeoNetworking v_nodeB;
//                var ItsGeoNetworking v_nodeD;
//                
//                // Test control
//                if (not(PICS_GN_SECURITY) or not(PICS_GN_GBC_SRC)) {
//                    log("*** " & testcasename() & ": 'PICS_GN_SECURITY and PICS_GN_GBC_SRC' required for executing the TC ***");
//                    setverdict(inconc);
//                    stop;
//                }
//                
//                // Test component configuration
//                f_cf02Up();
//                
//                // Preamble
//                
//                // Start components
//                v_nodeB := f_getComponent(c_compNodeB);
//                v_nodeD := f_getComponent(c_compNodeD);
//                v_nodeB.start(f_TC_SEC_ITSS_RCV_GENMSG_08_06_BO());
//                v_nodeD.start(f_TC_SEC_ITSS_RCV_GENMSG_xxx_BO_nodeD());
//                
//                // Synchronization
//                f_serverSync2ClientsAndStop({c_prDone, c_tbDone, c_poDone});
//                
//                // Cleanup
//                f_cf02Down();
//                
//            } // End of testcase TC_SEC_ITSS_RCV_GENMSG_08_06_BO
//            
//            group g_TC_SEC_ITSS_RCV_GENMSG_08_xx_BO {
//                
//                /**
//                 * @desc    Behavior function for NodeB (TC_GEONW_PON_GBC_BV_01)
//                 */
//                function f_TC_SEC_ITSS_RCV_GENMSG_08_xx_BO(
//                                                           in charstring p_taCert
//                ) runs on ItsGeoNetworking {
//                    
//                    // Local variables
//                    var GeoNetworkingPdu v_securedGnPdu;
//                    var LongPosVector v_longPosVectorNodeB := f_getPosition(c_compNodeB); // Use NodeB
//                    
//                    // Test component configuration
//                    f_cf01Up();
//                    
//                    // Test adapter configuration
//                    
//                    // Preamble
//                    f_prNeighbour();
//                    f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
//                    
//                    // Test Body
//                    v_securedGnPdu := f_prepareSecuredBeacon(
//                        p_taCert, 
//                        {
//                            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_location(
//                                valueof(m_threeDLocation(
//                                    PX_WGSLATITUDE,
//                                    PX_WGSLONGITUDE,
//                                    '0000'O
//                                ))
//                            ),
//                            m_header_info_its_aid_Other
//                        }, 
//                        e_certificate_digest_with_sha256,
//                        false
//                    ); 
//                    f_sendGeoNetMessage(valueof(m_geoNwReq_linkLayerBroadcast(v_securedGnPdu)));
//                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
//                    
//                    // Postamble
//                    f_selfOrClientSyncAndVerdict(c_poDone, e_success);
//                    
//                } // End of testcase f_TC_SEC_ITSS_RCV_GENMSG_08_xx_BO
//                
//                /**
//                 * @desc    Behavior function for NodeB (TC_GEONW_PON_GBC_BV_01)
//                 */
//                function f_TC_SEC_ITSS_RCV_GENMSG_08_05_BV() runs on ItsGeoNetworking {
//                    
//                    // Local variables
//                    var integer i;
//                    var GeoNetworkingPdu v_securedGnPdu;
//                    var GnRawPayload v_sentRawPayload;
//                    var LongPosVector v_longPosVectorNodeB := f_getPosition(c_compNodeB); // Use NodeB
//                    var Int32 v_latitude;
//                    var Int32 v_longitude;
//                    
//                    // Test component configuration
//                    f_cf01Up();
//                    
//                    // Test adapter configuration
//                    
//                    // Preamble
//                    f_prNeighbour();
//                    f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
//                    
//                    // Test Body
//                    fx_computePositionUsingDistance(
//                        v_longPosVectorNodeB.latitude,
//                        v_longPosVectorNodeB.longitude,
//                        29900.0, 
//                        0,
//                        v_latitude,
//                        v_longitude
//                    );
//                    v_securedGnPdu := f_prepareSecuredBeacon(
//                        cc_taCert_A, 
//                        {
//                            m_header_info_generation_location(
//                                valueof(m_threeDLocation(
//                                    v_latitude,
//                                    v_longitude,
//                                    '0000'O
//                                ))
//                            )
//                        }, 
//                        e_certificate_digest_with_sha256
//                    ); 
//                    f_sendGeoNetMessage(valueof(m_geoNwReq_linkLayerBroadcast(v_securedGnPdu)));
//                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
//                    
//                    // Postamble
//                    f_poNeighbour();
//                    f_cf01Down();
//                } // End of testcase f_TC_SEC_ITSS_RCV_GENMSG_08_05_BV
//                
//                /**
//                 * @desc    Behavior function for NodeB (TC_GEONW_PON_GBC_BV_01)
//                 */
//                function f_TC_SEC_ITSS_RCV_GENMSG_08_06_BO() runs on ItsGeoNetworking {
//                    
//                    // Local variables
//                    var integer i;
//                    var GeoNetworkingPdu v_securedGnPdu;
//                    var GnRawPayload v_sentRawPayload;
//                    var LongPosVector v_longPosVectorNodeB := f_getPosition(c_compNodeB); // Use NodeB
//                    var Int32 v_latitude;
//                    var Int32 v_longitude;
//                    
//                    // Test component configuration
//                    f_cf01Up();
//                    
//                    // Test adapter configuration
//                    
//                    // Preamble
//                    f_prNeighbour();
//                    f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
//                    
//                    // Test Body
//                    fx_computePositionUsingDistance(
//                        v_longPosVectorNodeB.latitude,
//                        v_longPosVectorNodeB.longitude,
//                        31000.0, 
//                        0,
//                        v_latitude,
//                        v_longitude
//                    );
//                    v_securedGnPdu := f_prepareSecuredBeacon(
//                        cc_taCert_A, 
//                        {
//                            m_header_info_generation_location(
//                                valueof(m_threeDLocation(
//                                    v_latitude,
//                                    v_longitude,
//                                    '0000'O
//                                ))
//                            )
//                        }, 
//                        e_certificate_digest_with_sha256
//                    ); 
//                    f_sendGeoNetMessage(valueof(m_geoNwReq_linkLayerBroadcast(v_securedGnPdu)));
//                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
//                    
//                    // Postamble
//                    f_poNeighbour();
//                    f_cf01Down();
//                } // End of testcase f_TC_SEC_ITSS_RCV_GENMSG_08_06_BO
//                
//            } // End of group g_TC_SEC_ITSS_RCV_GENMSG_08_xx_BO 
//            
//            /**
//             * @desc    Check that IUT discards the Secured GN Message containing empty payload of type 'signed'
//             * <pre>
//             * Pics Selection: PICS_GN_SECURITY and PICS_GN_GBC_SRC
//             * 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_GENMSG_A) 
//             *          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_GENMSG_09_02_BO
//             * @reference    ETSI TS 103 097 [1] Clause 7.3
//             */
//            testcase TC_SEC_ITSS_RCV_GENMSG_09_02_BO() runs on ItsMtc system ItsSecSystem {
//                
//                // Local variables
//                var ItsGeoNetworking v_nodeB;
//                var ItsGeoNetworking v_nodeD;
//                
//                // Test control
//                if (not(PICS_GN_SECURITY) or not(PICS_GN_GBC_SRC)) {
//                    log("*** " & testcasename() & ": 'PICS_GN_SECURITY and PICS_GN_GBC_SRC' required for executing the TC ***");
//                    setverdict(inconc);