ItsSecurity_TestCases.ttcn3 1.25 MB
Newer Older
garciay's avatar
garciay committed
                    // empty on purpose 
                }
                if (i < lengthof(vc_utInds)) {
                    log("*** " & testcasename() & ": PASS: GN was transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                }
                else {
                    log("*** " & testcasename() & ": FAIL: GN was not transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                }
garciay's avatar
garciay committed
                
garciay's avatar
garciay committed
                // Postamble
                f_poNeighbour();
                f_cf01Down();
            } // End of testcase TC_SEC_ITSS_RCV_CERT_09_05_BV
garciay's avatar
garciay committed
            
            /**
garciay's avatar
garciay committed
             * @desc    Check that the IUT accepts a message when the signing certificate of the message contains the identified region validity restriction with the identified region which is fully covered by the identified region of the validity restriction of its issuing certificate
garciay's avatar
garciay committed
             * <pre>
garciay's avatar
garciay committed
             * Pics Selection: PICS_GN_SECURITY
garciay's avatar
garciay committed
             * Config Id: CF01
garciay's avatar
garciay committed
             * Initial conditions:
             *  with {
             *      the IUT being in the 'authorized' state
             *      and the IUT current time is inside the time validity period of CERT_TS_09_06_BV_AT
             *      and the IUT current location is inside the ID_REGION_AT
             *  }
             *  ensure that {
             *      when { 
             *          the IUT is receiving a SecuredMessage
             *              containing header_fields['signer_info']
             *                  and containing signer 
             *                      containing type
             *                          indicating 'certificate'
             *                      and containing certificate (CERT_TS_09_06_BV_AT)
             *                          containing validity_restrictions['region']
             *                              containing region_type
             *                                  indicating 'id'
             *                              and containing id_region
             *                                  containing region_dictionary
             *                                      indicating 'iso_3166_1'
             *                                  and containing region_identifier
             *                                      indicating ID_REGION_AT
             *                                  and containing local_region
             *                                      indicating 0
             *                          and containing signer_info.digest
             *                              referencing to a CERT_TS_E_AA
             *                                  containing validity_restrictions['region']
             *                                      containing region_type
             *                                          indicating 'id'
             *                                      and containing id_region
             *                                          containing region_dictionary
             *                                              indicating 'un_stats'
             *                                          and containing region_identifier
             *                                              indicating ID_REGION_AA_UNSTATS
             *                                                  which includes ID_REGION_AT
             *                                          and containing local_region
             *                                              indicating 0
             *      } then {
             *          the IUT accepts the message
             *      }
             *  }
garciay's avatar
garciay committed
             * </pre>
garciay's avatar
garciay committed
             *
             * @see          ETSI TS 103 096-2 v1.2.2 TP_SEC_ITSS_RCV_CERT_09_06_BV
garciay's avatar
garciay committed
             * @reference    ETSI TS 103 097 [1], clauses 4.2.26 and 7.4.1
garciay's avatar
garciay committed
             */
garciay's avatar
garciay committed
            testcase TC_SEC_ITSS_RCV_CERT_09_06_BV() runs on ItsGeoNetworking system ItsSecSystem {
garciay's avatar
garciay committed
                
                // Local variables
garciay's avatar
garciay committed
                var integer i;
                var GeoNetworkingPdu v_securedGnPdu;
                var GnRawPayload v_sentRawPayload;
garciay's avatar
garciay committed
                
garciay's avatar
garciay committed
                // Test adapter configuration
                if (not(PICS_GN_SECURITY)) {
                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
garciay's avatar
garciay committed
                    stop;
                }
                
                // Test component configuration
garciay's avatar
garciay committed
                f_cf01Up();
garciay's avatar
garciay committed
                
garciay's avatar
garciay committed
                // Test adapter configuration
garciay's avatar
garciay committed
                
garciay's avatar
garciay committed
                // Preamble
                f_prNeighbour();
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
garciay's avatar
garciay committed
                
garciay's avatar
garciay committed
                // Test Body
                v_securedGnPdu := f_sendSecuredCam(cc_taCert0906_BV, omit, e_certificate);
garciay's avatar
garciay committed
                
garciay's avatar
garciay committed
                f_sleep(PX_TNOAC);
                v_sentRawPayload := f_adaptPayloadForUtInd_m(v_securedGnPdu.gnPacket.packet.payload);
                for (i := 0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, v_sentRawPayload); i := i + 1) {
                    // empty on purpose 
                }
                if (i < lengthof(vc_utInds)) {
                    log("*** " & testcasename() & ": PASS: GN was transmitted to upper layer ***");
garciay's avatar
garciay committed
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
garciay's avatar
garciay committed
                }
                else {
                    log("*** " & testcasename() & ": FAIL: GN was not transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                }
garciay's avatar
garciay committed
                
garciay's avatar
garciay committed
                // Postamble
                f_poNeighbour();
                f_cf01Down();
            } // End of testcase TC_SEC_ITSS_RCV_CERT_09_06_BV
garciay's avatar
garciay committed
            
            /**
garciay's avatar
garciay committed
             * @desc    Check that the IUT discards a message when the signing certificate of this message does not contain the region validity restriction but its issuing certificate contains the identified region validity restriction
garciay's avatar
garciay committed
             * <pre>
garciay's avatar
garciay committed
             * Pics Selection: PICS_GN_SECURITY
garciay's avatar
garciay committed
             * Config Id: CF01
garciay's avatar
garciay committed
             * Initial conditions:
             *  with {
             *      the IUT being in the 'authorized' state
             *      and the IUT current time is inside the time validity period of CERT_TS_09_07_BO_AT
             *      and the IUT current location is inside the ID_REGION_AT
             *  }
             *  ensure that {
             *      when { 
             *          the IUT is receiving a SecuredMessage
             *              containing header_fields['signer_info']
             *                  and containing signer 
             *                      containing type
             *                          indicating 'certificate'
             *                      and containing certificate (CERT_TS_09_07_BO_AT)
             *                          not containing validity_restrictions['region']
             *                          and containing signer_info.digest
             *                              referencing to a CERT_TS_E_AA
             *                                  containing validity_restrictions['region']
             *                                      containing region_type
             *                                          indicating 'id'
             *      } then {
             *          the IUT discards the message
             *      }
             *  }
garciay's avatar
garciay committed
             * </pre>
garciay's avatar
garciay committed
             *
             * @see          ETSI TS 103 096-2 v1.2.2 TP_SEC_ITSS_RCV_CERT_09_07_BO
garciay's avatar
garciay committed
             * @reference    ETSI TS 103 097 [1], clauses 4.2.26 and 7.4.1
garciay's avatar
garciay committed
             */
garciay's avatar
garciay committed
            testcase TC_SEC_ITSS_RCV_CERT_09_07_BO() runs on ItsGeoNetworking system ItsSecSystem {
garciay's avatar
garciay committed
                
                // Local variables
garciay's avatar
garciay committed
                var integer i;
                var GeoNetworkingPdu v_securedGnPdu;
                var GnRawPayload v_sentRawPayload;
garciay's avatar
garciay committed
                
garciay's avatar
garciay committed
                // Test adapter configuration
                if (not(PICS_GN_SECURITY)) {
                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
garciay's avatar
garciay committed
                    stop;
                }
                
                // Test component configuration
garciay's avatar
garciay committed
                f_cf01Up();
garciay's avatar
garciay committed
                
garciay's avatar
garciay committed
                // Test adapter configuration
garciay's avatar
garciay committed
                
garciay's avatar
garciay committed
                // Preamble
                f_prNeighbour();
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
garciay's avatar
garciay committed
                
garciay's avatar
garciay committed
                // Test Body
                v_securedGnPdu := f_sendSecuredCam(cc_taCert0907_BO, omit, e_certificate);
garciay's avatar
garciay committed
                
garciay's avatar
garciay committed
                f_sleep(PX_TNOAC);
                v_sentRawPayload := f_adaptPayloadForUtInd_m(v_securedGnPdu.gnPacket.packet.payload);
                for (i := 0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, v_sentRawPayload); i := i + 1) {
                    // empty on purpose 
                }
                if (i < lengthof(vc_utInds)) {
                    log("*** " & testcasename() & ": FAIL: GN was transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                }
                else {
                    log("*** " & testcasename() & ": PASS: GN was not transmitted to upper layer ***");
garciay's avatar
garciay committed
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
garciay's avatar
garciay committed
                }
garciay's avatar
garciay committed
                
garciay's avatar
garciay committed
                // Postamble
                f_poNeighbour();
                f_cf01Down();
            } // End of testcase TC_SEC_ITSS_RCV_CERT_09_07_BO
garciay's avatar
garciay committed
            
            /**
garciay's avatar
garciay committed
             * @desc    Check that the IUT discards a message when the signing certificate and its issuing certificate are both containing the identified region validity restrictions with the same region id but different local regions
garciay's avatar
garciay committed
             * <pre>
garciay's avatar
garciay committed
             * Pics Selection: PICS_GN_SECURITY
garciay's avatar
garciay committed
             * Config Id: CF01
garciay's avatar
garciay committed
             * Initial conditions:
             *  with {
             *      the IUT being in the 'authorized' state
             *      and the IUT current time is inside the time validity period of CERT_TS_09_08_BO_AT
             *      and the IUT current location is inside the ID_REGION_AA, local region 1
             *  }
             *  ensure that {
             *      when { 
             *          the IUT is receiving a SecuredMessage
             *              containing header_fields['signer_info']
             *                  and containing signer 
             *                      containing type
             *                          indicating 'certificate'
             *                      and containing certificate (CERT_TS_09_08_BO_AT)
             *                          containing validity_restrictions['region']
             *                              containing region_type
             *                                  indicating 'id'
             *                              and containing id_region
             *                                  containing region_dictionary
             *                                      indicating 'iso_3166_1'
             *                                  and containing region_identifier
             *                                      indicating ID_REGION_AT
             *                                  and containing local_region
             *                                      indicating ID_LOCAL_REGION_1
             *                          and containing signer_info.digest
             *                              referencing to a CERT_TS_09_08_BO_AA
             *                                  containing validity_restrictions['region']
             *                                          indicating 'id'
             *                                  and containing id_region
             *                                      containing region_dictionary
             *                                          indicating 'iso_3166_1'
             *                                      and containing region_identifier
             *                                          indicating ID_REGION_AA
             *                                      and containing local_region
             *                                          indicating ID_LOCAL_REGION_2
             *                                              not equal to ID_LOCAL_REGION_1
             *      } then {
             *          the IUT discards the message
             *      }
             *  }
garciay's avatar
garciay committed
             * </pre>
garciay's avatar
garciay committed
             *
             * @see          ETSI TS 103 096-2 v1.2.2 TP_SEC_ITSS_RCV_CERT_09_08_BO
garciay's avatar
garciay committed
             * @reference    ETSI TS 103 097 [1], clauses 4.2.26 and 7.4.1
garciay's avatar
garciay committed
             */
garciay's avatar
garciay committed
            testcase TC_SEC_ITSS_RCV_CERT_09_08_BO() runs on ItsGeoNetworking system ItsSecSystem {
garciay's avatar
garciay committed
                
                // Local variables
garciay's avatar
garciay committed
                var integer i;
                var GeoNetworkingPdu v_securedGnPdu;
                var GnRawPayload v_sentRawPayload;
garciay's avatar
garciay committed
                
garciay's avatar
garciay committed
                // Test adapter configuration
                if (not(PICS_GN_SECURITY)) {
                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
garciay's avatar
garciay committed
                    stop;
                }
                
                // Test component configuration
garciay's avatar
garciay committed
                f_cf01Up();
garciay's avatar
garciay committed
                
garciay's avatar
garciay committed
                // Test adapter configuration
garciay's avatar
garciay committed
                
garciay's avatar
garciay committed
                // Preamble
                f_prNeighbour();
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
garciay's avatar
garciay committed
                
garciay's avatar
garciay committed
                // Test Body
                v_securedGnPdu := f_sendSecuredCam(cc_taCert0908_BO, omit, e_certificate);
garciay's avatar
garciay committed
                
garciay's avatar
garciay committed
                f_sleep(PX_TNOAC);
                v_sentRawPayload := f_adaptPayloadForUtInd_m(v_securedGnPdu.gnPacket.packet.payload);
                for (i := 0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, v_sentRawPayload); i := i + 1) {
                    // empty on purpose 
                }
                if (i < lengthof(vc_utInds)) {
                    log("*** " & testcasename() & ": FAIL: GN was transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                }
                else {
                    log("*** " & testcasename() & ": PASS: GN was not transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                }
garciay's avatar
garciay committed
                
garciay's avatar
garciay committed
                // Postamble
                f_poNeighbour();
                f_cf01Down();
            } // End of testcase TC_SEC_ITSS_RCV_CERT_09_08_BO
garciay's avatar
garciay committed
            
            /**
garciay's avatar
garciay committed
             * @desc    Check that the IUT discards a message when the identified region of the validity restriction of its signing certificate is different and not fully covered by the one in the issuing certificate
garciay's avatar
garciay committed
             * <pre>
garciay's avatar
garciay committed
             * Pics Selection: PICS_GN_SECURITY
garciay's avatar
garciay committed
             * Config Id: CF01
garciay's avatar
garciay committed
             * Initial conditions:
             *  with {
             *      the IUT being in the 'authorized' state
             *      and the IUT current time is inside the time validity period of CERT_TS_09_09_BO_AT
             *      and the IUT current location is inside the ID_REGION_AT
             *  }
             *  ensure that {
             *      when { 
             *          the IUT is receiving a SecuredMessage
             *              containing header_fields['signer_info']
             *                  and containing signer 
             *                      containing type
             *                          indicating 'certificate'
             *                      and containing certificate (CERT_TS_09_09_BO_AT)
             *                          containing validity_restrictions['region']
             *                              containing region_type
             *                                  indicating 'id'
             *                              and containing id_region
             *                                  containing region_dictionary
             *                                      indicating 'iso_3166_1'
             *                                  and containing region_identifier
             *                                      indicating ID_REGION_AT
             *                                  and containing local_region
             *                                      indicating 0
             *                          and containing signer_info.digest
             *                              referencing to a CERT_TS_09_09_BO_AA
             *                                  containing validity_restrictions['region']
             *                                          indicating 'id'
             *                                  and containing id_region
             *                                      containing region_dictionary
             *                                          indicating 'iso_3166_1'
             *                                      and containing region_identifier
             *                                          indicating ID_REGION_AA_OTHER
             *                                              other than ID_REGION_AT
             *                                      and containing local_region
             *                                          indicating 0
             *      } then {
             *          the IUT discards the message
             *      }
             *  }
garciay's avatar
garciay committed
             * </pre>
garciay's avatar
garciay committed
             *
             * @see          ETSI TS 103 096-2 v1.2.2 TP_SEC_ITSS_RCV_CERT_09_09_BO
garciay's avatar
garciay committed
             * @reference    ETSI TS 103 097 [1], clauses 4.2.26 and 7.4.1
garciay's avatar
garciay committed
             */
garciay's avatar
garciay committed
            testcase TC_SEC_ITSS_RCV_CERT_09_09_BO() runs on ItsGeoNetworking system ItsSecSystem {
garciay's avatar
garciay committed
                
                // Local variables
garciay's avatar
garciay committed
                var integer i;
                var GeoNetworkingPdu v_securedGnPdu;
                var GnRawPayload v_sentRawPayload;
garciay's avatar
garciay committed
                
garciay's avatar
garciay committed
                // Test adapter configuration
                if (not(PICS_GN_SECURITY)) {
                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
garciay's avatar
garciay committed
                    stop;
                }
                
                // Test component configuration
garciay's avatar
garciay committed
                f_cf01Up();
garciay's avatar
garciay committed
                
garciay's avatar
garciay committed
                // Test adapter configuration
garciay's avatar
garciay committed
                
garciay's avatar
garciay committed
                // Preamble
                f_prNeighbour();
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
garciay's avatar
garciay committed
                
garciay's avatar
garciay committed
                // Test Body
                v_securedGnPdu := f_sendSecuredCam(cc_taCert0909_BO, omit, e_certificate);
garciay's avatar
garciay committed
                
garciay's avatar
garciay committed
                f_sleep(PX_TNOAC);
                v_sentRawPayload := f_adaptPayloadForUtInd_m(v_securedGnPdu.gnPacket.packet.payload);
                for (i := 0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, v_sentRawPayload); i := i + 1) {
                    // empty on purpose 
                }
                if (i < lengthof(vc_utInds)) {
                    log("*** " & testcasename() & ": FAIL: GN was transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                }
                else {
                    log("*** " & testcasename() & ": PASS: GN was not transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                }
garciay's avatar
garciay committed
                
garciay's avatar
garciay committed
                // Postamble
                f_poNeighbour();
                f_cf01Down();
            } // End of testcase TC_SEC_ITSS_RCV_CERT_09_09_BO
garciay's avatar
garciay committed
            
            /**
garciay's avatar
garciay committed
             * @desc    Check that the IUT discards a message when the identified region validity restriction of its signing certificate contains unknown area code
garciay's avatar
garciay committed
             * <pre>
garciay's avatar
garciay committed
             * Pics Selection: PICS_GN_SECURITY
garciay's avatar
garciay committed
             * Config Id: CF01
garciay's avatar
garciay committed
             * Initial conditions:
             *  with {
             *      the IUT being in the 'authorized' state
             *      and the IUT current time is inside the time validity period of CERT_TS_09_10_BO_AT
             *      and the IUT current location is inside the ID_REGION_AT
             *  }
             *  ensure that {
             *      when { 
             *          the IUT is receiving a SecuredMessage
             *              containing header_fields['signer_info']
             *                  and containing signer 
             *                      containing type
             *                          indicating 'certificate'
             *                      and containing certificate (CERT_TS_09_10_BO_AT)
             *                          containing validity_restrictions['region']
             *                              containing region_type
             *                                  indicating 'id'
             *                              and containing id_region
             *                                  containing region_dictionary
             *                                      indicating 'iso_3166_1'
             *                                  and containing region_identifier
             *                                      indicating ID_REGION_UNKNOWN
             *                                  and containing local_region
             *                                      indicating 0
             *                          and containing signer_info.digest
             *                              referencing to a CERT_TS_A_AA
             *                                  not containing validity_restrictions['region']
             *      } then {
             *          the IUT discards the message
             *      }
             *  }
garciay's avatar
garciay committed
             * </pre>
garciay's avatar
garciay committed
             *
             * @see          ETSI TS 103 096-2 v1.2.2 TP_SEC_ITSS_RCV_CERT_09_10_BO
garciay's avatar
garciay committed
             * @reference    ETSI TS 103 097 [1], clauses 4.2.26 and 7.4.1
garciay's avatar
garciay committed
             */
garciay's avatar
garciay committed
            testcase TC_SEC_ITSS_RCV_CERT_09_10_BO() runs on ItsGeoNetworking system ItsSecSystem {
garciay's avatar
garciay committed
                
                // Local variables
garciay's avatar
garciay committed
                var integer i;
                var GeoNetworkingPdu v_securedGnPdu;
                var GnRawPayload v_sentRawPayload;
garciay's avatar
garciay committed
                
garciay's avatar
garciay committed
                // Test adapter configuration
                if (not(PICS_GN_SECURITY)) {
                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
garciay's avatar
garciay committed
                    stop;
                }
                
                // Test component configuration
garciay's avatar
garciay committed
                f_cf01Up();
garciay's avatar
garciay committed
                
garciay's avatar
garciay committed
                // Test adapter configuration
garciay's avatar
garciay committed
                
garciay's avatar
garciay committed
                // Preamble
                f_prNeighbour();
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
garciay's avatar
garciay committed
                
garciay's avatar
garciay committed
                // Test Body
                v_securedGnPdu := f_sendSecuredCam(cc_taCert0910_BO, omit, e_certificate);
garciay's avatar
garciay committed
                
garciay's avatar
garciay committed
                f_sleep(PX_TNOAC);
                v_sentRawPayload := f_adaptPayloadForUtInd_m(v_securedGnPdu.gnPacket.packet.payload);
                for (i := 0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, v_sentRawPayload); i := i + 1) {
                    // empty on purpose 
                }
                if (i < lengthof(vc_utInds)) {
                    log("*** " & testcasename() & ": FAIL: GN was transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                }
                else {
                    log("*** " & testcasename() & ": PASS: GN was not transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                }
garciay's avatar
garciay committed
                
garciay's avatar
garciay committed
                // Postamble
                f_poNeighbour();
                f_cf01Down();
            } // End of testcase TC_SEC_ITSS_RCV_CERT_09_10_BO
garciay's avatar
garciay committed
            
            /**
garciay's avatar
garciay committed
             * @desc    Check that the IUT discards a message when the validity restriction of its signing certificate contains the identified region of type iso-3166-1 but region code is from the UN-Stats dictionary 
garciay's avatar
garciay committed
             * <pre>
garciay's avatar
garciay committed
             * Pics Selection: PICS_GN_SECURITY
garciay's avatar
garciay committed
             * Config Id: CF01
garciay's avatar
garciay committed
             * Initial conditions:
             *  with {
             *      the IUT being in the 'authorized' state
             *      and the IUT current time is inside the time validity period of CERT_TS_09_11_BO_AT
             *      and the IUT current location is inside the ID_REGION_AA_UNSTATS
             *  }
             *  ensure that {
             *      when { 
             *          the IUT is receiving a SecuredMessage
             *              containing header_fields['signer_info']
             *                  and containing signer 
             *                      containing type
             *                          indicating 'certificate'
             *                      and containing certificate (CERT_TS_09_11_BO_AT)
             *                          containing validity_restrictions['region']
             *                              containing region_type
             *                                  indicating 'id'
             *                              and containing id_region
             *                                  containing region_dictionary
             *                                      indicating 'iso_3166_1'
             *                                  and containing region_identifier
             *                                      indicating ID_REGION_AA_UNSTATS
             *                                  and containing local_region
             *                                      indicating 0
             *                          and containing signer_info.digest
             *                              referencing to a CERT_TS_A_AA
             *                                  not containing validity_restrictions['region']
             *      } then {
             *          the IUT discards the message
             *      }
             *  }
garciay's avatar
garciay committed
             * </pre>
garciay's avatar
garciay committed
             *
             * @see          ETSI TS 103 096-2 v1.2.2 TP_SEC_ITSS_RCV_CERT_09_11_BO
garciay's avatar
garciay committed
             * @reference    ETSI TS 103 097 [1], clauses 4.2.26 and 7.4.1
garciay's avatar
garciay committed
             */
garciay's avatar
garciay committed
            testcase TC_SEC_ITSS_RCV_CERT_09_11_BO() runs on ItsGeoNetworking system ItsSecSystem {
garciay's avatar
garciay committed
                
                // Local variables
garciay's avatar
garciay committed
                var integer i;
                var GeoNetworkingPdu v_securedGnPdu;
                var GnRawPayload v_sentRawPayload;
garciay's avatar
garciay committed
                
garciay's avatar
garciay committed
                // Test adapter configuration
                if (not(PICS_GN_SECURITY)) {
                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
garciay's avatar
garciay committed
                    stop;
                }
                
                // Test component configuration
garciay's avatar
garciay committed
                f_cf01Up();
garciay's avatar
garciay committed
                
garciay's avatar
garciay committed
                // Test adapter configuration
garciay's avatar
garciay committed
                
garciay's avatar
garciay committed
                // Preamble
                f_prNeighbour();
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
garciay's avatar
garciay committed
                
garciay's avatar
garciay committed
                // Test Body
                v_securedGnPdu := f_sendSecuredCam(cc_taCert0911_BO, omit, e_certificate);
garciay's avatar
garciay committed
                
garciay's avatar
garciay committed
                f_sleep(PX_TNOAC);
                v_sentRawPayload := f_adaptPayloadForUtInd_m(v_securedGnPdu.gnPacket.packet.payload);
                for (i := 0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, v_sentRawPayload); i := i + 1) {
                    // empty on purpose 
                }
                if (i < lengthof(vc_utInds)) {
                    log("*** " & testcasename() & ": FAIL: GN was transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                }
                else {
                    log("*** " & testcasename() & ": PASS: GN was not transmitted to upper layer ***");
garciay's avatar
garciay committed
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
garciay's avatar
garciay committed
                }
garciay's avatar
garciay committed
                
garciay's avatar
garciay committed
                // Postamble
                f_poNeighbour();
                f_cf01Down();
            } // End of testcase TC_SEC_ITSS_RCV_CERT_09_11_BO
garciay's avatar
garciay committed
            
            /**
garciay's avatar
garciay committed
             * @desc    Check that the IUT discards a message when its signing certificate does not contain the time validity restriction
garciay's avatar
garciay committed
             * <pre>
             * Pics Selection: PICS_GN_SECURITY
             * Config Id: CF01
             * Initial conditions:
             *  with {
garciay's avatar
garciay committed
             *      the IUT being in the 'authorized' state
             *      and the IUT current time is inside the time validity period of CERT_TS_10_01_BO_AT
             *      and the IUT current location is inside the CERT_TS_10_01_BO_AT
             *  }
             *  ensure that {
             *      when { 
             *          the IUT is receiving a SecuredMessage
             *              containing header_fields['signer_info']
             *                  and containing signer 
             *                      containing type
             *                          indicating 'certificate'
             *                      and containing certificate (CERT_TS_10_01_BO_AT)
             *                          containing validity_restrictions['time_start_and_end']
             *                          and not containing validity_restrictions['time_end']
             *                          and not containing validity_restrictions['time_start_and_duration']
garciay's avatar
garciay committed
             *      } then {
garciay's avatar
garciay committed
             *          the IUT discards the message
garciay's avatar
garciay committed
             *      }
             *  }
             * </pre>
             *
garciay's avatar
garciay committed
             * @see          ETSI TS 103 096-2 v1.2.2 TP_SEC_ITSS_RCV_CERT_10_01_BO
garciay's avatar
garciay committed
             * @reference    ETSI TS 103 097 [1], clause 7.4.1
garciay's avatar
garciay committed
             */
garciay's avatar
garciay committed
            testcase TC_SEC_ITSS_RCV_CERT_10_01_BO() runs on ItsGeoNetworking system ItsSecSystem {
garciay's avatar
garciay committed
                
                // Local variables
                var integer i;
                var GeoNetworkingPdu v_securedGnPdu;
                var GnRawPayload v_sentRawPayload;
                
                // Test adapter configuration
                if (not(PICS_GN_SECURITY)) {
                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
                    stop;
                }
                
garciay's avatar
garciay committed
                // Test component configuration
garciay's avatar
garciay committed
                f_cf01Up();
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
garciay's avatar
garciay committed
                v_securedGnPdu := f_sendSecuredCam(cc_taCert1001_BO, omit, e_certificate);
garciay's avatar
garciay committed
                
                f_sleep(PX_TNOAC);
                v_sentRawPayload := f_adaptPayloadForUtInd_m(v_securedGnPdu.gnPacket.packet.payload);
                for (i := 0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, v_sentRawPayload); i := i + 1) {
                    // empty on purpose 
                }
                if (i < lengthof(vc_utInds)) {
                    log("*** " & testcasename() & ": FAIL: GN was transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                }
                else {
                    log("*** " & testcasename() & ": PASS: GN was not transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                }
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
garciay's avatar
garciay committed
            } // End of testcase TC_SEC_ITSS_RCV_CERT_10_01_BO
garciay's avatar
garciay committed
            
            /**
garciay's avatar
garciay committed
             * @desc    Check that the IUT discards a message when its signing certificate contains 'time_end' validity restriction
garciay's avatar
garciay committed
             * <pre>
             * Pics Selection: PICS_GN_SECURITY
             * Config Id: CF01
             * Initial conditions:
             *  with {
             *      the IUT being in the 'authorized' state
garciay's avatar
garciay committed
             *      and the IUT current time is inside the time validity period of CERT_TS_10_02_BO_AT
             *      and the IUT current location is inside the CERT_TS_10_02_BO_AT
garciay's avatar
garciay committed
             *  }
             *  ensure that {
             *      when { 
             *          the IUT is receiving a SecuredMessage
garciay's avatar
garciay committed
             *              containing header_fields['signer_info']
             *                  and containing signer 
             *                      containing type
             *                          indicating 'certificate'
             *                      and containing certificate (CERT_TS_10_02_BO_AT)
             *                          containing validity_restrictions['time_end']
garciay's avatar
garciay committed
             *      } then {
garciay's avatar
garciay committed
             *          the IUT discards the message
garciay's avatar
garciay committed
             *      }
             *  }
             * </pre>
             *
garciay's avatar
garciay committed
             * @see          ETSI TS 103 096-2 v1.2.2 TP_SEC_ITSS_RCV_CERT_10_02_BO
garciay's avatar
garciay committed
             * @reference    ETSI TS 103 097 [1], clause 7.4.2
garciay's avatar
garciay committed
             */
garciay's avatar
garciay committed
            testcase TC_SEC_ITSS_RCV_CERT_10_02_BO() runs on ItsGeoNetworking system ItsSecSystem {
garciay's avatar
garciay committed
                
                // Local variables
                var integer i;
                var GeoNetworkingPdu v_securedGnPdu;
                var GnRawPayload v_sentRawPayload;
                
                // Test adapter configuration
                if (not(PICS_GN_SECURITY)) {
                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
                    stop;
                }
                
garciay's avatar
garciay committed
                // Test component configuration
garciay's avatar
garciay committed
                f_cf01Up();
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
garciay's avatar
garciay committed
                v_securedGnPdu := f_sendSecuredCam(cc_taCert1002_BO, omit, e_certificate);
garciay's avatar
garciay committed
                
                f_sleep(PX_TNOAC);
                v_sentRawPayload := f_adaptPayloadForUtInd_m(v_securedGnPdu.gnPacket.packet.payload);
                for (i := 0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, v_sentRawPayload); i := i + 1) {
                    // empty on purpose 
                }
                if (i < lengthof(vc_utInds)) {
                    log("*** " & testcasename() & ": FAIL: GN was transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                }
                else {
                    log("*** " & testcasename() & ": PASS: GN was not transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                }
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
garciay's avatar
garciay committed
            } // End of testcase TC_SEC_ITSS_RCV_CERT_10_02_BO
garciay's avatar
garciay committed
            
            /**
garciay's avatar
garciay committed
             * @desc    Check that the IUT discards a message when its signing certificate contains 'time_start_and_duration' validity restriction
garciay's avatar
garciay committed
             * <pre>
             * Pics Selection: PICS_GN_SECURITY
             * Config Id: CF01
             * Initial conditions:
             *  with {
             *      the IUT being in the 'authorized' state
garciay's avatar
garciay committed
             *      and the IUT current time is inside the time validity period of CERT_TS_10_03_BO_AT
             *      and the IUT current location is inside the CERT_TS_10_03_BO_AT
garciay's avatar
garciay committed
             *  }
             *  ensure that {
             *      when { 
             *          the IUT is receiving a SecuredMessage
garciay's avatar
garciay committed
             *              containing header_fields['signer_info']
             *                  and containing signer 
             *                      containing type
             *                          indicating 'certificate'
             *                      and containing certificate (CERT_TS_10_03_BO_AT)
             *                          containing validity_restrictions['time_start_and_duration']
garciay's avatar
garciay committed
             *      } then {
garciay's avatar
garciay committed
             *          the IUT discards the message
garciay's avatar
garciay committed
             *      }
             *  }
             * </pre>
             *
garciay's avatar
garciay committed
             * @see          ETSI TS 103 096-2 v1.2.2 TP_SEC_ITSS_RCV_CERT_10_03_BO
garciay's avatar
garciay committed
             * @reference    ETSI TS 103 097 [1], clause 7.4.2
garciay's avatar
garciay committed
             */
garciay's avatar
garciay committed
            testcase TC_SEC_ITSS_RCV_CERT_10_03_BO() runs on ItsGeoNetworking system ItsSecSystem {
garciay's avatar
garciay committed
                
                // Local variables
                var integer i;
                var GeoNetworkingPdu v_securedGnPdu;
                var GnRawPayload v_sentRawPayload;
                
                // Test adapter configuration
                if (not(PICS_GN_SECURITY)) {
                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
                    stop;
                }
                
garciay's avatar
garciay committed
                // Test component configuration
garciay's avatar
garciay committed
                f_cf01Up();
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
garciay's avatar
garciay committed
                v_securedGnPdu := f_sendSecuredCam(cc_taCert1003_BO, omit, e_certificate);
garciay's avatar
garciay committed
                
                f_sleep(PX_TNOAC);
                v_sentRawPayload := f_adaptPayloadForUtInd_m(v_securedGnPdu.gnPacket.packet.payload);
                for (i := 0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, v_sentRawPayload); i := i + 1) {
                    // empty on purpose 
                }
                if (i < lengthof(vc_utInds)) {
                    log("*** " & testcasename() & ": FAIL: GN was transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                }
                else {
                    log("*** " & testcasename() & ": PASS: GN was not transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                }
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
garciay's avatar
garciay committed
            } // End of testcase TC_SEC_ITSS_RCV_CERT_10_03_BO
garciay's avatar
garciay committed
            
            /**
garciay's avatar
garciay committed
             * @desc    Check that the IUT discards a message when the validity period of the signing certificate ends after the validity period of its issuing certificate
garciay's avatar
garciay committed
             * <pre>
             * Pics Selection: PICS_GN_SECURITY
             * Config Id: CF01
             * Initial conditions:
             *  with {
             *      the IUT being in the 'authorized' state
garciay's avatar
garciay committed
             *      and the IUT current time is greater than START_VALIDITY_AA and less than END_VALIDITY_AA
             *      and the IUT current location is inside the CERT_TS_11_01_BO_AT
garciay's avatar
garciay committed
             *  }
             *  ensure that {
             *      when { 
             *          the IUT is receiving a SecuredMessage
garciay's avatar
garciay committed
             *              containing header_fields ['signer_info'].signer.certificate (CERT_TS_11_01_BO_AT)
             *                  containing signer_info.digest
             *                      referencing to CERT_TS_A_AA
             *                          containing validity_restrictions['time_start_and_end']
             *                              containing start_validity
             *                                  indicating START_VALIDITY_AA
             *                              and containing end_validity
             *                                  indicating END_VALIDITY_AA
             *              and containing validity_restrictions['time_start_and_end'] 
             *                  containing start_validity
             *                      indicating START_VALIDITY_AA
             *                  and containing end_validity
             *                      indicating END_VALIDITY_AA + 1d
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_CERT_11_01_BO
garciay's avatar
garciay committed
             * @reference    ETSI TS 103 097 [1], clause 7.4.1
garciay's avatar
garciay committed
             */
garciay's avatar
garciay committed
            testcase TC_SEC_ITSS_RCV_CERT_11_01_BO() runs on ItsGeoNetworking system ItsSecSystem {
garciay's avatar
garciay committed
                
                // Local variables
                var integer i;
                var GeoNetworkingPdu v_securedGnPdu;
                var GnRawPayload v_sentRawPayload;
                
                // Test adapter configuration
                if (not(PICS_GN_SECURITY)) {
                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
                    stop;
                }
                
garciay's avatar
garciay committed
                // Test component configuration
garciay's avatar
garciay committed
                f_cf01Up();
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
garciay's avatar
garciay committed
                v_securedGnPdu := f_sendSecuredCam(cc_taCert1101_BO, omit, e_certificate);
garciay's avatar
garciay committed
                
                f_sleep(PX_TNOAC);
                v_sentRawPayload := f_adaptPayloadForUtInd_m(v_securedGnPdu.gnPacket.packet.payload);
                for (i := 0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, v_sentRawPayload); i := i + 1) {
                    // empty on purpose 
                }
                if (i < lengthof(vc_utInds)) {
                    log("*** " & testcasename() & ": FAIL: GN was transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                }
                else {
                    log("*** " & testcasename() & ": PASS: GN was not transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                }
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
garciay's avatar
garciay committed
            } // End of testcase TC_SEC_ITSS_RCV_CERT_11_01_BO
garciay's avatar
garciay committed
            
            /**
garciay's avatar
garciay committed
             * @desc    Check that the IUT discards a message when the validity period of its signing certificate starts before the validity period of the issuing certificate 
garciay's avatar
garciay committed
             * <pre>
             * Pics Selection: PICS_GN_SECURITY
             * Config Id: CF01
             * Initial conditions:
             *  with {
             *      the IUT being in the 'authorized' state
garciay's avatar
garciay committed
             *      and the IUT current time is greater than START_VALIDITY_AA and less than END_VALIDITY_AA
             *      and the IUT current location is inside the CERT_TS_11_02_BO_AT
garciay's avatar
garciay committed
             *  }
             *  ensure that {
             *      when { 
             *          the IUT is receiving a SecuredMessage
garciay's avatar
garciay committed
             *              containing header_fields ['signer_info'].signer.certificate (CERT_TS_11_02_BO_AT)
             *                  containing signer_info.digest
             *                      referencing to CERT_TS_A_AA
             *                          containing validity_restrictions['time_start_and_end']
             *                              containing start_validity
             *                                  indicating START_VALIDITY_AA
             *                              and containing end_validity
             *                                  indicating END_VALIDITY_AA
             *              and containing validity_restrictions['time_start_and_end'] 
             *                  containing start_validity
             *                      indicating START_VALIDITY_AA - 1d
             *                  and containing end_validity
             *                      indicating END_VALIDITY_AA
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_CERT_11_02_BO
garciay's avatar
garciay committed
             * @reference    ETSI TS 103 097 [1], clause 7.4.1
garciay's avatar
garciay committed
             */
garciay's avatar
garciay committed
            testcase TC_SEC_ITSS_RCV_CERT_11_02_BO() runs on ItsGeoNetworking system ItsSecSystem {
garciay's avatar
garciay committed
                
                // Local variables
                var integer i;
                var GeoNetworkingPdu v_securedGnPdu;
                var GnRawPayload v_sentRawPayload;
                
                // Test adapter configuration
                if (not(PICS_GN_SECURITY)) {
                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
                    stop;
                }
                
garciay's avatar
garciay committed
                // Test component configuration
garciay's avatar
garciay committed
                f_cf01Up();
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
garciay's avatar
garciay committed
                v_securedGnPdu := f_sendSecuredCam(cc_taCert1102_BO, omit, e_certificate);
garciay's avatar
garciay committed
                
                f_sleep(PX_TNOAC);
                v_sentRawPayload := f_adaptPayloadForUtInd_m(v_securedGnPdu.gnPacket.packet.payload);
                for (i := 0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, v_sentRawPayload); i := i + 1) {
                    // empty on purpose 
                }
                if (i < lengthof(vc_utInds)) {
                    log("*** " & testcasename() & ": FAIL: GN was transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                }
                else {
                    log("*** " & testcasename() & ": PASS: GN was not transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                }
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
garciay's avatar
garciay committed
            } // End of testcase TC_SEC_ITSS_RCV_CERT_11_02_BO
garciay's avatar
garciay committed
            
            /**
garciay's avatar
garciay committed
             * @desc    Check that the IUT discards a message when the issuing certificate of signing certificate is expired but the signing certificate is not expired yet.
garciay's avatar
garciay committed
             * <pre>
             * Pics Selection: PICS_GN_SECURITY
             * Config Id: CF01
             * Initial conditions:
             *  with {
             *      the IUT being in the 'authorized' state
garciay's avatar
garciay committed
             *      and the IUT current time is greater than START_VALIDITY_AA and less than END_VALIDITY_AA
             *      and the IUT current location is inside the CERT_TS_11_03_BO_AT
garciay's avatar
garciay committed
             *  }
             *  ensure that {
             *      when { 
             *          the IUT is receiving a SecuredMessage
garciay's avatar
garciay committed
             *              containing header_fields ['signer_info'].signer.certificate (CERT_TS_11_03_BO_AT)
             *                  containing signer_info.digest
             *                      referencing to CERT_TS_A_AA
             *                          containing validity_restrictions['time_start_and_end']
             *                              containing start_validity
             *                                  indicating START_VALIDITY_AA - 365d
             *                              and containing end_validity
             *                                  indicating END_VALIDITY_AA - 1d
             *              and containing validity_restrictions['time_start_and_end'] 
             *                  containing start_validity
             *                      indicating START_VALIDITY_AA - 365d
             *                  and containing end_validity
             *                      indicating END_VALIDITY_AA
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_CERT_11_03_BO
garciay's avatar
garciay committed
             * @reference    ETSI TS 103 097 [1], clause 7.4.1
garciay's avatar
garciay committed
             */
garciay's avatar
garciay committed
            testcase TC_SEC_ITSS_RCV_CERT_11_03_BO() runs on ItsGeoNetworking system ItsSecSystem {
garciay's avatar
garciay committed
                
                // Local variables
                var integer i;
                var GeoNetworkingPdu v_securedGnPdu;
                var GnRawPayload v_sentRawPayload;
                
                // Test adapter configuration
                if (not(PICS_GN_SECURITY)) {
                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
                    stop;
                }
                
garciay's avatar
garciay committed
                // Test component configuration
garciay's avatar
garciay committed
                f_cf01Up();
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
garciay's avatar
garciay committed
                v_securedGnPdu := f_sendSecuredCam(cc_taCert1103_BO, omit, e_certificate);
garciay's avatar
garciay committed
                
                f_sleep(PX_TNOAC);
                v_sentRawPayload := f_adaptPayloadForUtInd_m(v_securedGnPdu.gnPacket.packet.payload);
                for (i := 0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, v_sentRawPayload); i := i + 1) {
                    // empty on purpose 
                }
                if (i < lengthof(vc_utInds)) {
                    log("*** " & testcasename() & ": FAIL: GN was transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                }
                else {
                    log("*** " & testcasename() & ": PASS: GN was not transmitted to upper layer ***");