ItsSecurity_TestCases.ttcn3 987 KB
Newer Older
garciay's avatar
garciay committed
             */
garciay's avatar
garciay committed
            testcase TC_SEC_ITSS_RCV_GENMSG_04_05_BO() runs on ItsMtc system ItsSecSystem {
garciay's avatar
garciay committed
                
                // Local variables
                var ItsGeoNetworking v_nodeB;
                var ItsGeoNetworking v_nodeD;
                
                // Test control
                if (not(PICS_GN_SECURITY) or not(PICS_GN_GBC_SRC)) {
garciay's avatar
garciay committed
                    log("*** " & testcasename() & ": 'PICS_GN_SECURITY' and 'PICS_GN_GBC_SRC' required for executing the TC ***");
garciay's avatar
garciay committed
                    setverdict(inconc);
                    stop;
                }
                
                // Test component configuration
                f_cf02Up();
                
                // Preamble
                
                // Start components
                v_nodeB := f_getComponent(c_compNodeB);
                v_nodeD := f_getComponent(c_compNodeD);
garciay's avatar
garciay committed
                v_nodeB.start(f_TC_SEC_ITSS_RCV_GENMSG_04_05_BO());
garciay's avatar
garciay committed
                v_nodeD.start(f_TC_SEC_ITSS_RCV_GENMSG_xxx_BO_nodeD());
                
                // Synchronization
                f_serverSync2ClientsAndStop({c_prDone, c_tbDone, c_poDone});
                
                // Cleanup
                f_cf02Down();
                
garciay's avatar
garciay committed
            } // End of testcase TC_SEC_ITSS_RCV_GENMSG_04_05_BO
garciay's avatar
garciay committed
            
garciay's avatar
garciay committed
            group g_TC_SEC_ITSS_RCV_GENMSG_04_05_BO {
garciay's avatar
garciay committed
                
                    /**
                     * @desc    Behavior function for NodeB (TC_GEONW_PON_GBC_BV_01)
                     */
garciay's avatar
garciay committed
                function f_TC_SEC_ITSS_RCV_GENMSG_04_05_BO() runs on ItsGeoNetworking {
garciay's avatar
garciay committed
                    
                    // 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, 
                        {
garciay's avatar
garciay committed
                            m_header_field_signer_info(
                                m_signerInfo_digest(
                                    vc_atCertificate.signer_info.signerInfo.digest
                            )),
garciay's avatar
garciay committed
                            m_header_field_generation_location(
                                valueof(m_threeDLocation(
                                    v_longPosVectorNodeB.latitude,
                                    v_longPosVectorNodeB.longitude,
                                    '0000'O
                                ))
                            ),
                            m_header_field_its_aid_Other
                        }, 
                        e_certificate_digest_with_sha256,
                        false
                    ); 
                    f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast(v_securedGnPdu));
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    
                    // Postamble
                    f_selfOrClientSyncAndVerdict(c_poDone, e_success);
                    
garciay's avatar
garciay committed
                } // End of testcase f_TC_SEC_ITSS_RCV_GENMSG_04_05_BO
garciay's avatar
garciay committed
                
garciay's avatar
garciay committed
            } // End of group g_TC_SEC_ITSS_RCV_GENMSG_04_05_BO 
garciay's avatar
garciay committed
            
            /**
garciay's avatar
garciay committed
             * @desc    Check that IUT discards a Secured GN Message if the message contains more than one header field of type 'its_aid'
garciay's avatar
garciay committed
             * <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 { 
garciay's avatar
garciay committed
             *      the IUT is receiving a SecuredMessage (MSG_SEC_RCV_GENMSG_A) 
             *          containing header_fields[0].type
             *              indicating 'signer_info'
garciay's avatar
garciay committed
             *          and containing header_fields[1].type
garciay's avatar
garciay committed
             *              indicating 'generation_time'
garciay's avatar
garciay committed
             *          and containing header_fields[2].type
garciay's avatar
garciay committed
             *              indicating 'generation_location'
             *          and containing header_fields[3]
             *              containing type
             *                  indicating 'its_aid'
             *              containing its_aid
             *                  indicating 'AID_BEACON'
             *          and containing header_fields[4].type
garciay's avatar
garciay committed
             *              containing its_aid
             *                  indicating 'AID_BEACON'
             *          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.2.2 TP_SEC_ITSS_RCV_GENMSG_04_06_BO
garciay's avatar
garciay committed
             * @reference    ETSI TS 103 097 [1], clause 7.1
             */
