Commit d9b07082 authored by garciay's avatar garciay
Browse files

Separate TC_SEC_ITSS_SND_CAM_11_BV: TC_SEC_ITSS_SND_CAM_11_01_BV for...

Separate TC_SEC_ITSS_SND_CAM_11_BV: TC_SEC_ITSS_SND_CAM_11_01_BV for PICS_SEC_SHA256 & TC_SEC_ITSS_SND_CAM_11_02_BV for PICS_SEC_SHA384
parent 12eead69
Loading
Loading
Loading
Loading
+161 −10
Original line number Diff line number Diff line
@@ -1205,10 +1205,10 @@ module ItsSecurity_TestCases {
             *  }
             * </pre>
             *
             * @see          ETSI TS 103 096-2 v1.3.2 TP_SEC_ITSS_SND_CAM_09_TI
             * @see          ETSI TS 103 096-2 v1.3.2 TP_SEC_ITSS_SND_CAM_09_BV
             * @reference    ETSI TS 103 097 [1] Clause 7.1.1
             */
            testcase TC_SEC_ITSS_SND_CAM_09_TI() runs on ItsGeoNetworking system ItsSecSystem {
            testcase TC_SEC_ITSS_SND_CAM_09_BV() runs on ItsGeoNetworking system ItsSecSystem {
                
                // Local variables
                const float c_certificateGenerationTime := 1.0;
@@ -1353,7 +1353,7 @@ module ItsSecurity_TestCases {
                f_terminateCam(v_component);
                f_poNeighbour();
                f_cf01Down();
            } // End of testcase TC_SEC_ITSS_SND_CAM_09_TI
            } // End of testcase TC_SEC_ITSS_SND_CAM_09_BV
            
            /**
             * @desc    Check that the IUT sends certificate request when it receives secured CAM containing 
@@ -1516,7 +1516,7 @@ module ItsSecurity_TestCases {
             * @desc    Check that the IUT sends certificate request when it receives secured CAM 
             *          containing certificate signed by unknown AA certificate.  
             * <pre>
             * Pics Selection: PICS_GN_SECURITY and PICS_SEC_P2P_AT_DISTRIBUTION and (PICS_SEC_SHA256 or PICS_SEC_SHA384)
             * Pics Selection: PICS_GN_SECURITY and PICS_SEC_P2P_AT_DISTRIBUTION and PICS_SEC_SHA256
             * Config Id: CF01
             * Initial conditions:
             *  with {
@@ -1544,7 +1544,7 @@ module ItsSecurity_TestCases {
             * @reference    ETSI TS 103 097 [1] Clause 7.1.1
             *               IEEE 1609.2 [2], Clauses 6.3.9 & 8.2.4.1.2
             */
            testcase TC_SEC_ITSS_SND_CAM_11_BV() runs on ItsGeoNetworking system ItsSecSystem {
            testcase TC_SEC_ITSS_SND_CAM_11_01_BV() runs on ItsGeoNetworking system ItsSecSystem {
                
                // Local variables
                var GeoNetworkingInd v_geoNwInd;
@@ -1553,8 +1553,8 @@ module ItsSecurity_TestCases {
                var ItsCam v_component;
                
                // Test control
                if (not(PICS_GN_SECURITY and PICS_SEC_P2P_AT_DISTRIBUTION and (PICS_SEC_SHA256 or PICS_SEC_SHA384))) {
                    log("*** " & testcasename() & ": ERROR: 'PICS_GN_SECURITY and PICS_SEC_P2P_AT_DISTRIBUTION and (PICS_SEC_SHA256 or PICS_SEC_SHA384)' required for executing the TC ***");
                if (not(PICS_GN_SECURITY and PICS_SEC_P2P_AT_DISTRIBUTION and PICS_SEC_SHA256)) {
                    log("*** " & testcasename() & ": ERROR: 'PICS_GN_SECURITY and PICS_SEC_P2P_AT_DISTRIBUTION and PICS_SEC_SHA256' required for executing the TC ***");
                    stop;
                }
                
@@ -1570,9 +1570,160 @@ module ItsSecurity_TestCases {
                        cc_taCert_B,
                        v_hashedId8
                    );
                } else if (PICS_SEC_SHA384 == true) {
                }
                v_expectedHashedId3 := f_HashedId3FromHashedId8(v_hashedId8);
                geoNetworkingPort.clear;
                v_component := f_setCamFrequencyGreatherThan1Hz();
                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_geoNwShbPacket
                    ))) {
                        tc_ac.stop;
                        log("*** " & testcasename() & ": INFO: Initial conditions: First CA message with certificate received ***");
                        
                        // Send secured message from unknown ITS-S
                        geoNetworkingPort.clear;
                        f_sendSecuredCam(
                            cc_taCert_B,
                            valueof(m_headerInfo_cam(-, f_computeGnTimestamp())),
                            valueof(
                                m_signerIdentifier_digest(
                                    v_hashedId8
                                )
                            )
                        );
                        f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                    }
                    [] tc_ac.timeout {
                        log("*** " & testcasename() & ": INCONC: Initial conditions: CA message with certificate not received ***");
                        f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout);
                    }
                } // End of 'alt' statement;
                
                // Test Body
                tc_ac.start;
                alt {
                    [] geoNetworkingPort.receive(
                        mw_geoNwInd(
                            mw_geoNwSecPdu(
                                mw_etsiTs103097Data_signed(
                                    mw_signedData(
                                        -, 
                                        mw_toBeSignedData(
                                            mw_signedDataPayload,
                                            mw_headerInfo_cam(
                                                -,
                                                -,
                                                { v_expectedHashedId3 }
                                            )
                                        )
                                    )
                                ), 
                                mw_geoNwShbPacket
                    ))) {
                        tc_ac.stop;
                        log("*** " & testcasename() & ": PASS: Generation of CAM messages including certificate request was successful ***");
                        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 // containing digest
                                    )
                                ), 
                                mw_geoNwShbPacket
                    ))) {
                        log("*** " & testcasename() & ": INFO: CA message retransmission w/o certificate request ***"); 
                        repeat;
                    }
                    [] tc_ac.timeout {
                        log("*** " & testcasename() & ": INCONC: Expected CA message not received ***");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
                    }
                } // End of 'alt' statement
                
                // Postamble
                f_terminateCam(v_component);
                f_poNeighbour();
                f_cf01Down();
            } // End of testcase TC_SEC_ITSS_SND_CAM_11_01_BV
            
            /**
             * @desc    Check that the IUT sends certificate request when it receives secured CAM 
             *          containing certificate signed by unknown AA certificate.  
             * <pre>
             * Pics Selection: PICS_GN_SECURITY and PICS_SEC_P2P_AT_DISTRIBUTION and PICS_SEC_SHA384
             * Config Id: CF01
             * Initial conditions:
             *  with {
             *      the IUT is authorized with AT certificate (CERT_IUT_A_AT)
             *      and the IUT has receiving a CAM
             *          containing signer
             *              containing digest
             *                  indicating HashedId8 value DIGEST_A
             *                      referencing an unknown certificate (CERT_TS_B_AT)
             *  }
             *  ensure that {
             *      when {
             *          the IUT is requested to send a secured CAM
             *      } then {
             *          the IUT sends a Ieee1609Dot2Data
             *              containing headerInfo
             *                  containing inlineP2pcdRequest
             *                      containing HashedId3 value
             *                          indicating last 3 octets of DIGEST_A
             *      }
             *  }
             * </pre>
             *
             * @see          ETSI TS 103 096-2 v1.3.2 TP_SEC_ITSS_SND_CAM_11_BV
             * @reference    ETSI TS 103 097 [1] Clause 7.1.1
             *               IEEE 1609.2 [2], Clauses 6.3.9 & 8.2.4.1.2
             */
            testcase TC_SEC_ITSS_SND_CAM_11_02_BV() runs on ItsGeoNetworking system ItsSecSystem {
                
                // Local variables
                var GeoNetworkingInd v_geoNwInd;
                var HashedId8 v_hashedId8;
                var HashedId3 v_expectedHashedId3;
                var ItsCam v_component;
                
                // Test control
                if (not(PICS_GN_SECURITY and PICS_SEC_P2P_AT_DISTRIBUTION and PICS_SEC_SHA384)) {
                    log("*** " & testcasename() & ": ERROR: 'PICS_GN_SECURITY and PICS_SEC_P2P_AT_DISTRIBUTION and PICS_SEC_SHA384' 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();
                if (PICS_SEC_SHA384 == true) {
                    f_getCertificateDigest(
                        cc_taCert_B1, // FIXME Create certificate SHA-384 / NIST P-256
                        cc_taCert_B1,
                        v_hashedId8
                    );
                }
@@ -1671,7 +1822,7 @@ module ItsSecurity_TestCases {
                f_terminateCam(v_component);
                f_poNeighbour();
                f_cf01Down();
            } // End of testcase TC_SEC_ITSS_SND_CAM_11_BV
            } // End of testcase TC_SEC_ITSS_SND_CAM_11_02_BV
            
            /**
             * @desc    Check that IUT sends the secured CAM containing the signing certificate when it received 
+3 −2
Original line number Diff line number Diff line
@@ -40,9 +40,10 @@ module ItsSecurity_TestControl {
            execute(TC_SEC_ITSS_SND_CAM_06_BV());
            execute(TC_SEC_ITSS_SND_CAM_07_BV());
            execute(TC_SEC_ITSS_SND_CAM_08_BV());
            execute(TC_SEC_ITSS_SND_CAM_09_TI());
            execute(TC_SEC_ITSS_SND_CAM_09_BV());
            execute(TC_SEC_ITSS_SND_CAM_10_BV());
            execute(TC_SEC_ITSS_SND_CAM_11_BV());
            execute(TC_SEC_ITSS_SND_CAM_11_01_BV());
            execute(TC_SEC_ITSS_SND_CAM_11_02_BV());
            execute(TC_SEC_ITSS_SND_CAM_12_BV());
            execute(TC_SEC_ITSS_SND_CAM_13_BV());
            execute(TC_SEC_ITSS_SND_CAM_14_BV());