ItsSecurity_TestCases.ttcn 1.6 MB
Newer Older
                
                // Test control
                if (not(PICS_GN_SECURITY)) {
                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
                    stop;
                }
                
                // Test component configuration
                f_cf01Up(); // Initialise IUT with CERT_IUT_A_AT signed with CERT_IUT_A_AA
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
                tc_ac.start;
                alt {
                    [] geoNetworkingPort.receive(
                        mw_geoNwInd(
                            mw_geoNwSecPdu(
                                mw_etsiTs103097Data_signed(
                                    mw_signedData(
                                        -, 
                                        mw_toBeSignedData(
                                            mw_signedDataPayload(
                                                mw_ieee1609Dot2Data(
                                                    mw_ieee1609Dot2Data_unsecured
                                            )),
                                            mw_headerInfo_cam
                                        )
                                    )
                                )
                    ))) {
                        tc_ac.stop;
                        log("*** " & testcasename() & ": PASS: CAM received with a well formated payload ***");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    }
                    [] tc_ac.timeout {
                        log("*** " & testcasename() & ": INCONC: Expected CA message not received ***");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
                    }
                } // End of 'alt' statement
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
            } // End of testcase TC_SEC_ITSS_SND_CAM_19_BV
            
            /**
             * @desc    Check that the IUT sends the secured CAM signed with the certificate containing appPermisions 
             *          allowing to sign CA messages
             * <pre>
             * Pics Selection: PICS_GN_SECURITY
             * Config Id: CF01
             * Initial conditions:
             *  with {
             *      the IUT is authorized with AT certificate (CERT_IUT_A_AT) 
             *  }
             *  ensure that {
             *      when {
             *          the IUT is requested to send a secured CAM
             *      } then {
             *          the IUT sends a message of type EtsiTs103097Data
             *              containing signer
             *                 containing certificate
             *                     containing appPermissions
             *                         containing an item of type PsidSsp
             *                             containing psid = AID_CAM 
             *      }
             *  }
             * </pre>
             *
             * @see          ETSI TS 103 096-2 v1.3.2 TP_SEC_ITSS_SND_CAM_20_BV
             * @reference    ETSI TS 103 097 [1] Clauses 7.2.1
             * @reference    IEEE 1609.2 [2], Clauses 5.2.3.2.2
             */
            testcase TC_SEC_ITSS_SND_CAM_20_BV() runs on ItsGeoNetworking system ItsSecSystem {
                // Local variables
                
                // Test control
                if (not(PICS_GN_SECURITY)) {
                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
                    stop;
                }
                
                // Test component configuration
                f_cf01Up(); // Initialise IUT with CERT_IUT_A_AT signed with CERT_IUT_A_AA
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
                tc_ac.start;
                alt {
                    [] geoNetworkingPort.receive(
                        mw_geoNwInd(
                            mw_geoNwSecPdu(
                                mw_etsiTs103097Data_signed(
                                    mw_signedData(
                                        mw_toBeSignedData(
                                            mw_signedDataPayload,
                                            mw_headerInfo_cam
                                        ),
                                        mw_signerIdentifier_certificate( // containing certificate
                                            mw_etsiTs103097Certificate(
                                                -,
                                                mw_toBeSignedCertificate_at(
Yann Garcia's avatar
Yann Garcia committed
                                                                            { *, mw_appPermissions(c_its_aid_CAM), * }
                    ))) {
                        tc_ac.stop;
                        log("*** " & testcasename() & ": PASS: CAM received with a well formated certificate ***");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    }
                    [] geoNetworkingPort.receive(
                        mw_geoNwInd(
                            mw_geoNwSecPdu(
                                mw_etsiTs103097Data_signed(
                                    mw_signedData(
                                        -, 
                                        mw_toBeSignedData(
                                            mw_signedDataPayload,
                                            mw_headerInfo_cam
                                        ),
                                        mw_signerIdentifier_digest
                                    )
                                )
                    ))) {
                        log("*** " & testcasename() & ": INFO: CA message with digest was received ***");
                    }
                    [] tc_ac.timeout {
                        log("*** " & testcasename() & ": INCONC: Initial conditions: CA message with certificate not received ***");
Yann Garcia's avatar
Yann Garcia committed
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
                    }
                    
                } // End of 'alt' statement
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
            } // End of testcase TC_SEC_ITSS_SND_CAM_20_BV
            
            /**
             * @desc    Check that IUT sends the secured CAM containing signature;
             *          Check that the signature is calculated over the right fields 
             *          and using right hash algorythm by cryptographically verifying the signature
             * <pre>
             * Pics Selection: PICS_GN_SECURITY
             * Config Id: CF01
             * Initial conditions:
             *  with {
             *      the IUT is authorized with AT certificate (X_CERTIFICATE) 
             *  }
             *  ensure that {
             *      when {
             *          the IUT is requested to send a secured CAM
             *      } then {
             *          the IUT sends a message of type EtsiTs103097Data
             *              containing signedData
             *                  containing signer
             *                       containing digest
             *                           referencing the certificate X_CERTIFICATE
             *                       or containing certificate
             *                           indicating X_CERTIFICATE
             *                  and containing signature
             *                      containing X_SIGNATURE
             *                          verifiable using KEY 
             *      }
             *  }
             * </pre>
             *
             * @see          ETSI TS 103 096-2 v1.3.2 TP_SEC_ITSS_SND_CAM_21_BV
             * @reference    ETSI TS 103 097 [1] Clauses 5.2 & 7.1.1
             * @reference    IEEE 1609.2 [2], Clauses 5.3.1, 6.3.4, 6.3.29, 6.3.30, 6.3.31

             */
            testcase TC_SEC_ITSS_SND_CAM_21_BV() runs on ItsGeoNetworking system ItsSecSystem {
                // Local variables
                var EtsiTs103097Certificate v_certificate;
                var Signature               v_signature;
                var GeoNetworkingInd        v_geoNwInd;
                
                // Test control
                if (not(PICS_GN_SECURITY)) {
                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
                    stop;
                }
                
                // Test component configuration
                vc_hashedId8ToBeUsed := PICS_CERTFICATE_ID_VARIANT;
                f_cf01Up();
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                f_readCertificate(vc_hashedId8ToBeUsed, v_certificate);
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
                tc_ac.start;
                alt {
                    [] geoNetworkingPort.receive(
                        mw_geoNwInd(
                            mw_geoNwSecPdu(
                                mw_etsiTs103097Data_signed(
                                    mw_signedData(
                                        PICS_CERTFICATES_FOI[PICS_CERTFICATES_VAR].hashAlgorithm, 
                                        mw_toBeSignedData(
                                            mw_signedDataPayload,
                                            mw_headerInfo_cam
                                        ),
                                        mw_signerIdentifier_digest( // containing digest referencing the certificate X_CERTIFICATE
                                            PICS_CERTFICATES_FOI[PICS_CERTFICATES_VAR].issuer
                                        )
                                    )
                                ), 
                                mw_geoNwShbPacket
                    ))) -> value v_geoNwInd {
                        tc_ac.stop;
                        log("*** " & testcasename() & ": INFO: CA message with digest received ***");
                    }
                    [] geoNetworkingPort.receive(
                        mw_geoNwInd(
                            mw_geoNwSecPdu(
                                mw_etsiTs103097Data_signed(
                                    mw_signedData(
                                        PICS_CERTFICATES_FOI[PICS_CERTFICATES_VAR].hashAlgorithm, 
                                        mw_toBeSignedData(
                                            mw_signedDataPayload,
                                            mw_headerInfo_cam
                                        ),
                                        mw_signerIdentifier_certificate( // or containing containing certificate indicating X_CERTIFICATE
                                            v_certificate
                                        )
                                    )
                                ), 
                                mw_geoNwShbPacket
                    ))) -> value v_geoNwInd {
                        tc_ac.stop;
                        log("*** " & testcasename() & ": INFO: CA message with certificate received ***");
                    }
                    [] tc_ac.timeout {
                        log("*** " & testcasename() & ": INCONC: Initial conditions: CA message with certificate not received ***");
Yann Garcia's avatar
Yann Garcia committed
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
                    }
                } // End of 'alt' statement
                // Check that the signature is calculated over the right fields and using right hash algorythm by cryptographically verifying the signature
Yann Garcia's avatar
Yann Garcia committed
                if (f_verifyGnSecuredMessageSignatureWithCertificate(f_getSecuredMessage(v_geoNwInd.msgIn), vc_hashedId8ToBeUsed, v_certificate)) {
                    log("*** " & testcasename() & ": PASS: Signature verified successfully ***");
Yann Garcia's avatar
Yann Garcia committed
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                } else {
                    log("*** " & testcasename() & ": FAIL: Signature not verified successfully ***");
Yann Garcia's avatar
Yann Garcia committed
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                }
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
            } // End of testcase TC_SEC_ITSS_SND_CAM_21_BV
            
            /**
             * @desc    Check that IUT sends the secured CAM containing  signature containing the ECC point of type set to 
             *          either compressed_lsb_y_0, compressed_lsb_y_1 or x_coordinate_only.
             * <pre>
             * Pics Selection: PICS_GN_SECURITY
             * Config Id: CF01
             * Initial conditions:
             *  with {
             *      the IUT is authorized with AT certificate (X_CERTIFICATE) 
             *  }
             *  ensure that {
             *      when {
             *          the IUT is requested to send a secured CAM
             *      } then {
             *          the IUT sends a message of type EtsiTs103097Data
             *              containing signedData
             *                  containing signature
             *                      containing one of the ecdsaNistP256Signature
             *                      or containing ecdsaBrainpoolP256r1Signature
             *                      or containing ecdsaBrainpoolP384r1Signature
             *                          containing rSig
             *                              containing x-only 
             *                              or containing compressed-y-0
             *                              or containing compressed-y-1
             *      }
             *  }
             * </pre>
             *
             * @see          ETSI TS 103 096-2 v1.3.2 TP_SEC_ITSS_SND_CAM_22_BV
             * @reference    ETSI TS 103 097 [1] Clauses 5.2 & 7.1.1
             * @reference    IEEE 1609.2 [2], Clauses 6.3.30, 6.3.31
             */
            testcase TC_SEC_ITSS_SND_CAM_22_BV() runs on ItsGeoNetworking system ItsSecSystem {
                // Local variables
                var GeoNetworkingInd        v_geoNwInd;
                
                // Test control
                if (not(PICS_GN_SECURITY)) {
                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
                    stop;
                }
                
                // Test component configuration
                f_cf01Up(); // Initialise IUT with CERT_IUT_A_AT signed with CERT_IUT_A_AA
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
                tc_ac.start;
                alt {
                    [PICS_SEC_NIST_P256 == true] geoNetworkingPort.receive(
                        mw_geoNwInd(
                            mw_geoNwSecPdu(
                                mw_etsiTs103097Data_signed(
                                    mw_signedData(
                                        -, 
                                        mw_toBeSignedData(
                                            mw_signedDataPayload,
                                            mw_headerInfo_cam
                                        ),
                                        -,
                                        mw_signature_ecdsaNistP256(
                                            mw_ecdsaP256Signature(
                                                mw_eccP256CurvePoint_x_only
                                            )
                                        )
                                    )
                                ), 
                                mw_geoNwShbPacket
                    ))) -> value v_geoNwInd {
                        tc_ac.stop;
                        log("*** " & testcasename() & ": PASS: CA message with well-formated signature received ***");
Yann Garcia's avatar
Yann Garcia committed
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    [PICS_SEC_NIST_P256 == true] geoNetworkingPort.receive(
                        mw_geoNwInd(
                            mw_geoNwSecPdu(
                                mw_etsiTs103097Data_signed(
                                    mw_signedData(
                                        -, 
                                        mw_toBeSignedData(
                                            mw_signedDataPayload,
                                            mw_headerInfo_cam
                                        ),
                                        -,
                                        mw_signature_ecdsaNistP256(
                                            mw_ecdsaP256Signature(
                                                mw_eccP256CurvePoint_compressed_y_0
                                            )
                                        )
                                    )
                                ), 
                                mw_geoNwShbPacket
                    ))) -> value v_geoNwInd {
                        tc_ac.stop;
                        log("*** " & testcasename() & ": PASS: CA message with well-formated signature received ***");
Yann Garcia's avatar
Yann Garcia committed
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    [PICS_SEC_NIST_P256 == true] geoNetworkingPort.receive(
                        mw_geoNwInd(
                            mw_geoNwSecPdu(
                                mw_etsiTs103097Data_signed(
                                    mw_signedData(
                                        -, 
                                        mw_toBeSignedData(
                                            mw_signedDataPayload,
                                            mw_headerInfo_cam
                                        ),
                                        -,
                                        mw_signature_ecdsaNistP256(
                                            mw_ecdsaP256Signature(
                                                mw_eccP256CurvePoint_compressed_y_1
                                            )
                                        )
                                    )
                                ), 
                                mw_geoNwShbPacket
                    ))) -> value v_geoNwInd {
                        tc_ac.stop;
                        log("*** " & testcasename() & ": PASS: CA message with well-formated signature received ***");
Yann Garcia's avatar
Yann Garcia committed
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    [PICS_SEC_BRAINPOOL_P256R1 == true] geoNetworkingPort.receive(
                        mw_geoNwInd(
                            mw_geoNwSecPdu(
                                mw_etsiTs103097Data_signed(
                                    mw_signedData(
                                        -, 
                                        mw_toBeSignedData(
                                            mw_signedDataPayload,
                                            mw_headerInfo_cam
                                        ),
                                        -,
                                        mw_signature_ecdsaBrainpoolP256r1(
                                            mw_ecdsaP256Signature(
                                                mw_eccP256CurvePoint_x_only
                                            )
                                        )
                                    )
                                ), 
                                mw_geoNwShbPacket
                    ))) -> value v_geoNwInd {
                        tc_ac.stop;
                        log("*** " & testcasename() & ": PASS: CA message with well-formated signature received ***");
Yann Garcia's avatar
Yann Garcia committed
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    [PICS_SEC_BRAINPOOL_P256R1 == true] geoNetworkingPort.receive(
                        mw_geoNwInd(
                            mw_geoNwSecPdu(
                                mw_etsiTs103097Data_signed(
                                    mw_signedData(
                                        -, 
                                        mw_toBeSignedData(
                                            mw_signedDataPayload,
                                            mw_headerInfo_cam
                                        ),
                                        -,
                                        mw_signature_ecdsaBrainpoolP256r1(
                                            mw_ecdsaP256Signature(
                                                mw_eccP256CurvePoint_compressed_y_0
                                            )
                                        )
                                    )
                                ), 
                                mw_geoNwShbPacket
                    ))) -> value v_geoNwInd {
                        tc_ac.stop;
                        log("*** " & testcasename() & ": PASS: CA message with well-formated signature received ***");
Yann Garcia's avatar
Yann Garcia committed
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    [PICS_SEC_BRAINPOOL_P256R1 == true] geoNetworkingPort.receive(
                        mw_geoNwInd(
                            mw_geoNwSecPdu(
                                mw_etsiTs103097Data_signed(
                                    mw_signedData(
                                        -, 
                                        mw_toBeSignedData(
                                            mw_signedDataPayload,
                                            mw_headerInfo_cam
                                        ),
                                        -,
                                        mw_signature_ecdsaBrainpoolP256r1(
                                            mw_ecdsaP256Signature(
                                                mw_eccP256CurvePoint_compressed_y_1
                                            )
                                        )
                                    )
                                ), 
                                mw_geoNwShbPacket
                    ))) -> value v_geoNwInd {
                        tc_ac.stop;
                        log("*** " & testcasename() & ": PASS: CA message with well-formated signature received ***");
Yann Garcia's avatar
Yann Garcia committed
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    [PICS_SEC_BRAINPOOL_P384R1 == true] geoNetworkingPort.receive(
                        mw_geoNwInd(
                            mw_geoNwSecPdu(
                                mw_etsiTs103097Data_signed(
                                    mw_signedData(
                                        -, 
                                        mw_toBeSignedData(
                                            mw_signedDataPayload,
                                            mw_headerInfo_cam
                                        ),
                                        -,
                                        mw_signature_ecdsaBrainpoolP384r1(
                                            mw_ecdsaP384Signature(
                                                mw_eccP384CurvePoint_x_only
                                            )
                                        )
                                    )
                                ), 
                                mw_geoNwShbPacket
                    ))) -> value v_geoNwInd {
                        tc_ac.stop;
                        log("*** " & testcasename() & ": PASS: CA message with well-formated signature received ***");
Yann Garcia's avatar
Yann Garcia committed
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    [PICS_SEC_BRAINPOOL_P384R1 == true] geoNetworkingPort.receive(
                        mw_geoNwInd(
                            mw_geoNwSecPdu(
                                mw_etsiTs103097Data_signed(
                                    mw_signedData(
                                        -, 
                                        mw_toBeSignedData(
                                            mw_signedDataPayload,
                                            mw_headerInfo_cam
                                        ),
                                        -,
                                        mw_signature_ecdsaBrainpoolP384r1(
                                            mw_ecdsaP384Signature(
                                                mw_eccP384CurvePoint_compressed_y_0
                                            )
                                        )
                                    )
                                ), 
                                mw_geoNwShbPacket
                    ))) -> value v_geoNwInd {
                        tc_ac.stop;
                        log("*** " & testcasename() & ": PASS: CA message with well-formated signature received ***");
Yann Garcia's avatar
Yann Garcia committed
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    [PICS_SEC_BRAINPOOL_P384R1 == true] geoNetworkingPort.receive(
                        mw_geoNwInd(
                            mw_geoNwSecPdu(
                                mw_etsiTs103097Data_signed(
                                    mw_signedData(
                                        -, 
                                        mw_toBeSignedData(
                                            mw_signedDataPayload,
                                            mw_headerInfo_cam
                                        ),
                                        -,
                                        mw_signature_ecdsaBrainpoolP384r1(
                                            mw_ecdsaP384Signature(
                                                mw_eccP384CurvePoint_compressed_y_1
                                            )
                                        )
                                    )
                                ), 
                                mw_geoNwShbPacket
                    ))) -> value v_geoNwInd {
                        tc_ac.stop;
                        log("*** " & testcasename() & ": PASS: CA message with well-formated signature received ***");
Yann Garcia's avatar
Yann Garcia committed
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    }
                    [] geoNetworkingPort.receive(
                        mw_geoNwInd(
                            mw_geoNwSecPdu(
                                mw_etsiTs103097Data_signed(
                                    mw_signedData(
                                        -, 
                                        mw_toBeSignedData(
                                            mw_signedDataPayload,
                                            mw_headerInfo_cam
                                        )
                                    )
                                ), 
                                mw_geoNwShbPacket
                    ))) -> value v_geoNwInd {
                        tc_ac.stop;
                        log("*** " & testcasename() & ": FAIL: CA message with wrong signature received ***");
Yann Garcia's avatar
Yann Garcia committed
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                    }
                    [] tc_ac.timeout {
                        log("*** " & testcasename() & ": INCONC: Initial conditions: CA message with certificate not received ***");
Yann Garcia's avatar
Yann Garcia committed
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
                    }
                } // End of 'alt' statement
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
            } // End of testcase TC_SEC_ITSS_SND_CAM_22_BV
            
            /**
             * @desc    Check that IUT doesn't send secured CAMs if IUT is authorized with AT certificate doesn't allowing 
             *          sending messages in this location. 
             * <pre>
             * Pics Selection: PICS_GN_SECURITY
             * Config Id: CF01
             * Initial conditions:
             *  with {
             *     the IUT is authorized with AT certificate (CERT_IUT_C1_AT)
             *         containing region
             *             indicating rectangular region
             *                 not containing current IUT position
             *         and the IUT has no other installed AT certificates
             * }
             * ensure that {
             *     when {
             *         the IUT is requested to send a secured CAM
             *     } then {
             *         the IUT doesn't send CAM
             *     }
             * }
             * </pre>
             *
             * @see          ETSI TS 103 096-2 v1.3.2 TP_SEC_ITSS_SND_CAM_23_BV
             * @reference    IEEE 1609.2 [2], Clauses 5.2.3.2.2
             */
            testcase TC_SEC_ITSS_SND_CAM_23_BV() runs on ItsGeoNetworking system ItsSecSystem {
                
                // Local variables
                
                // Test control
                if (not(PICS_GN_SECURITY)) {
                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
                    stop;
                }
                
                // Test component configuration
                vc_hashedId8ToBeUsed := PICS_CERTFICATE_ID_VARIANT;
                f_cf01Up(); // Initialise IUT with CERT_IUT_C1_AT
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
                tc_noac.start;
                alt {
                    [] geoNetworkingPort.receive(
                        mw_geoNwInd(
                            mw_geoNwSecPdu(
garciay's avatar
garciay committed
                                mw_etsiTs103097Data_signed(
                                    mw_signedData(
                                        -, 
                                        mw_toBeSignedData(
                                            mw_signedDataPayload,
                                            mw_headerInfo_cam
                                        )
                                    )
                                )
                    ))) {
                        tc_noac.stop;
                        log("*** " & testcasename() & ": FAIL: that IUT shall not send secured CAMs");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                    }
                    [] tc_noac.timeout {
                        log("*** " & testcasename() & ": PASS: No CAM received ***");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    } 
                } // End of 'alt' statement
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
            } // End of testcase TC_SEC_ITSS_SND_CAM_23_BV
            
            /**
             * @desc    Check that IUT doesn't send the secured CAM if IUT is configured to use an AT certificate without 
             *          region validity restriction and generation location is outside of the region of the issuing AA certificate.
             * <pre>
             * Pics Selection: PICS_GN_SECURITY
             * Config Id: CF01
             * Initial conditions:
             *  with {
             *     the IUT is authorized with AT certificate (CERT_IUT_CA3_AT)
             *         not containing region
             *         and issued by the AA certificate (CERT_IUT_C3_AA)
             *             containing region
             *                 indicating rectangular region
             *                     not containing current IUT position
             * }
             * ensure that {
             *     when {
             *         the IUT is requested to send a secured CAM
             *     } then {
             *         the IUT doesn't send CAM
             *     }
             * }
             * </pre>
             *
             * @see          ETSI TS 103 096-2 v1.3.2 TP_SEC_ITSS_SND_CAM_24_BV
             * @reference    IEEE 1609.2 [2], Clauses 5.2.3.2.2
             */
            testcase TC_SEC_ITSS_SND_CAM_24_BV() runs on ItsGeoNetworking system ItsSecSystem {
                
                // Local variables
                
                // Test control
                if (not(PICS_GN_SECURITY)) {
                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
                    stop;
                }
                
                
                // Test component configuration
                vc_hashedId8ToBeUsed := PICS_CERTFICATE_ID_VARIANT;
                f_cf01Up(); // Initialise IUT with CERT_IUT_CA3_AT
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
                tc_noac.start;
                alt {
                    [] geoNetworkingPort.receive(
                        mw_geoNwInd(
                            mw_geoNwSecPdu(
garciay's avatar
garciay committed
                                mw_etsiTs103097Data_signed(
                                    mw_signedData(
                                        -, 
                                        mw_toBeSignedData(
                                            mw_signedDataPayload,
                                            mw_headerInfo_cam
                                        )
                                    )
                                )
                    ))) {
                        tc_noac.stop;
                        log("*** " & testcasename() & ": FAIL: that IUT shall not send secured CAMs");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                    }
                    [] tc_noac.timeout {
                        log("*** " & testcasename() & ": PASS: No CAM received ***");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    } 
                } // End of 'alt' statement
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
            } // End of testcase TC_SEC_ITSS_SND_CAM_24_BV
            
            /**
             * @desc    Check that IUT doesn't send secured CAMs if all AT certificates installed on the IUT was expired.
             * <pre>
             * Pics Selection: PICS_GN_SECURITY
             * Config Id: CF01
             * Initial conditions:
             *  with {
             *     the IUT is authorized with AT certificate (CERT_IUT_CA3_AT)
             *         containing validityPeriod
             *             indicating start + duration < CURRENT_TIME
             *         and the IUT has no other installed AT certificates
             * }
             * ensure that {
             *     when {
             *         the IUT is requested to send a secured CAM
             *     } then {
             *         the IUT doesn't send CAM
             *     }
             * }
             * </pre>
             *
             * @see          ETSI TS 103 096-2 v1.3.2 TP_SEC_ITSS_SND_CAM_25_BV
             * @reference    IEEE 1609.2 [2], Clauses 5.2.3.2.2
             */
            testcase TC_SEC_ITSS_SND_CAM_25_BV() runs on ItsGeoNetworking system ItsSecSystem {
                
                // Local variables
                
                // Test control
                if (not(PICS_GN_SECURITY)) {
                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
                    stop;
                }
                
                
                // Test component configuration
                vc_hashedId8ToBeUsed := PICS_CERTFICATE_ID_VARIANT;
                f_cf01Up(); // Initialise IUT with CERT_IUT_CA3_AT
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
                tc_noac.start;
                alt {
                    [] geoNetworkingPort.receive(
                        mw_geoNwInd(
                            mw_geoNwSecPdu(
garciay's avatar
garciay committed
                                mw_etsiTs103097Data_signed(
                                    mw_signedData(
                                        -, 
                                        mw_toBeSignedData(
                                            mw_signedDataPayload,
                                            mw_headerInfo_cam
                                        )
                                    )
                                )
                    ))) {
                        tc_noac.stop;
                        log("*** " & testcasename() & ": FAIL: that IUT shall not send secured CAMs");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                    }
                    [] tc_noac.timeout {
                        log("*** " & testcasename() & ": PASS: No CAM received ***");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    } 
                } // End of 'alt' statement
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
            } // End of testcase TC_SEC_ITSS_SND_CAM_25_BV
            
            /**
             * @desc    Check that IUT doesn't send secured CAMs if all AT certificates installed on the IUT have the starting time in the future. 
             * <pre>
             * Pics Selection: PICS_GN_SECURITY
             * Config Id: CF01
             * Initial conditions:
             *  with {
             *     the IUT is authorized with AT certificate (CERT_IUT_A2_AT)
             *         containing validityPeriod
             *             indicating start > CURRENT_TIME
             *         and the IUT has no other installed AT certificates
             * }
             * ensure that {
             *     when {
             *         the IUT is requested to send a secured CAM
             *     } then {
             *         the IUT doesn't send CAM
             *     }
             * }
             * </pre>
             *
             * @see          ETSI TS 103 096-2 v1.3.2 TP_SEC_ITSS_SND_CAM_26_BV
             * @reference    IEEE 1609.2 [2], Clauses 5.2.3.2.2
             */
            testcase TC_SEC_ITSS_SND_CAM_26_BV() runs on ItsGeoNetworking system ItsSecSystem {
                
                // Local variables
                
                // Test control
                if (not(PICS_GN_SECURITY)) {
                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
                    stop;
                }
                
                
                // Test component configuration
                vc_hashedId8ToBeUsed := PICS_CERTFICATE_ID_VARIANT;
                f_cf01Up(); // Initialise IUT with CERT_IUT_A2_AT
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
                tc_noac.start;
                alt {
                    [] geoNetworkingPort.receive(
                        mw_geoNwInd(
                            mw_geoNwSecPdu(
garciay's avatar
garciay committed
                                mw_etsiTs103097Data_signed(
                                    mw_signedData(
                                        -, 
                                        mw_toBeSignedData(
                                            mw_signedDataPayload,
                                            mw_headerInfo_cam
                                        )
                                    )
                                )
                    ))) {
                        tc_noac.stop;
                        log("*** " & testcasename() & ": FAIL: that IUT shall not send secured CAMs");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                    }
                    [] tc_noac.timeout {
                        log("*** " & testcasename() & ": PASS: No CAM received ***");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    } 
                } // End of 'alt' statement
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
            } // End of testcase TC_SEC_ITSS_SND_CAM_26_BV
            
            /**
             * @desc    Check that IUT doesn't send secured CAMs if IUT doesn't possess an AT certificate allowing 
garciay's avatar
garciay committed
             *          sending CAM by its appPermissions. 
             * <pre>
             * Pics Selection: PICS_GN_SECURITY
             * Config Id: CF01
             * Initial conditions:
             *  with {
             *     the IUT is authorized with AT certificate (CERT_IUT_A3_AT)
             *         containing appPermissions
             *             not containing PsidSSP
             *                 containing psid
             *                     indicating AID_CAM
             *         and the IUT has no other installed AT certificates
             * }
             * ensure that {
             *     when {
             *         the IUT is requested to send a secured CAM
             *     } then {
             *         the IUT doesn't send CAM
             *     }
             * }
             * </pre>
             *
             * @see          ETSI TS 103 096-2 v1.3.2 TP_SEC_ITSS_SND_CAM_27_BV
             * @reference    IEEE 1609.2 [2], Clauses 5.2.3.2.2
             */
            testcase TC_SEC_ITSS_SND_CAM_27_BV() runs on ItsGeoNetworking system ItsSecSystem {
                
                // Local variables
                
                // Test control
                if (not(PICS_GN_SECURITY)) {
                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
                    stop;
                }
                
                
                // Test component configuration
                vc_hashedId8ToBeUsed := PICS_CERTFICATE_ID_VARIANT;
                f_cf01Up(); // Initialise IUT with CERT_IUT_A3_AT
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
                tc_noac.start;
                alt {
                    [] geoNetworkingPort.receive(
                        mw_geoNwInd(
                            mw_geoNwSecPdu(
garciay's avatar
garciay committed
                                mw_etsiTs103097Data_signed(
                                    mw_signedData(
                                        -, 
                                        mw_toBeSignedData(
                                            mw_signedDataPayload,
                                            mw_headerInfo_cam
                                        )
                                    )
                                )
                    ))) {
                        tc_noac.stop;
                        log("*** " & testcasename() & ": FAIL: that IUT shall not send secured CAMs");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                    }
                    [] tc_noac.timeout {
                        log("*** " & testcasename() & ": PASS: No CAM received ***");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    } 
                } // End of 'alt' statement
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
            } // End of testcase TC_SEC_ITSS_SND_CAM_27_BV
        } // End of group camProfile
         * @desc Sending behaviour test cases for DENM profile
garciay's avatar
garciay committed
         * @see ETSI TS 103 096-2 V1.3.32 (2018-01) Clause 5.2.5 DENM profile
        group denmProfile {
garciay's avatar
garciay committed
            
            /**
             * @desc    Check that secured DENM is signed 
             * <pre>
             * Pics Selection: PICS_GN_SECURITY
             * Config Id: CF01
             * Initial conditions:
             *  with {
             *     the IUT is authorized with AT certificate (CERT_IUT_A_AT) 
             * }
             * ensure that {
             *     when {
             *         the IUT is requested to send a secured DENM
             *     } then {
             *         the IUT sends a message of type EtsiTs103097Data
             *             containing content
             *                 containing signedData
             *     }
             * }
             * </pre>
             *
             * @see          ETSI TS 103 096-2 v1.3.2 TP_SEC_ITSS_SND_DENM_01_BV
             * @reference    ETSI TS 103 097 [1] Clause 7.1.2
garciay's avatar
garciay committed
             */
            testcase TC_SEC_ITSS_SND_DENM_01_BV() runs on ItsGeoNetworking system ItsSecSystem {
                
                // Local variables
                var ItsDenm v_denmComponent;
                
                // Test control
                if (not(PICS_GN_SECURITY)) {
                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
                    stop;
                }