garciay's avatar
garciay committed
            testcase TC_SEC_ITSS_RCV_GENMSG_04_06_BO() runs on ItsMtc system ItsSecSystem {
garciay's avatar
garciay committed
                
                // Local variables
                var ItsGeoNetworking v_nodeB;
                var ItsGeoNetworking v_nodeD;
                
                // Test control
                if (not(PICS_GN_SECURITY) or not(PICS_GN_GBC_SRC)) {
garciay's avatar
garciay committed
                    log("*** " & testcasename() & ": 'PICS_GN_SECURITY' and 'PICS_GN_GBC_SRC' required for executing the TC ***");
garciay's avatar
garciay committed
                    setverdict(inconc);
                    stop;
                }
                
                // Test component configuration
                f_cf02Up();
                
                // Preamble
                
                // Start components
                v_nodeB := f_getComponent(c_compNodeB);
                v_nodeD := f_getComponent(c_compNodeD);
garciay's avatar
garciay committed
                v_nodeB.start(f_TC_SEC_ITSS_RCV_GENMSG_04_06_BO());
garciay's avatar
garciay committed
                v_nodeD.start(f_TC_SEC_ITSS_RCV_GENMSG_xxx_BO_nodeD());
                
                // Synchronization
                f_serverSync2ClientsAndStop({c_prDone, c_tbDone, c_poDone});
                
                // Cleanup
                f_cf02Down();
                
garciay's avatar
garciay committed
            } // End of testcase TC_SEC_ITSS_RCV_GENMSG_04_06_BO
garciay's avatar
garciay committed
            
garciay's avatar
garciay committed
            group g_TC_SEC_ITSS_RCV_GENMSG_04_06_BO {
garciay's avatar
garciay committed
                
                    /**
                     * @desc    Behavior function for NodeB (TC_GEONW_PON_GBC_BV_01)
                     */
garciay's avatar
garciay committed
                function f_TC_SEC_ITSS_RCV_GENMSG_04_06_BO() runs on ItsGeoNetworking {
garciay's avatar
garciay committed
                    
                    // 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, 
                        {
garciay's avatar
garciay committed
                            m_header_field_signer_info(
                                m_signerInfo_digest(
                                    vc_atCertificate.signer_info.signerInfo.digest
                            )),
garciay's avatar
garciay committed
                            m_header_field_generation_time(1000 * f_getCurrentTime()), // In us
                            m_header_field_generation_location(
                                valueof(m_threeDLocation(
                                    v_longPosVectorNodeB.latitude,
                                    v_longPosVectorNodeB.longitude,
                                    '0000'O
                                ))
                            ),
                            m_header_field_its_aid_Other,
garciay's avatar
garciay committed
                            m_header_field_its_aid_Other
garciay's avatar
garciay committed
                        }, 
                        e_certificate_digest_with_sha256,
                        false
                    ); 
                    f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast(v_securedGnPdu));
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    
                    // Postamble
                    f_selfOrClientSyncAndVerdict(c_poDone, e_success);
                    
garciay's avatar
garciay committed
                } // End of testcase f_TC_SEC_ITSS_RCV_GENMSG_04_06_BO
garciay's avatar
garciay committed
                
garciay's avatar
garciay committed
            } // End of group g_TC_SEC_ITSS_RCV_GENMSG_04_06_BO 
garciay's avatar
garciay committed
            
            /**
garciay's avatar
garciay committed
             * @desc    Check that IUT discards a secured GN Message if the message contains more than one header field of type 'generation_location'
garciay's avatar
garciay committed
             * <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 { 
garciay's avatar
garciay committed
             *      the IUT is receiving a SecuredMessage (MSG_SEC_RCV_GENMSG_A) 
garciay's avatar
garciay committed
             *          containing header_fields[0].type
             *              indicating 'signer_info'
             *          and containing header_fields[1].type
             *              indicating 'generation_time'
             *          and containing header_fields[2].type
garciay's avatar
garciay committed
             *              indicating 'generation_location'
garciay's avatar
garciay committed
             *          and containing header_fields[3].type
garciay's avatar
garciay committed
             *              indicating 'generation_location'
             *          and containing header_fields[4]
             *              containing type
             *                  indicating 'its_aid'
garciay's avatar
garciay committed
             *              containing its_aid
             *                  indicating 'AID_BEACON'
             *          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.2.2 TP_SEC_ITSS_RCV_GENMSG_04_07_BO
garciay's avatar
garciay committed
             * @reference    ETSI TS 103 097 [1], clause 7.1
             */
