ItsSecurity_TestCases.ttcn3 503 KB
Newer Older
             *              containing generation_location
             *           indicating position inside the REGION
             *       and containing header_fields[3]
             *         containing type 
             *           indicating 'its_aid'
             *         containing its_aid
             *              indicating 'AID_DENM'
             *       and not containing any other header_fields
             *          and containing payload_field {
             *              containing type
             *                  indicating 'signed'
             *              containing data
             *                  indicating length > 0
             *                  containing DENM payload
             *          }
             *          and containing trailer_fields {
             *              containing single instance of type TrailerField {
             *                  containing type
             *                      indicating 'signature'
             *                  containing signature
             *                      verifiable using KEY
             *              }
             *          }
             *   } then {
             *     the IUT accepts the message
             *   }
             * }
             * </pre>
             * @see
             * @reference ETSI TS 103 097 V1.1.15, clause 7.2
            testcase TC_SEC_ITSS_RCV_DENM_01_03_BV() runs on ItsGeoNetworking system ItsSecSystem {
                
                // Local variables
                var integer i;
                var GeoNetworkingPdu v_securedGnPdu;
                var GnRawPayload v_sentRawPayload;
                
                // Test control
                if (not(PICS_GN_SECURITY)) {
                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
                    stop;
                }
                
                //  Test component configuration
                f_cf01Up();
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
                v_securedGnPdu := f_sendSecuredDenm(cc_taCert_C, omit, e_certificate);
                f_sleep(PX_TNOAC);
                v_sentRawPayload := f_adaptPayloadForUtInd_m(v_securedGnPdu.gnPacket.packet.payload);
                for (i := 0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, v_sentRawPayload); i := i + 1) {
                    // empty on purpose 
                }
                if (i < lengthof(vc_utInds)) {
                    log("*** " & testcasename() & ": PASS: DENM was transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                }
                else {
                    log("*** " & testcasename() & ": FAIL: DENM was not transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                }
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
            } // End of testcase TC_SEC_ITSS_RCV_DENM_01_03_BV
            
            /**
             * @desc    Check that IUT accepts a well-formed Secured DENM signe with the certificate with a polygonal region validity restriction 
             * <pre>
             * Pics Selection: PICS_GN_SECURITY
             * Config Id: CF01
             * Expected Behavior:
             * with {
             *   the IUT being in the 'authorized' state
             * }
             * ensure that {
             *   when {
             *     the IUT is receiving a SecuredMessage
             *       containing protocol_version 
             *         indicating value '2'
             *       and containing header_fields[0]
             *              containing type 
             *                  indicating 'signer_info'
             *              and containing signer {
             *                  containing type
             *                      indicating 'certificate'
             *                  and containing certificate (CERT_AT_D) {
             *                      containing subject_info.subject_type
             *                          indicating 'authorization_ticket' (2)
             *                      and containing subject_attributes['verification key'] (KEY)
             *                      and containing validity_restrictions['region'] {
             *                          containing region{
             *                              containing region_type
             *                                  indicating 'polygon'
             *                              and containing polygonal_region
             *                   indicating REGION
             *                          }
             *                      }
             *                  }
             *       and containing header_fields [1]
             *         containing type 
             *           indicating 'generation_time'
             *              containing generation_time
             *                  indicating CURRENT_TIME
             *       and containing header_fields [2]
             *         containing type 
             *           indicating 'generation_location'
             *              containing generation_location
             *           indicating position inside the REGION
             *       and containing header_fields[3]
             *         containing type 
             *           indicating 'its_aid'
             *         containing its_aid
             *              indicating 'AID_DENM'
             *       and not containing any other header_fields
             *          and containing payload_field {
             *              containing type
             *                  indicating 'signed'
             *              containing data
             *                  indicating length > 0
             *                  containing DENM payload
             *          }
             *          and containing trailer_fields {
             *              containing single instance of type TrailerField {
             *                  containing type
             *                      indicating 'signature'
             *                  containing signature
             *                      verifiable using KEY
             *              }
             *          }
             *   } then {
             *     the IUT accepts the message
             *   }
             * }
             * </pre>
             * @see
             * @reference ETSI TS 103 097 V1.1.15, clause 7.2
            testcase TC_SEC_ITSS_RCV_DENM_01_04_BV() runs on ItsGeoNetworking system ItsSecSystem {
                
                // Local variables
                var integer i;
                var GeoNetworkingPdu v_securedGnPdu;
                var GnRawPayload v_sentRawPayload;
                
                // Test control
                if (not(PICS_GN_SECURITY)) {
                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
                    stop;
                }
                
                //  Test component configuration
                f_cf01Up();
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
                v_securedGnPdu := f_sendSecuredDenm(cc_taCert_D, omit, e_certificate);
                f_sleep(PX_TNOAC);
                v_sentRawPayload := f_adaptPayloadForUtInd_m(v_securedGnPdu.gnPacket.packet.payload);
                for (i := 0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, v_sentRawPayload); i := i + 1) {
                    // empty on purpose 
                }
                if (i < lengthof(vc_utInds)) {
                    log("*** " & testcasename() & ": PASS: DENM was transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                }
                else {
                    log("*** " & testcasename() & ": FAIL: DENM was not transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                }
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
            } // End of testcase TC_SEC_ITSS_RCV_DENM_01_04_BV
            
            /**
             * @desc    Check that IUT accepts a well-formed Secured DENM signe with the certificate with a identified region validity restriction 
             * <pre>
             * Pics Selection: PICS_GN_SECURITY
             * Config Id: CF01
             * Expected Behavior:
             * with {
             *   the IUT being in the 'authorized' state
             * }
             * ensure that {
             *   when {
             *     the IUT is receiving a SecuredMessage
             *       containing protocol_version 
             *         indicating value '2'
             *       and containing header_fields[0]
             *              containing type 
             *                  indicating 'signer_info'
             *              and containing signer {
             *                  containing type
             *                      indicating 'certificate'
             *           and containing certificate (CERT_AT_E) {
             *                      containing subject_info.subject_type
             *                          indicating 'authorization_ticket' (2)
             *                      and containing subject_attributes['verification key'] (KEY)
             *                      and containing validity_restrictions['region'] {
             *                          containing region{
             *                              containing region_type
             *                                  indicating 'id_region'
             *                              and containing identified_region
             *                                  indicating REGION
             *                          }
             *                      }
             *                  }
             *       and containing header_fields [1]
             *         containing type 
             *           indicating 'generation_time'
             *              containing generation_time
             *                  indicating CURRENT_TIME
             *       and containing header_fields [2]
             *         containing type 
             *           indicating 'generation_location'
             *              containing generation_location
             *                  indicating position inside the REGION
             *       and containing header_fields[3]
             *         containing type 
             *           indicating 'its_aid'
             *         containing its_aid
             *              indicating 'AID_DENM'
             *       and not containing any other header_fields
             *          and containing payload_field {
             *              containing type
             *                  indicating 'signed'
             *              containing data
             *                  indicating length > 0
             *                  containing DENM payload
             *          }
             *          and containing trailer_fields {
             *              containing single instance of type TrailerField {
             *                  containing type
             *                      indicating 'signature'
             *                  containing signature
             *                      verifiable using KEY
             *              }
             *          }
             *   } then {
             *     the IUT accepts the message
             *   }
             * }
             * </pre>
             * @see
             * @reference ETSI TS 103 097 V1.1.15, clause 7.2
            testcase TC_SEC_ITSS_RCV_DENM_01_05_BV() runs on ItsGeoNetworking system ItsSecSystem {
                
                // Local variables
                var integer i;
                var GeoNetworkingPdu v_securedGnPdu;
                var GnRawPayload v_sentRawPayload;
                
                // Test control
                if (not(PICS_GN_SECURITY)) {
                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
                    stop;
                }
                
                //  Test component configuration
                f_cf01Up();
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
                v_securedGnPdu := f_sendSecuredDenm(cc_taCert_D, omit, e_certificate);
                f_sleep(PX_TNOAC);
                v_sentRawPayload := f_adaptPayloadForUtInd_m(v_securedGnPdu.gnPacket.packet.payload);
                for (i := 0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, v_sentRawPayload); i := i + 1) {
                    // empty on purpose 
                }
                if (i < lengthof(vc_utInds)) {
                    log("*** " & testcasename() & ": PASS: DENM was transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                }
                else {
                    log("*** " & testcasename() & ": FAIL: DENM was not transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                }
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
            } // End of testcase TC_SEC_ITSS_RCV_DENM_01_05_BV
            
            /**
             * @desc    Check that IUT discards a Secured DENM containing protocol version set to a value less then 2
             * <pre>
             * Pics Selection: PICS_GN_SECURITY
             * Config Id: CF01
             * Initial conditions:
             *  with {
             *      the IUT being in the 'authorized' state
             *  }
             *  ensure that {
             *      when { 
             *          the IUT is receiving a SecuredMessage (DENM)
             *              containing protocol_version 
             *                  indicating 1
             *              containing header_fields['its_aid']
             *                  indicating 'AID_DENM'
             *      } then {
             *          the IUT discards a SecuredMessage
             *      }
             *  }
             * </pre>
             *
             * @see
             * @reference ETSI TS 103 097 V1.1.15, clause 7.2
            testcase TC_SEC_ITSS_RCV_DENM_02_01_BO() runs on ItsGeoNetworking system ItsSecSystem {
                
                // Local variables
                var integer i;
                var GeoNetworkingPdu v_securedGnPdu;
                var GnRawPayload v_sentRawPayload;
                
                // Test control
                if (not(PICS_GN_SECURITY)) {
                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
                    stop;
                }
                
                //  Test component configuration
                f_cf01Up();
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
                v_securedGnPdu := f_sendSecuredDenm_Bo(cc_taCert_A, PX_WRONG_PROTOCOL_VERSION);
                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();
            } // End of testcase TC_SEC_ITSS_RCV_DENM_02_01_BO
            
            /**
             * @desc    Check that IUT discards a Secured DENM containing protocol version set to a value greater then 2
             * <pre>
             * Pics Selection: PICS_GN_SECURITY
             * Config Id: CF01
             * Initial conditions:
             *  with {
             *      the IUT being in the 'authorized' state
             *  }
             *  ensure that {
             *      when { 
             *          the IUT is receiving a SecuredMessage (DENM)
             *              containing protocol_version 
             *                  indicating 3
             *              containing header_fields['its_aid']
             *                  indicating 'AID_DENM'
             *      } then {
             *          the IUT discards a SecuredMessage
             *      }
             *  }
             * </pre>
             *
             * @see
             * @reference ETSI TS 103 097 V1.1.15, clause 7.2
            testcase TC_SEC_ITSS_RCV_DENM_02_02_BO() runs on ItsGeoNetworking system ItsSecSystem {
                
                // Local variables
                var integer i;
                var GeoNetworkingPdu v_securedGnPdu;
                var GnRawPayload v_sentRawPayload;
                
                // Test control
                if (not(PICS_GN_SECURITY)) {
                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
                    stop;
                }
                
                //  Test component configuration
                f_cf01Up();
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
                v_securedGnPdu := f_sendSecuredDenm_Bo(cc_taCert_A, PX_WRONG_PROTOCOL_VERSION);
                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();
            } // End of testcase TC_SEC_ITSS_RCV_DENM_02_02_BO
             * @desc  Check that IUT discards secured DENM when its_aid value is not equal to AID_DENM
             * Pics Selection: PICS_GN_SECURITY
             * Config Id: CF01
             * Initial conditions:
             *  with {
             *      the IUT being in the 'authorized' state
             *  }
             *  ensure that {
             *      when { 
             *          the IUT is receiving a SecuredMessage
             *              containing header_fields['its_aid']
             *                  indicating 'AID_CAM'
             *              and containing payload_field {
             *                  containing type    
             *                    indicating 'signed'    
             *                  containing data    
             *                    containing DENM payload    
             *              }    
             *      } then {
             *          the IUT discards the DENM
             *      }
             *  }
             * </pre>
             * @see
             * @reference ETSI TS 103 097 V1.1.15, clause 7.1
            testcase TC_SEC_ITSS_RCV_DENM_07_01_BO() runs on ItsGeoNetworking system ItsSecSystem {
                
                // Local variables
                var integer i;
                var GeoNetworkingPdu v_securedGnPdu;
                var GnRawPayload v_sentRawPayload;
                
                // Test control
                if (not(PICS_GN_SECURITY)) {
                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
                    stop;
                }
                
                //  Test component configuration
                f_cf01Up();
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
                v_securedGnPdu := f_prepareSecuredDenm(
                    {
                        m_header_field_its_aid_CAM
                    }
                ); 
                f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast(v_securedGnPdu));
                
                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 
                } // End of 'for' statement
                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();
            } // End of testcase TC_SEC_ITSS_RCV_DENM_07_01a_EB
            
            /**
             * @desc   Check that IUT discards Secured DENM if the HeaderField generation_location is outside of the circular validity region of the signing certificate
             * <pre>
             * Pics Selection: PICS_GN_SECURITY
             * Config Id: CF01
             * Initial conditions:
             * with {
             *   the IUT being in the 'authorized' state
             * }
             * ensure that {
             *   when {
             *     the IUT is requested to send DENM
             *   } then {
             *     the IUT is receiving a SecuredMessage {
             *          containing header_fields['signer_info'].type
             *              indicating 'certificate'
             *          and containing  header_fields ['signer_info'].certificate (CERT_AT_B)
             *              containing validity_restrictions['region'] {
             *                  containing region{
             *                      containing region_type
             *                          indicating 'circle'
             *                      and containing circular_region
             *                          indicating REGION
             *                  }
             *              }
             *          and containing header_fields ['generation_location']
             *              containing generation_location
             *                  indicating position outside the REGION
             *          and containing header_fields['its_aid']
             *              indicating 'AID_DENM'
             *   }
             * }
             * </pre>
             * @see
             * @reference ETSI TS 103 097 V1.1.15, clause 7.2
            testcase TC_SEC_ITSS_RCV_DENM_08_01_BO() runs on ItsGeoNetworking system ItsSecSystem {
                
                // Local variables
                var integer i;
                var GeoNetworkingPdu v_securedGnPdu;
                var GnRawPayload v_sentRawPayload;
                
                // Test control
                if (not(PICS_GN_SECURITY)) {
                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
                    stop;
                }
                
                //  Test component configuration
                f_cf01Up();
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
                v_securedGnPdu := f_sendSecuredDenm(cc_taCert_B_BO, omit, e_certificate);
                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 
                } // End of 'for' statement
                if (i == lengthof(vc_utInds)) {
                    log("*** " & testcasename() & ": PASS: DENM was dropped by the IUT ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                }
                else {
                    log("*** " & testcasename() & ": FAIL: DENM was transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                }
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
            } // End of testcase TC_SEC_ITSS_RCV_DENM_08_01_BO
            
            /**
             * @desc    Check that IUT discards Secured DENM if the HeaderField generation_location is outside of the rectangilar validity region of the signing certificate
             * <pre>
             * Pics Selection: PICS_GN_SECURITY
             * Config Id: CF01
             * Initial conditions:
             * with {
             *   the IUT being in the 'authorized' state
             * }
             * ensure that {
             *   when {
             *     the IUT is requested to send DENM
             *   } then {
             *     the IUT is receiving a SecuredMessage {
             *          containing header_fields['signer_info'].type
             *              indicating 'certificate'
             *          and containing  header_fields ['signer_info'].certificate (CERT_AT_C)
             *              containing validity_restrictions['region'] {
             *                  containing region{
             *                      containing region_type
             *                          indicating 'rectangle'
             *                      and containing rectangular_regions
             *                          indicating REGION
             *                  }
             *              }
             *          and containing header_fields ['generation_location']
             *              containing generation_location
             *                  indicating position outside the REGION
             *          and containing header_fields['its_aid']
             *              indicating 'AID_DENM'
             *   }
             * }
             * </pre>
             * @see
             * @reference ETSI TS 103 097 V1.1.15, clause 7.2
            testcase TC_SEC_ITSS_RCV_DENM_08_02_BO() runs on ItsGeoNetworking system ItsSecSystem {
                
                // Local variables
                var integer i;
                var GeoNetworkingPdu v_securedGnPdu;
                var GnRawPayload v_sentRawPayload;
                
                // Test control
                if (not(PICS_GN_SECURITY)) {
                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
                    stop;
                }
                
                //  Test component configuration
                f_cf01Up();
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
                v_securedGnPdu := f_sendSecuredDenm(cc_taCert_C_BO, omit, e_certificate);
                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 
                } // End of 'for' statement
                if (i == lengthof(vc_utInds)) {
                    log("*** " & testcasename() & ": PASS: DENM was dropped by the IUT ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                }
                else {
                    log("*** " & testcasename() & ": FAIL: DENM was transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                }
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
            } // End of testcase TC_SEC_ITSS_RCV_DENM_08_02_BO
            
            /**
             * @desc    Check that IUT discards Secured DENM if the HeaderField generation_location is outside of the polygonal validity region of the signing certificate    
             * <pre>
             * Pics Selection: PICS_GN_SECURITY
             * Config Id: CF01
             * Initial conditions:
             * with {
             *   the IUT being in the 'authorized' state
             * }
             * ensure that {
             *   when {
             *     the IUT is requested to send DENM
             *   } then {
             *     the IUT is receiving a SecuredMessage {
             *          containing header_fields['signer_info'].type
             *              indicating 'certificate'
             *          and containing  header_fields ['signer_info'].certificate (CERT_AT_D)
             *              containing validity_restrictions['region'] {
             *                  containing region{
             *                      containing region_type
             *                          indicating 'polygon'
             *                      and containing polygonal_region
             *                          indicating REGION
             *                  }
             *              }
             *          and containing header_fields ['generation_location']
             *              containing generation_location
             *                  indicating position outside the REGION
             *          and containing header_fields['its_aid']
             *              indicating 'AID_DENM'
             *   }
             * }
             * </pre>
             * @see
             * @reference ETSI TS 103 097 V1.1.15, clause 7.2
            testcase TC_SEC_ITSS_RCV_DENM_08_03_BO() runs on ItsGeoNetworking system ItsSecSystem {
                
                // Local variables
                var integer i;
                var GeoNetworkingPdu v_securedGnPdu;
                var GnRawPayload v_sentRawPayload;
                
                // Test control
                if (not(PICS_GN_SECURITY)) {
                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
                    stop;
                }
                
                //  Test component configuration
                f_cf01Up();
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
                v_securedGnPdu := f_sendSecuredDenm(cc_taCert_D_BO, omit, e_certificate);
                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 
                } // End of 'for' statement
                if (i == lengthof(vc_utInds)) {
                    log("*** " & testcasename() & ": PASS: DENM was dropped by the IUT ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                }
                else {
                    log("*** " & testcasename() & ": FAIL: DENM was transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                }
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
            } // End of testcase TC_SEC_ITSS_RCV_DENM_08_03_BO
            
            /**
             * @desc    Check that IUT discards Secured DENM if the HeaderField generation_location is outside of the identified validity region of the signing certificate 
             * <pre>
             * Pics Selection: PICS_GN_SECURITY
             * Config Id: CF01
             * Initial conditions:
             * with {
             *   the IUT being in the 'authorized' state
             * }
             * ensure that {
             *   when {
             *     the IUT is requested to send DENM
             *   } then {
             *     the IUT is receiving a SecuredMessage {
             *          containing header_fields['signer_info'].type
             *              indicating 'certificate'
             *          and containing  header_fields ['signer_info'].certificate (CERT_AT_E)
             *              containing validity_restrictions['region'] {
             *                  containing region{
             *                      containing region_type
             *                          indicating 'id_region'
             *                      and containing identified_region
             *                          indicating REGION
             *                  }
             *              }
             *          and containing header_fields ['generation_location']
             *              containing generation_location
             *                  indicating position outside the REGION
             *          and containing header_fields['its_aid']
             *              indicating 'AID_DENM'
             *   }
             * }
             * </pre>
             * @see
             * @reference ETSI TS 103 097 V1.1.15, clause 7.2
            testcase TC_SEC_ITSS_RCV_DENM_08_04_BO() runs on ItsGeoNetworking system ItsSecSystem {
                
                // Local variables
                var integer i;
                var GeoNetworkingPdu v_securedGnPdu;
                var GnRawPayload v_sentRawPayload;
                
                // Test control
                if (not(PICS_GN_SECURITY)) {
                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
                    stop;
                }
                
                //  Test component configuration
                f_cf01Up();
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
                v_securedGnPdu := f_sendSecuredDenm(cc_taCert_E_BO, omit, e_certificate);
                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 
                } // End of 'for' statement
                if (i == lengthof(vc_utInds)) {
                    log("*** " & testcasename() & ": PASS: DENM was dropped by the IUT ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                }
                else {
                    log("*** " & testcasename() & ": FAIL: DENM was transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                }
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
            } // End of testcase TC_SEC_ITSS_RCV_DENM_08_04_BO
            
        } // End of group g_recvDenmProfile
        
    } // End of group g_receiverbehavior
    
    group g_Certificates {
        
        /**
         * @desc    Check that AT certificate has version 2
         * <pre>
         * Pics Selection: PICS_GN_SECURITY
         * Config Id: CF01
         * Initial conditions:
         * with {
         *   the IUT being in the 'authorized' state
         *   the IUT being requested to include certificate in the next CAM
         * }
         * Expected Behaviour:
         * ensure that {
         *    when {
         *     the IUT is requested to send a CAM
         *   } then {
         *     the IUT sends a SecuredMessage
         *       containing header_fields['signer_info'].signer {
         *         containing type
         *           indicating certificate
         *         containing certificate {
         *           containing version
         *             indicating '2'
         *         }
         *       }
         *   }
         * }
         * </pre>
         * @reference ETSI TS 103 097 V1.1.15, clause 6.1
         */
        testcase TC_SEC_SND_CERT_01_01() 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();
                
            // Test adapter configuration
                
            // Preamble
            f_prNeighbour();
            f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
            
            // Test Body
            tc_ac.start;
            alt {
                [] geoNetworkingPort.receive(
                    mw_geoNwInd(
                        mw_geoNwSecPdu(
                            mdw_securedMessage(
                                superset(
                                    mw_header_field_signer_info_certificate(
                                        mw_certificate(
                ))))))) {
                    tc_ac.stop;
                    log("*** " & testcasename() & ": PASS: AT Certificate version set to " & int2char(c_certificate_version) & " ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                }
                [] geoNetworkingPort.receive(
                    mw_geoNwInd(
                        mw_geoNwSecPdu(
                            mdw_securedMessage(
                                superset(
                                    mw_header_field_signer_info_certificate(
                                        ?
                )))))) {
                    tc_ac.stop;
                    log("*** " & testcasename() & ": FAIL: AT Certificate version mismatch ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                }
                [] tc_ac.timeout {
                    log("*** " & testcasename() & ": INCONC: Expected message not received ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
                }
            } // End of 'alt' statement
            
            // Postamble
            f_poNeighbour();
            f_cf01Down();
        } // End of testcase TC_SEC_SND_CERT_01_01
        
        /**
         * @desc    Check that AA certificate has version 2
         * <pre>
         * Pics Selection: PICS_GN_SECURITY and not PICS_CERTIFICATE_SELECTION
         * Config Id: CF01
         * Initial conditions:
         * with {
         *   the IUT being in the 'authorized' state
         *      the IUT being requested to include certificate chain in the next CAM
         * }
         * Expected Behaviour:
         * ensure that {
         *    when {
         *     the IUT is requested to send a CAM
         *   } then {
         *     the IUT sends a SecuredMessage
         *       containing header_fields['signer_info'].signer {
         *         containing type
         *           indicating certificate_chain
         *         containing certificates.length >1
         *         containing certificates[last-1] {
         *           containing version
         *             indicating '2'
         *         }
         *       }
         *   }
         * }
         * </pre>
         * @reference ETSI TS 103 097 V1.1.15, clause 6.1
         */
        testcase TC_SEC_SND_CERT_01_02() runs on ItsGeoNetworking system ItsSecSystem {
            // Local variables
            var SecuredMessage v_recv;
            var Certificate v_cert;
            var SignerInfo v_si;
            var HashedId8 v_digest;
            
            // Test control
            if (not(PICS_GN_SECURITY)) {
                log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
                stop;
            }
                
            // Test component configuration
            f_cf01Up();
                
            // Test adapter configuration
                
            // Preamble
            f_prNeighbour();
            f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
            
            // Wait for the message with the certificate to retrieve the AA digest.
            // Ask for the chain, containing AT and AA certificate
            // Check AA Certificate
            log("*** " & testcasename() & ": INFO: Wait for certificate and ask for certificate chain  ***");
            tc_ac.start;
            f_askForCertificateChain(f_generateDefaultCam());
            tc_ac.stop;
            
            // Test Body
            tc_ac.start;
            alt {
                [] geoNetworkingPort.receive(
                    mw_geoNwInd(
                        mw_geoNwSecPdu(