ItsSecurity_TestCases.ttcn3 1.27 MB
Newer Older
garciay's avatar
garciay committed
             *                          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.1
             */
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.1
             */
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.1
             */
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.1
             */
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.1
             */
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.1
             */
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 ***");
                    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_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 is 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_04_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_04_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 + 365d
             *              and containing validity_restrictions['time_start_and_end'] 
             *                  containing start_validity
             *                      indicating START_VALIDITY_AA
             *                  and containing end_validity
             *                      indicating END_VALIDITY_AA + 365d
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_04_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_CERT_11_04_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_taCert1104_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_04_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 SSP-AID subject attribute
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 location is inside the CERT_TS_12_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_12_01_BO_AT)
             *                  not containing subject_attributes['its_aid_ssp_list']
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_12_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_CERT_12_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_taCert1201_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_12_01_BO
garciay's avatar
garciay committed
            
            /**
garciay's avatar
garciay committed
             * @desc    Check that the IUT discards a Secured CAM when its signing certificate does not contain a record with AID_CAM in the its_aid_ssp_list subject attribute 
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_12_02_BO_AT
garciay's avatar
garciay committed
             *  }
             *  ensure that {
             *      when { 
garciay's avatar
garciay committed
             *          the IUT is receiving a Secured CAM (MSG_SEC_RCV_CAM_01)
             *              containing header_fields ['its_aid']
             *                      containing its_aid
             *                          indicating 'AID_CAM'
             *              and containing header_fields ['signer_info']
             *                  containing signer
             *                      containing certificate 
             *                          indicating CERT_TS_12_02_BO_AT
             *                              containing subject_attributes['its_aid_ssp_list']
             *                                  not containing an item
             *                                      containing its_aid
             *                                          indicating 'AID_CAM'
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_12_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_CERT_12_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_taCert1202_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_12_02_BO
garciay's avatar
garciay committed
            
            /**
garciay's avatar
garciay committed
             * @desc    Check that the IUT discards a Secured DENM when its signing certificate does not contain a record with AID_DENM in the its_aid_ssp_list subject attribute
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 location is inside the CERT_TS_12_03_BO_AT
garciay's avatar
garciay committed
             *  }
             *  ensure that {
             *      when { 
garciay's avatar
garciay committed
             *          the IUT is receiving a Secured DENM (MSG_SEC_RCV_DENM_A)
             *              containing header_fields ['its_aid']
             *                      containing its_aid
             *                          indicating 'AID_DENM'
             *              and containing header_fields ['signer_info']
             *                  containing signer
             *                      containing certificate 
             *                          indicating CERT_TS_12_03_BO_AT
             *                              containing subject_attributes['its_aid_ssp_list']
             *                                  not containing an item
             *                                      containing its_aid
             *                                          indicating 'AID_DENM'
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_12_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_CERT_12_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_sendSecuredDenm(cc_taCert1203_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_12_03_BO
garciay's avatar
garciay committed
            
            /**
garciay's avatar
garciay committed
             * @desc    Check that the IUT discards a Secured CAM when its signing certificate contains two records with AID_CAM in the its_aid_ssp_list subject attribute
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_12_04_BO_AT
garciay's avatar
garciay committed
             *  }
             *  ensure that {
             *      when { 
garciay's avatar
garciay committed
             *          the IUT is receiving a Secured CAM (MSG_SEC_RCV_CAM_01)
             *              containing header_fields ['its_aid']
             *                      containing its_aid
             *                          indicating 'AID_CAM'
             *              and containing header_fields ['signer_info']
             *                  containing signer
             *                      containing certificate 
             *                          indicating CERT_TS_12_04_BO_AT
             *                              containing subject_attributes['its_aid_ssp_list']
             *                                  containing item [0].its_aid
             *                                      indicating 'AID_CAM'
             *                                  and containing item [1].its_aid
             *                                      indicating 'AID_CAM'
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_12_04_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_CERT_12_04_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_taCert1204_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_12_04_BO
garciay's avatar
garciay committed
            /**
garciay's avatar
garciay committed
             * @desc    Check that the IUT discards a message when the signing AT certificate contains a CAM AID-SSP record whereas the issuing AA certificate does not contain the record with AID_CAM
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_13_01_BO_AT
garciay's avatar
garciay committed
             *  }
             *  ensure that {
             *      when { 
garciay's avatar
garciay committed
             *          the IUT is receiving a Secured CAM (MSG_SEC_RCV_CAM_01)
             *              containing header_fields ['signer_info'].signer.certificate (CERT_TS_13_01_BO_AT)
             *                  containing signer_info.digest
             *                      referencing to CERT_TS_13_01_BO_AA
             *                          containing validity_restrictions['its_aid_list']
             *                              not containing 'AID_CAM'
             *              and containing validity_restrictions['its_aid_ssp_list']
             *                  containing a record
             *                      containing its_aid
             *                          indicating 'AID_CAM'
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_13_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_CERT_13_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_taCert1301_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_13_01_BO
garciay's avatar
garciay committed
            
            /**
garciay's avatar
garciay committed
             * @desc    Check that the IUT discards a message when the signing AT certificate contains a DENM AID-SSP record whereas the issuing AA certificate does not contain the AID record with AID_DENM 
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_13_02_BO_AT
garciay's avatar
garciay committed
             *  }
             *  ensure that {
             *      when { 
garciay's avatar
garciay committed
             *          the IUT is receiving a Secured DENM (MSG_SEC_RCV_DENM_A)
             *              containing header_fields ['signer_info'].signer.certificate (CERT_TS_13_02_BO_AT)
             *                  containing signer_info.digest
             *                      referencing to CERT_TS_13_02_BO_AA
             *                          containing validity_restrictions['its_aid_list']
             *                              not containing 'AID_DENM'
             *              and containing validity_restrictions['its_aid_ssp_list']
             *                  containing a record
             *                      containing its_aid
             *                          indicating 'AID_DENM'
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_13_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_CERT_13_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_sendSecuredDenm(cc_taCert1302_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_13_02_BO
garciay's avatar
garciay committed
            
garciay's avatar
garciay committed
        } // End of group recvCertificatesProfile
garciay's avatar
garciay committed
    } // End of group receiverbehavior
    
} // End of module ItsSecurity_TestCase