garciay's avatar
garciay committed
            testcase TC_SEC_ITSS_RCV_GENMSG_04_07_BO() runs on ItsMtc system ItsSecSystem {
garciay's avatar
garciay committed
                
                // Local variables
                var ItsGeoNetworking v_nodeB;
                var ItsGeoNetworking v_nodeD;
                
                // Test control
                if (not(PICS_GN_SECURITY) or not(PICS_GN_GBC_SRC)) {
garciay's avatar
garciay committed
                    log("*** " & testcasename() & ": 'PICS_GN_SECURITY' and 'PICS_GN_GBC_SRC' required for executing the TC ***");
garciay's avatar
garciay committed
                    setverdict(inconc);
                    stop;
                }
                
                // Test component configuration
                f_cf02Up();
                
                // Preamble
                
                // Start components
                v_nodeB := f_getComponent(c_compNodeB);
                v_nodeD := f_getComponent(c_compNodeD);
garciay's avatar
garciay committed
                v_nodeB.start(f_TC_SEC_ITSS_RCV_GENMSG_04_07_BO());
garciay's avatar
garciay committed
                v_nodeD.start(f_TC_SEC_ITSS_RCV_GENMSG_xxx_BO_nodeD());
                
                // Synchronization
                f_serverSync2ClientsAndStop({c_prDone, c_tbDone, c_poDone});
                
                // Cleanup
                f_cf02Down();
                
garciay's avatar
garciay committed
            } // End of testcase TC_SEC_ITSS_RCV_GENMSG_04_07_BO
garciay's avatar
garciay committed
            
garciay's avatar
garciay committed
            group g_TC_SEC_ITSS_RCV_GENMSG_04_07_BO {
garciay's avatar
garciay committed
                
                    /**
                     * @desc    Behavior function for NodeB (TC_GEONW_PON_GBC_BV_01)
                     */
garciay's avatar
garciay committed
                function f_TC_SEC_ITSS_RCV_GENMSG_04_07_BO() runs on ItsGeoNetworking {
garciay's avatar
garciay committed
                    
                    // 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_field_signer_info(
                                m_signerInfo_digest(
                                    vc_atCertificate.signer_info.signerInfo.digest
                            )),
                            m_header_field_generation_time(1000 * f_getCurrentTime()), // In us
                            m_header_field_generation_location(
                                valueof(m_threeDLocation(
                                    v_longPosVectorNodeB.latitude,
                                    v_longPosVectorNodeB.longitude,
                                    '0000'O
                                ))
                            ),
garciay's avatar
garciay committed
                            m_header_field_generation_location(
                                valueof(m_threeDLocation(
                                    v_longPosVectorNodeB.latitude,
                                    v_longPosVectorNodeB.longitude,
                                    '0100'O
                                ))
                            ),
garciay's avatar
garciay committed
                            m_header_field_its_aid_Other
                        }, 
                        e_certificate_digest_with_sha256,
                        false
                    ); 
                    f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast(v_securedGnPdu));
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    
                    // Postamble
                    f_selfOrClientSyncAndVerdict(c_poDone, e_success);
                    
garciay's avatar
garciay committed
                } // End of testcase f_TC_SEC_ITSS_RCV_GENMSG_04_07_BO
garciay's avatar
garciay committed
                
garciay's avatar
garciay committed
            } // End of group g_TC_SEC_ITSS_RCV_GENMSG_04_07_BO 
garciay's avatar
garciay committed
            
            /**
garciay's avatar
garciay committed
             * @desc    Check that IUT discards a secured GN Message if the message contains more than one header field of type 'generation_location'
garciay's avatar
garciay committed
             * <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 { 
garciay's avatar
garciay committed
             *      the IUT is receiving a SecuredMessage (MSG_SEC_RCV_GENMSG_A) 
garciay's avatar
garciay committed
             *          containing header_fields[0].type
             *              indicating 'signer_info'
             *          and containing header_fields[1].type
             *              indicating 'generation_time'
             *          and containing header_fields[2].type
garciay's avatar
garciay committed
             *          and containing header_fields[4].type
             *              indicating 'its_aid'
             *                  containing its_aid
             *                      indicating 'AID_BEACON'
garciay's avatar
garciay committed
             *          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.2.2 TP_SEC_ITSS_RCV_GENMSG_04_08_BO
garciay's avatar
garciay committed
             * @reference    ETSI TS 103 097 [1], clause 7.1
             */
garciay's avatar
garciay committed
            testcase TC_SEC_ITSS_RCV_GENMSG_04_08_BO() runs on ItsMtc system ItsSecSystem {
garciay's avatar
garciay committed
                
                // Local variables
                var ItsGeoNetworking v_nodeB;
                var ItsGeoNetworking v_nodeD;
                
                // Test control
                if (not(PICS_GN_SECURITY) or not(PICS_GN_GBC_SRC)) {
garciay's avatar
garciay committed
                    log("*** " & testcasename() & ": 'PICS_GN_SECURITY' and 'PICS_GN_GBC_SRC' required for executing the TC ***");
garciay's avatar
garciay committed
                    setverdict(inconc);
                    stop;
                }
                
                // Test component configuration
                f_cf02Up();
                
                // Preamble
                
                // Start components
                v_nodeB := f_getComponent(c_compNodeB);
                v_nodeD := f_getComponent(c_compNodeD);
garciay's avatar
garciay committed
                v_nodeB.start(f_TC_SEC_ITSS_RCV_GENMSG_04_08_BO());
garciay's avatar
garciay committed
                v_nodeD.start(f_TC_SEC_ITSS_RCV_GENMSG_xxx_BO_nodeD());
                
                // Synchronization
                f_serverSync2ClientsAndStop({c_prDone, c_tbDone, c_poDone});
                
                // Cleanup
                f_cf02Down();
                
garciay's avatar
garciay committed
            } // End of testcase TC_SEC_ITSS_RCV_GENMSG_04_08_BO
garciay's avatar
garciay committed
            
garciay's avatar
garciay committed
            group g_TC_SEC_ITSS_RCV_GENMSG_04_08_BO {
garciay's avatar
garciay committed
                
                    /**
                     * @desc    Behavior function for NodeB (TC_GEONW_PON_GBC_BV_01)
                     */
garciay's avatar
garciay committed
                function f_TC_SEC_ITSS_RCV_GENMSG_04_08_BO() runs on ItsGeoNetworking {
garciay's avatar
garciay committed
                    
                    // 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_field_signer_info(
                                m_signerInfo_digest(
                                    vc_atCertificate.signer_info.signerInfo.digest
                            )),
garciay's avatar
garciay committed
                            m_header_field_generation_time(1000 * f_getCurrentTime()), // In us
garciay's avatar
garciay committed
                            m_header_field_its_aid_Other
                        }, 
                        e_certificate_digest_with_sha256,
                        false
                    ); 
                    f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast(v_securedGnPdu));
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    
                    // Postamble
                    f_selfOrClientSyncAndVerdict(c_poDone, e_success);
                    
garciay's avatar
garciay committed
                } // End of testcase f_TC_SEC_ITSS_RCV_GENMSG_04_08_BO
garciay's avatar
garciay committed
                
garciay's avatar
garciay committed
            } // End of group g_TC_SEC_ITSS_RCV_GENMSG_04_08_BO 
garciay's avatar
garciay committed
            
            /**
garciay's avatar
garciay committed
             * @desc    Check that IUT discards a secured GN Beacon if the header_fields contains a signer of type 'self'
garciay's avatar
garciay committed
             * <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 { 
garciay's avatar
garciay committed
             *      the IUT is receiving a SecuredMessage (MSG_SEC_RCV_GENMSG_A) 
             *          containing header_fields['signer_info']
             *              containing signer.type
             *                  indicating 'self''
garciay's avatar
garciay committed
             *  } then { 
             *      the IUT discards the message 
             *  } 
             * } 
             * </pre>
             *
garciay's avatar
garciay committed
             * @see          ETSI TS 103 096-2 v1.2.2 TP_SEC_ITSS_RCV_GENMSG_05_01_BO
garciay's avatar
garciay committed
             * @reference    ETSI TS 103 097 [1], clause 7.1
             */
garciay's avatar
garciay committed
            testcase TC_SEC_ITSS_RCV_GENMSG_05_01_BO() runs on ItsMtc system ItsSecSystem {
garciay's avatar
garciay committed
                
                // Local variables
                var ItsGeoNetworking v_nodeB;
                var ItsGeoNetworking v_nodeD;
                
                // Test control
                if (not(PICS_GN_SECURITY) or not(PICS_GN_GBC_SRC)) {
garciay's avatar
garciay committed
                    log("*** " & testcasename() & ": 'PICS_GN_SECURITY' and 'PICS_GN_GBC_SRC' required for executing the TC ***");
garciay's avatar
garciay committed
                    setverdict(inconc);
                    stop;
                }
                
                // Test component configuration
                f_cf02Up();
                
                // Preamble
                
                // Start components
                v_nodeB := f_getComponent(c_compNodeB);
                v_nodeD := f_getComponent(c_compNodeD);
garciay's avatar
garciay committed
                v_nodeB.start(f_TC_SEC_ITSS_RCV_GENMSG_05_01_BO());
garciay's avatar
garciay committed
                v_nodeD.start(f_TC_SEC_ITSS_RCV_GENMSG_xxx_BO_nodeD());
                
                // Synchronization
                f_serverSync2ClientsAndStop({c_prDone, c_tbDone, c_poDone});
                
                // Cleanup
                f_cf02Down();
                
garciay's avatar
garciay committed
            } // End of testcase TC_SEC_ITSS_RCV_GENMSG_05_01_BO
garciay's avatar
garciay committed
            
garciay's avatar
garciay committed
            group g_TC_SEC_ITSS_RCV_GENMSG_05_01_BO {
garciay's avatar
garciay committed
                
                    /**
                     * @desc    Behavior function for NodeB (TC_GEONW_PON_GBC_BV_01)
                     */
garciay's avatar
garciay committed
                function f_TC_SEC_ITSS_RCV_GENMSG_05_01_BO() runs on ItsGeoNetworking {
garciay's avatar
garciay committed
                    
                    // 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_field_signer_info(
garciay's avatar
garciay committed
                                m_signerInfo_self
                            ), 
garciay's avatar
garciay committed
                            m_header_field_generation_time(1000 * f_getCurrentTime()), // In us
                            m_header_field_generation_location(
                                valueof(m_threeDLocation(
                                    v_longPosVectorNodeB.latitude,
                                    v_longPosVectorNodeB.longitude,
                                    '0000'O
                                ))
                            ),
                            m_header_field_its_aid_Other
                        }, 
garciay's avatar
garciay committed
                        e_self,
garciay's avatar
garciay committed
                        false
                    ); 
                    f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast(v_securedGnPdu));
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    
                    // Postamble
                    f_selfOrClientSyncAndVerdict(c_poDone, e_success);
                    
garciay's avatar
garciay committed
                } // End of testcase f_TC_SEC_ITSS_RCV_GENMSG_05_01_BO
garciay's avatar
garciay committed
                
garciay's avatar
garciay committed
            } // End of group g_TC_SEC_ITSS_RCV_GENMSG_05_01_BO 
garciay's avatar
garciay committed
            
            /**
garciay's avatar
garciay committed
             * @desc    Check that IUT discards a secured GN Beacon if the header_fields contains a signer of type 'certificate_digest_with_other_algorithm'
garciay's avatar
garciay committed
             * <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 { 
garciay's avatar
garciay committed
             *      the IUT is receiving a SecuredMessage (MSG_SEC_RCV_GENMSG_A) 
             *          containing header_fields['signer_info']
             *              containing signer.type
             *                  indicating 'certificate_digest_with_other_algorithm'
garciay's avatar
garciay committed
             *  } then { 
             *      the IUT discards the message 
             *  } 
             * } 
             * </pre>
             *
garciay's avatar
garciay committed
             * @see          ETSI TS 103 096-2 v1.2.2 TP_SEC_ITSS_RCV_GENMSG_05_02_BO
garciay's avatar
garciay committed
             * @reference    ETSI TS 103 097 [1], clause 7.1
             */
garciay's avatar
garciay committed
            testcase TC_SEC_ITSS_RCV_GENMSG_05_02_BO() runs on ItsMtc system ItsSecSystem {
garciay's avatar
garciay committed
                
                // Local variables
                var ItsGeoNetworking v_nodeB;
                var ItsGeoNetworking v_nodeD;
                
                // Test control
                if (not(PICS_GN_SECURITY) or not(PICS_GN_GBC_SRC)) {
garciay's avatar
garciay committed
                    log("*** " & testcasename() & ": 'PICS_GN_SECURITY' and 'PICS_GN_GBC_SRC' required for executing the TC ***");
garciay's avatar
garciay committed
                    setverdict(inconc);
                    stop;
                }
                
                // Test component configuration
                f_cf02Up();
                
                // Preamble
                
                // Start components
                v_nodeB := f_getComponent(c_compNodeB);
                v_nodeD := f_getComponent(c_compNodeD);
garciay's avatar
garciay committed
                v_nodeB.start(f_TC_SEC_ITSS_RCV_GENMSG_05_02_BO());
garciay's avatar
garciay committed
                v_nodeD.start(f_TC_SEC_ITSS_RCV_GENMSG_xxx_BO_nodeD());
                
                // Synchronization
                f_serverSync2ClientsAndStop({c_prDone, c_tbDone, c_poDone});
                
                // Cleanup
                f_cf02Down();
                
garciay's avatar
garciay committed
            } // End of testcase TC_SEC_ITSS_RCV_GENMSG_05_02_BO
garciay's avatar
garciay committed
            
garciay's avatar
garciay committed
            group g_TC_SEC_ITSS_RCV_GENMSG_05_02_BO {
garciay's avatar
garciay committed
                
                    /**
                     * @desc    Behavior function for NodeB (TC_GEONW_PON_GBC_BV_01)
                     */
garciay's avatar
garciay committed
                function f_TC_SEC_ITSS_RCV_GENMSG_05_02_BO() runs on ItsGeoNetworking {
garciay's avatar
garciay committed
                    
                    // 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_field_signer_info(
garciay's avatar
garciay committed
                                m_signerInfo_other_certificates(
                                    m_certificateWithAlgo_ecdsa(
                                        PX_OTHER_CERT_DIGEST
                            ))), 
garciay's avatar
garciay committed
                            m_header_field_generation_time(1000 * f_getCurrentTime()), // In us
                            m_header_field_generation_location(
                                valueof(m_threeDLocation(
                                    v_longPosVectorNodeB.latitude,
                                    v_longPosVectorNodeB.longitude,
                                    '0000'O
                                ))
                            ),
                            m_header_field_its_aid_Other
                        }, 
garciay's avatar
garciay committed
                        e_self,
garciay's avatar
garciay committed
                        false
                    ); 
                    f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast(v_securedGnPdu));
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    
                    // Postamble
                    f_selfOrClientSyncAndVerdict(c_poDone, e_success);
                    
garciay's avatar
garciay committed
                } // End of testcase f_TC_SEC_ITSS_RCV_GENMSG_05_02_BO
garciay's avatar
garciay committed
                
garciay's avatar
garciay committed
            } // End of group g_TC_SEC_ITSS_RCV_GENMSG_05_02_BO 
garciay's avatar
garciay committed
            
            /**
garciay's avatar
garciay committed
             * @desc    Check that IUT discards a secured GN Beacon if the header_fields contains a signer of type 'certificate_chain'
garciay's avatar
garciay committed
             * <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 { 
garciay's avatar
garciay committed
             *      the IUT is receiving a SecuredMessage (MSG_SEC_RCV_GENMSG_A) 
             *          containing header_fields['signer_info']
             *              containing signer.type
             *                  indicating 'certificate_chain'
garciay's avatar
garciay committed
             *  } then { 
             *      the IUT discards the message 
             *  } 
             * } 
             * </pre>
             *
garciay's avatar
garciay committed
             * @see          ETSI TS 103 096-2 v1.2.2 TP_SEC_ITSS_RCV_GENMSG_05_03_BO
garciay's avatar
garciay committed
             * @reference    ETSI TS 103 097 [1], clause 7.1
             */
garciay's avatar
garciay committed
            testcase TC_SEC_ITSS_RCV_GENMSG_05_03_BO() runs on ItsMtc system ItsSecSystem {
garciay's avatar
garciay committed
                
                // Local variables
                var ItsGeoNetworking v_nodeB;
                var ItsGeoNetworking v_nodeD;
                
                // Test control
                if (not(PICS_GN_SECURITY) or not(PICS_GN_GBC_SRC)) {
garciay's avatar
garciay committed
                    log("*** " & testcasename() & ": 'PICS_GN_SECURITY' and 'PICS_GN_GBC_SRC' required for executing the TC ***");
garciay's avatar
garciay committed
                    setverdict(inconc);
                    stop;
                }
                
                // Test component configuration
                f_cf02Up();
                
                // Preamble
                
                // Start components
                v_nodeB := f_getComponent(c_compNodeB);
                v_nodeD := f_getComponent(c_compNodeD);
garciay's avatar
garciay committed
                v_nodeB.start(f_TC_SEC_ITSS_RCV_GENMSG_05_03_BO());
garciay's avatar
garciay committed
                v_nodeD.start(f_TC_SEC_ITSS_RCV_GENMSG_xxx_BO_nodeD());
                
                // Synchronization
                f_serverSync2ClientsAndStop({c_prDone, c_tbDone, c_poDone});
                
                // Cleanup
                f_cf02Down();
                
garciay's avatar
garciay committed
            } // End of testcase TC_SEC_ITSS_RCV_GENMSG_05_03_BO
garciay's avatar
garciay committed
            
garciay's avatar
garciay committed
            group g_TC_SEC_ITSS_RCV_GENMSG_05_03_BO {
garciay's avatar
garciay committed
                
                    /**
                     * @desc    Behavior function for NodeB (TC_GEONW_PON_GBC_BV_01)
                     */
garciay's avatar
garciay committed
                function f_TC_SEC_ITSS_RCV_GENMSG_05_03_BO() runs on ItsGeoNetworking {
garciay's avatar
garciay committed
                    
                    // 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_field_signer_info(
garciay's avatar
garciay committed
                                m_signerInfo_certificates(
                                    { vc_atCertificate }
                            )), 
garciay's avatar
garciay committed
                            m_header_field_generation_time(1000 * f_getCurrentTime()), // In us
garciay's avatar
garciay committed
                            m_header_field_generation_location(
                                valueof(m_threeDLocation(
                                    v_longPosVectorNodeB.latitude,
                                    v_longPosVectorNodeB.longitude,
                                    '0000'O
                                ))
                            ),
garciay's avatar
garciay committed
                            m_header_field_its_aid_Other
                        }, 
garciay's avatar
garciay committed
                        e_self,
garciay's avatar
garciay committed
                        false
                    ); 
                    f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast(v_securedGnPdu));
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    
                    // Postamble
                    f_selfOrClientSyncAndVerdict(c_poDone, e_success);
                    
garciay's avatar
garciay committed
                } // End of testcase f_TC_SEC_ITSS_RCV_GENMSG_05_03_BO
garciay's avatar
garciay committed
                
garciay's avatar
garciay committed
            } // End of group g_TC_SEC_ITSS_RCV_GENMSG_05_03_BO 
garciay's avatar
garciay committed
            
            /**
garciay's avatar
garciay committed
             * @desc    Check that IUT discards a secured GN Message containing generation_time before the message signing certificate validity period
garciay's avatar
garciay committed
             * <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 { 
garciay's avatar
garciay committed
             *      the IUT is receiving a SecuredMessage (MSG_SEC_RCV_GENMSG_A)
             *          containing header_fields['signer_info'].type
             *              indicating 'signer_info'
             *                  containing certificate (CERT_TS_A_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_AT_START
garciay's avatar
garciay committed
             *  } then { 
             *      the IUT discards the message 
             *  } 
             * } 
             * </pre>
             *
garciay's avatar
garciay committed
             * @see          ETSI TS 103 096-2 v1.2.2 TP_SEC_ITSS_RCV_GENMSG_06_01_BO
garciay's avatar
garciay committed
             * @reference    ETSI TS 103 097 [1], clause 7.1
             */
garciay's avatar
garciay committed
            testcase TC_SEC_ITSS_RCV_GENMSG_06_01_BO() runs on ItsMtc system ItsSecSystem {
garciay's avatar
garciay committed
                
                // Local variables
                var ItsGeoNetworking v_nodeB;
                var ItsGeoNetworking v_nodeD;
                
                // Test control
                if (not(PICS_GN_SECURITY) or not(PICS_GN_GBC_SRC)) {
garciay's avatar
garciay committed
                    log("*** " & testcasename() & ": 'PICS_GN_SECURITY' and 'PICS_GN_GBC_SRC' required for executing the TC ***");
garciay's avatar
garciay committed
                    setverdict(inconc);
                    stop;
                }
                
                // Test component configuration
                f_cf02Up();
                
                // Preamble
                
                // Start components
                v_nodeB := f_getComponent(c_compNodeB);
                v_nodeD := f_getComponent(c_compNodeD);
garciay's avatar
garciay committed
                v_nodeB.start(f_TC_SEC_ITSS_RCV_GENMSG_06_01_BO());
garciay's avatar
garciay committed
                v_nodeD.start(f_TC_SEC_ITSS_RCV_GENMSG_xxx_BO_nodeD());
                
                // Synchronization
                f_serverSync2ClientsAndStop({c_prDone, c_tbDone, c_poDone});
                
                // Cleanup
                f_cf02Down();
                
garciay's avatar
garciay committed
            } // End of testcase TC_SEC_ITSS_RCV_GENMSG_06_01_BO
garciay's avatar
garciay committed
            
garciay's avatar
garciay committed
            group g_TC_SEC_ITSS_RCV_GENMSG_06_01_BO {
garciay's avatar
garciay committed
                
                    /**
                     * @desc    Behavior function for NodeB (TC_GEONW_PON_GBC_BV_01)
                     */
garciay's avatar
garciay committed
                function f_TC_SEC_ITSS_RCV_GENMSG_06_01_BO() runs on ItsGeoNetworking {
garciay's avatar
garciay committed
                    
                    // 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_field_signer_info(
garciay's avatar
garciay committed
                                m_signerInfo_digest(
                                    vc_atCertificate.signer_info.signerInfo.digest
                            )), 
                            m_header_field_generation_time( // TODO Try to refine access to the certificate validity_restrictions['time_start_and_end'] field access
                                (vc_atCertificate.signer_info.signerInfo.certificate.validity_restrictions[0].validity.time_start_and_end.start_validity - 3600) * 1000
                            ), // In us
garciay's avatar
garciay committed
                            m_header_field_generation_location(
                                valueof(m_threeDLocation(
                                    v_longPosVectorNodeB.latitude,
                                    v_longPosVectorNodeB.longitude,
                                    '0000'O
                                ))
                            ),
                            m_header_field_its_aid_Other
                        }, 
garciay's avatar
garciay committed
                        e_certificate_digest_with_sha256,
garciay's avatar
garciay committed
                        false
                    ); 
                    f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast(v_securedGnPdu));
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    
                    // Postamble
                    f_selfOrClientSyncAndVerdict(c_poDone, e_success);
                    
garciay's avatar
garciay committed
                } // End of testcase f_TC_SEC_ITSS_RCV_GENMSG_06_01_BO
garciay's avatar
garciay committed
                
garciay's avatar
garciay committed
            } // End of group g_TC_SEC_ITSS_RCV_GENMSG_06_01_BO 
garciay's avatar
garciay committed
            
            /**
garciay's avatar
garciay committed
             * @desc    Check that IUT discards the secured GN Message containing generation_time after the message signing certificate validity period
garciay's avatar
garciay committed
             * <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 { 
garciay's avatar
garciay committed
             *      the IUT is receiving a SecuredMessage (MSG_SEC_RCV_GENMSG_A) 
             *          containing header_fields['signer_info'].type
             *              indicating 'signer_info'
             *                  containing certificate (CERT_TS_A_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
garciay's avatar
garciay committed
             *  } then { 
             *      the IUT discards the message 
             *  } 
             * } 
             * </pre>
             *
garciay's avatar
garciay committed
             * @see          ETSI TS 103 096-2 v1.2.2 TP_SEC_ITSS_RCV_GENMSG_06_02_BO
garciay's avatar
garciay committed
             * @reference    ETSI TS 103 097 [1], clause 7.1
             */
garciay's avatar
garciay committed
            testcase TC_SEC_ITSS_RCV_GENMSG_06_02_BO() runs on ItsMtc system ItsSecSystem {
garciay's avatar
garciay committed
                
                // Local variables
                var ItsGeoNetworking v_nodeB;
                var ItsGeoNetworking v_nodeD;
                
                // Test control
                if (not(PICS_GN_SECURITY) or not(PICS_GN_GBC_SRC)) {
garciay's avatar
garciay committed
                    log("*** " & testcasename() & ": 'PICS_GN_SECURITY' and 'PICS_GN_GBC_SRC' required for executing the TC ***");
garciay's avatar
garciay committed
                    setverdict(inconc);
                    stop;
                }
                
                // Test component configuration
                f_cf02Up();
                
                // Preamble
                
                // Start components
                v_nodeB := f_getComponent(c_compNodeB);
                v_nodeD := f_getComponent(c_compNodeD);
garciay's avatar
garciay committed
                v_nodeB.start(f_TC_SEC_ITSS_RCV_GENMSG_06_02_BO());
garciay's avatar
garciay committed
                v_nodeD.start(f_TC_SEC_ITSS_RCV_GENMSG_xxx_BO_nodeD());
                
                // Synchronization
                f_serverSync2ClientsAndStop({c_prDone, c_tbDone, c_poDone});
                
                // Cleanup
                f_cf02Down();
                
garciay's avatar
garciay committed
            } // End of testcase TC_SEC_ITSS_RCV_GENMSG_06_02_BO
garciay's avatar
garciay committed
            
garciay's avatar
garciay committed
            group g_TC_SEC_ITSS_RCV_GENMSG_06_02_BO {
garciay's avatar
garciay committed
                
                    /**
                     * @desc    Behavior function for NodeB (TC_GEONW_PON_GBC_BV_01)
                     */
garciay's avatar
garciay committed
                function f_TC_SEC_ITSS_RCV_GENMSG_06_02_BO() runs on ItsGeoNetworking {
garciay's avatar
garciay committed
                    
                    // 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_field_signer_info(
garciay's avatar
garciay committed
                                m_signerInfo_digest(
                                    vc_atCertificate.signer_info.signerInfo.digest
                            )), 
                            m_header_field_generation_time( // TODO Try to refine access to the certificate validity_restrictions['time_start_and_end'] field access
                                (vc_atCertificate.signer_info.signerInfo.certificate.validity_restrictions[0].validity.time_start_and_end.end_validity + 3600) * 1000
                            ), // In us
garciay's avatar
garciay committed
                            m_header_field_generation_location(
                                valueof(m_threeDLocation(
                                    v_longPosVectorNodeB.latitude,
                                    v_longPosVectorNodeB.longitude,
                                    '0000'O
                                ))
                            ),
                            m_header_field_its_aid_Other
                        }, 
garciay's avatar
garciay committed
                        e_certificate_digest_with_sha256,
garciay's avatar
garciay committed
                        false
                    ); 
                    f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast(v_securedGnPdu));
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    
                    // Postamble
                    f_selfOrClientSyncAndVerdict(c_poDone, e_success);
                    
garciay's avatar
garciay committed
                } // End of testcase f_TC_SEC_ITSS_RCV_GENMSG_06_02_BO
garciay's avatar
garciay committed
                
garciay's avatar
garciay committed
            } // End of group g_TC_SEC_ITSS_RCV_GENMSG_06_02_BO 
garciay's avatar
garciay committed
            
            /**
garciay's avatar
garciay committed
             * @desc    Check that IUT discards Secured GN Message if the generation_time is more than 10 minute in the past (C2C only)