ItsSecurity_TestCases.ttcn3 631 KB
Newer Older
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                f_acTriggerEvent(m_startPassBeaconing(m_beaconHeader(v_longPosVectorIut).beaconHeader)); // Authorize the TA to forward the received beacons
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);    
                
                // Test Body
                tc_ac.start;
                alt {
                    [] geoNetworkingPort.receive(
                        mw_geoNwInd(mw_geoNwSecPdu(
                            mdw_securedMessage_Others(
                                mw_header_field_signer_info_certificate(
                                    mw_certificate(
                                        ?,
                                        ?,
                                        ?,
                                        superset(
4020
                                            mw_validity_restriction_any_valid_region
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
                    ))))))) {
                        log("*** " & testcasename() & ": INFO: Skip DENM containing region restrictions ***");
                        repeat;
                    }
                    [] geoNetworkingPort.receive(
                        mw_geoNwInd(
                            mw_geoNwSecPdu(
                                mdw_securedMessage(
                                    superset(
                                        mw_header_field(
                                            e_generation_location
                                        ),
                                        mw_header_field_signer_info_certificate,
                                        complement(
                                            mw_header_field_its_aid_CAM,
                                            mw_header_field_its_aid_DENM
                                        )
                    ))))) {
                        // The certificate doesn't contain region restrictions because such messages was catched before 
                        tc_ac.stop;
                        log("*** " & testcasename() & ": PASS: DENM contains generation location ***");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    }
                    [] geoNetworkingPort.receive(
                        mw_geoNwInd(
                            mw_geoNwSecPdu(
                                mdw_securedMessage_Others(
                                    mw_header_field_signer_info_certificate
                    )))) {
                        // The message does not contain generation location 
                        tc_ac.stop;
                        log("*** " & testcasename() & ": PASS: DENM contains generation location ***");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    }
                    [] tc_ac.timeout {
                        log("*** " & testcasename() & ": INCONC: Expected DENM not received ***");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
                    }
                } // End of 'alt' statement
                
                // Postamble
                f_acTriggerEvent(m_stopPassBeaconing);
                f_poNeighbour();
                f_cf01Down();
4065
            } // End of testcase TC_SEC_ITSS_SND_GENMSG_05_01_BV
4066
4067
4068
4069
4070
4071
            
            /**
             * @desc   Check that the secured GN Beacon contains exactly one HeaderField generation_location 
             *         which is inside the circular region containing in the validity restriction of the 
             *         certificate pointed by the signer_info field     
             * <pre>
4072
             * Pics Selection: PICS_GN_SECURITY and PICS_ITS_AID_OTHER_PROFILE and PICS_CERTIFICATE_SELECTION and PICS_USE_CIRCULAR_REGION
4073
4074
             * Config Id: CF01
             * with {
garciay's avatar
garciay committed
4075
4076
4077
4078
4079
4080
4081
             *   the IUT has been authorized with the AT certificate (CERT_IUT_B)
             *       containing validity_restrictions['region']
             *           containing region
             *               containing region_type
             *                   indicating 'circle'
             *               and containing circular_region
             *                   indicating REGION
4082
4083
4084
4085
4086
             * }
             * ensure that {
             *   when {
             *     the IUT is requested to send a GN Beacon
             *   } then {
garciay's avatar
garciay committed
4087
4088
4089
4090
             *     the IUT sends a SecuredMessage 
             *         containing exactly one header_fields['generation_location']
             *             containing generation_location
             *                 indicating value inside the REGION
4091
4092
4093
             *   }
             * }
             * </pre>
garciay's avatar
garciay committed
4094
4095
             * @see          ETSI TS 103 096-2 v1.2.2 TP_SEC_ITSS_SND_GENMSG_05_02_BV
             * @reference    ETSI TS 103 097 [1], clause 7.3
4096
             */
4097
            testcase TC_SEC_ITSS_SND_GENMSG_05_02_BV() runs on ItsGeoNetworking system ItsSecSystem {
4098
4099
4100
4101
4102
                
                // Local variables
                var LongPosVector   v_longPosVectorIut;
                
                // Test control
4103
                if (not(PICS_GN_SECURITY) or not(PICS_ITS_AID_OTHER_PROFILE) or not(PICS_CERTIFICATE_SELECTION) or not(PICS_USE_CIRCULAR_REGION)) {
garciay's avatar
garciay committed
4104
                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY and PICS_ITS_AID_OTHER_PROFILE and PICS_USE_CIRCULAR_REGION' required for executing the TC ***");
4105
4106
                    stop;
                }
4107
4108
                
                // Test component configuration
4109
                vc_hashedId8ToBeUsed := cc_iutCert_B; 
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
                f_cf01Up();
                v_longPosVectorIut := f_getPosition(c_compIut);
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                f_acTriggerEvent(m_startPassBeaconing(m_beaconHeader(v_longPosVectorIut).beaconHeader)); // Authorize the TA to forward the received beacons
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);    
                
                // Test Body
4121
                f_TC_SEC_ITSS_SND_GENMSG_05_BV(mw_geographicRegion_circle);
4122
4123
4124
4125
4126
                
                // Postamble
                f_acTriggerEvent(m_stopPassBeaconing);
                f_poNeighbour();
                f_cf01Down();
4127
            } // End of testcase TC_SEC_ITSS_SND_GENMSG_05_02_BV
4128
            
4129
4130
4131
4132
4133
            /**
             * @desc   Check that the secured GN Beacon contains exactly one HeaderField generation_location 
             *         which is inside the rectangular region containing in the validity restriction 
             *         of the certificate pointed by the signer_info field     
             * <pre>
4134
             * Pics Selection: PICS_GN_SECURITY and PICS_ITS_AID_OTHER_PROFILE and PICS_CERTIFICATE_SELECTION and PICS_USE_RECTANGULAR_REGION
4135
4136
             * Config Id: CF01
             * with {
garciay's avatar
garciay committed
4137
4138
4139
4140
4141
4142
4143
             *   the IUT has been authorized with the AT certificate (CERT_IUT_C)
             *     containing validity_restrictions ['region']
             *         containing region
             *             containing region_type
             *                 indicating 'rectangle'
             *             containing rectangular_region
             *                 indicating REGION
4144
4145
4146
4147
4148
             * }
             * ensure that {
             *   when {
             *     the IUT is requested to send a DENM
             *   } then {
garciay's avatar
garciay committed
4149
             *     the IUT sends a SecuredMessage
4150
4151
4152
4153
4154
4155
             *       containing exactly one header_fields ['generation_location']
             *         containing generation_location
             *           indicating value inside the REGION
             *   }
             * }
             * </pre>
garciay's avatar
garciay committed
4156
4157
             * @see          ETSI TS 103 096-2 v1.2.2 TP_SEC_ITSS_SND_GENMSG_05_03_BV
             * @reference    ETSI TS 103 097 [1], clause 7.3
4158
             */
4159
            testcase TC_SEC_ITSS_SND_GENMSG_05_03_BV() runs on ItsGeoNetworking system ItsSecSystem {
4160
4161
4162
                
                // Local variables
                var LongPosVector   v_longPosVectorIut;
4163
4164
4165
                
                // Test adapter configuration
                if (not(PICS_GN_SECURITY) or not(PICS_ITS_AID_OTHER_PROFILE) or not(PICS_CERTIFICATE_SELECTION) or not(PICS_USE_RECTANGULAR_REGION)) {
garciay's avatar
garciay committed
4166
                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY and PICS_ITS_AID_OTHER_PROFILE and PICS_USE_RECTANGULAR_REGION' required for executing the TC ***");
4167
4168
                    stop;
                }
4169
4170
                
                // Test component configuration
4171
                vc_hashedId8ToBeUsed := cc_iutCert_C; // Load IUT certificate CERT_IUT_C 
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
                f_cf01Up();
                v_longPosVectorIut := f_getPosition(c_compIut);
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                f_acTriggerEvent(m_startPassBeaconing(m_beaconHeader(v_longPosVectorIut).beaconHeader)); // Authorize the TA to forward the received beacons
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);    
                
                // Test Body
4183
                f_TC_SEC_ITSS_SND_GENMSG_05_BV(mw_geographicRegion_rectangular);
4184
4185
4186
4187
4188
                
                // Postamble
                f_acTriggerEvent(m_stopPassBeaconing);
                f_poNeighbour();
                f_cf01Down();
4189
            } // End of testcase TC_SEC_ITSS_SND_GENMSG_05_03_BV
4190
4191
4192
4193
4194
4195
            
            /**
             * @desc   Check that the secured GN Message contains exactly one HeaderField generation_location 
             *         which is inside the polygonal region containing in the validity restriction 
             *         of the certificate pointed by the signer_info field     
             * <pre>
4196
             * Pics Selection: PICS_GN_SECURITY and PICS_ITS_AID_OTHER_PROFILE and PICS_CERTIFICATE_SELECTION and PICS_USE_POLYGONAL_REGION
4197
4198
             * Config Id: CF01
             * with {
garciay's avatar
garciay committed
4199
4200
4201
4202
4203
4204
4205
             *   the IUT has been authorized with the AT certificate (CERT_AT_D)
             *       containing validity_restrictions ['region']
             *           containing region
             *               containing region_type
             *                   indicating 'polygon'
             *               containing polygonal_region
             *                   indicating REGION
4206
4207
4208
4209
4210
             * }
             * ensure that {
             *   when {
             *     the IUT is requested to send a Beacon
             *   } then {
garciay's avatar
garciay committed
4211
             *     the IUT sends a SecuredMessage
4212
4213
4214
4215
4216
4217
             *       containing exactly one header_fields ['generation_location']
             *         containing generation_location
             *           indicating value inside the REGION
             *   }
             * }
             * </pre>
garciay's avatar
garciay committed
4218
4219
             * @see          ETSI TS 103 096-2 v1.2.2 TP_SEC_ITSS_SND_GENMSG_05_04_BV
             * @reference    ETSI TS 103 097 [1], clause 7.3
4220
             */
4221
            testcase TC_SEC_ITSS_SND_GENMSG_05_04_BV() runs on ItsGeoNetworking system ItsSecSystem {
4222
4223
4224
                
                // Local variables
                var LongPosVector   v_longPosVectorIut;
4225
4226
4227
                
                // Test adapter configuration
                if (not(PICS_GN_SECURITY) or not(PICS_ITS_AID_OTHER_PROFILE) or not(PICS_CERTIFICATE_SELECTION) or not(PICS_USE_POLYGONAL_REGION)) {
garciay's avatar
garciay committed
4228
                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY and PICS_ITS_AID_OTHER_PROFILE and PICS_USE_POLYGONAL_REGION' required for executing the TC ***");
4229
4230
                    stop;
                }
4231
4232
                
                // Test component configuration
4233
                vc_hashedId8ToBeUsed := cc_iutCert_D; // Load IUT certificate CERT_IUT_D 
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
                f_cf01Up();
                v_longPosVectorIut := f_getPosition(c_compIut);
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                f_acTriggerEvent(m_startPassBeaconing(m_beaconHeader(v_longPosVectorIut).beaconHeader)); // Authorize the TA to forward the received beacons
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);    
                
                // Test Body
4245
                f_TC_SEC_ITSS_SND_GENMSG_05_BV(mw_geographicRegion_polygonal);
4246
4247
4248
4249
4250
                
                // Postamble
                f_acTriggerEvent(m_stopPassBeaconing);
                f_poNeighbour();
                f_cf01Down();
4251
            } // End of testcase TC_SEC_ITSS_SND_GENMSG_05_04_BV
4252
4253
4254
4255
            
            /**
             * @desc   Check that the secured GN Message contains exactly one HeaderField generation_location 
             *         which is inside the identified region containing in the validity restriction 
garciay's avatar
garciay committed
4256
             *         of the certificate pointed by the signer_info field
4257
             * <pre>
4258
             * Pics Selection: PICS_GN_SECURITY and PICS_ITS_AID_OTHER_PROFILE and PICS_USE_IDENTIFIED_REGION and PICS_CERTIFICATE_SELECTION
4259
4260
             * Config Id: CF01
             * with {
garciay's avatar
garciay committed
4261
4262
4263
4264
4265
4266
4267
             *   the IUT has been authorized with the AT certificate (CERT_IUT_E) 
             *       containing validity_restrictions ['region'] 
             *           containing region
             *               containing region_type
             *                   indicating 'id_region'
             *               containing identified_region
             *                   indicating REGION
4268
4269
4270
4271
4272
             * }
             * ensure that {
             *   when {
             *     the IUT is requested to send a Beacon
             *   } then {
garciay's avatar
garciay committed
4273
             *     the IUT sends a SecuredMessage
4274
4275
4276
4277
4278
4279
             *       containing exactly one header_fields ['generation_location']
             *         containing generation_location
             *           indicating value inside the REGION
             *   }
             * }
             * </pre>
garciay's avatar
garciay committed
4280
4281
             * @see          ETSI TS 103 096-2 v1.2.2 TP_SEC_ITSS_SND_GENMSG_05_05_BV
             * @reference    ETSI TS 103 097 [1], clause 7.3
4282
             */
4283
            testcase TC_SEC_ITSS_SND_GENMSG_05_05_BV() runs on ItsGeoNetworking system ItsSecSystem {
4284
4285
                // Local variables
                var LongPosVector   v_longPosVectorIut;
4286
4287
4288
                
                // Test adapter configuration
                if (not(PICS_GN_SECURITY) or not(PICS_ITS_AID_OTHER_PROFILE) or not(PICS_CERTIFICATE_SELECTION) or not(PICS_USE_IDENTIFIED_REGION)) {
garciay's avatar
garciay committed
4289
                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY and PICS_ITS_AID_OTHER_PROFILE and PICS_USE_IDENTIFIED_REGION' required for executing the TC ***");
4290
4291
                    stop;
                }
4292
4293
                
                // Test component configuration
4294
                vc_hashedId8ToBeUsed := cc_iutCert_E; // Load IUT certificate CERT_IUT_E 
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
                f_cf01Up();
                v_longPosVectorIut := f_getPosition(c_compIut);
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                f_acTriggerEvent(m_startPassBeaconing(m_beaconHeader(v_longPosVectorIut).beaconHeader)); // Authorize the TA to forward the received beacons
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);    
                
                // Test Body
4306
                f_TC_SEC_ITSS_SND_GENMSG_05_BV(mw_geographicRegion_identified);
4307
4308
4309
4310
4311
                
                // Postamble
                f_acTriggerEvent(m_stopPassBeaconing);
                f_poNeighbour();
                f_cf01Down();
4312
            } // End of testcase TC_SEC_ITSS_SND_GENMSG_05_05_BV
4313
4314
4315
            
            /**
             * @desc   Check that the secured GN Message contains exactly one HeaderField generation_location 
garciay's avatar
garciay committed
4316
             *         which is inside the  certificate pointed by the signer_info field
4317
             * <pre>
garciay's avatar
garciay committed
4318
             * Pics Selection: PICS_GN_SECURITY and PICS_ITS_AID_OTHER_PROFILE and not PICS_CERTIFICATE_SELECTION
4319
4320
4321
4322
4323
4324
4325
4326
             * Config Id: CF01
             * with {
             *   the IUT being in the 'authorized' state
             * }
             * ensure that {
             *   when {
             *     the IUT is requested to send a Beacon
             *   } then {
garciay's avatar
garciay committed
4327
4328
             *     the IUT sends a SecuredMessage
             *       containing header_fields['signed_info'].certificate
4329
4330
4331
4332
4333
             *         containing validity_restrictions ['region']
             *           containing region.region_type
             *             indicating 'circle'
             *           containing region.circular_region
             *             indicating REGION
garciay's avatar
garciay committed
4334
             *         or containing region.region_type
4335
4336
4337
4338
             *             indicating 'rectangle'
             *           containing region.rectangular_region
             *             containing array of rectangles
             *               indicating REGION
garciay's avatar
garciay committed
4339
             *         or containing region.region_type
4340
4341
4342
             *             indicating 'polygonal'
             *           containing region.polygonal_region
             *             indicating REGION
garciay's avatar
garciay committed
4343
             *         or containing region.region_type
4344
4345
4346
             *             indicating 'id_region'
             *           containing region.circular_region
             *             indicating REGION
garciay's avatar
garciay committed
4347
             *       and containing exactly one header_fields['generation_location']
4348
4349
4350
4351
4352
             *         containing generation_location
             *           indicating location inside the REGION
             *   }
             * }
             * </pre>
garciay's avatar
garciay committed
4353
4354
             * @see          ETSI TS 103 096-2 v1.2.2 TP_SEC_ITSS_SND_GENMSG_05_06_BV
             * @reference    ETSI TS 103 097 [1], clause 7.3
4355
             */
4356
            testcase TC_SEC_ITSS_SND_GENMSG_05_06_BV() runs on ItsGeoNetworking system ItsSecSystem {
4357
4358
                // Local variables
                var LongPosVector   v_longPosVectorIut;
4359
4360
                
                // Test adapter configuration
garciay's avatar
garciay committed
4361
4362
                if (not(PICS_GN_SECURITY) or not(PICS_ITS_AID_OTHER_PROFILE) or PICS_CERTIFICATE_SELECTION) {
                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY and PICS_ITS_AID_OTHER_PROFILE and not PICS_CERTIFICATE_SELECTION' required for executing the TC ***");
4363
4364
                    stop;
                }
4365
4366
                
                // Test component configuration
4367
                vc_hashedId8ToBeUsed := cc_iutCert_B; // Load IUT certificate CERT_IUT_B 
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
                f_cf01Up();
                v_longPosVectorIut := f_getPosition(c_compIut);
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                f_acTriggerEvent(m_startPassBeaconing(m_beaconHeader(v_longPosVectorIut).beaconHeader)); // Authorize the TA to forward the received beacons
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);    
                
                // Test Body
4379
                f_TC_SEC_ITSS_SND_GENMSG_05_BV(); // any type of regions
4380
4381
4382
4383
4384
                
                // Postamble
                f_acTriggerEvent(m_stopPassBeaconing);
                f_poNeighbour();
                f_cf01Down();
4385
            } // End of testcase TC_SEC_ITSS_SND_GENMSG_05_06_BV
4386
4387
4388
            
            group f_TC_SEC_ITSS_SND_GENMSG_05_xx {
                
4389
                function f_TC_SEC_ITSS_SND_GENMSG_05_BV(
garciay's avatar
garciay committed
4390
                                                        in template (present) GeographicRegion p_region := ?
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
                ) runs on ItsGeoNetworking {
                    
                    // Local variables
                    var GeoNetworkingInd v_geoNwInd;
                    
                    tc_ac.start;
                    alt {
                        // GN message must contain generation location and the certificate with region restrictions  
                        [] geoNetworkingPort.receive(
                            mw_geoNwInd(
                                mw_geoNwSecPdu(
                                    mdw_securedMessage(
                                        superset(
                                            mw_header_field(e_generation_location),
                                            mw_header_field_signer_info_certificate(
                                                mw_certificate(
                                                    ?,
                                                    ?,
                                                    ?, 
                                                    superset(
                                                        mw_validity_restriction_region(
                                                            p_region
                        ))))))))) -> value v_geoNwInd {
                            var ValidityRestriction v_vr;
                            var HeaderField         v_hf;
                            
                            tc_ac.stop;
4418
                            // Check that generation location 
4419
4420
4421
4422
4423
4424
4425
                            if (
                                f_getMsgHeaderField(v_geoNwInd.msgIn.gnPacket.securedMsg, e_generation_location, v_hf) and 
                                f_getCertificateValidityRestriction(v_geoNwInd.msgIn.gnPacket.securedMsg.header_fields[0].headerField.signer.signerInfo.certificate, e_region, v_vr)
                            ) {
                                if (f_isLocationInsideRegion(v_vr.validity.region, v_hf.headerField.generation_location)) {
                                    log("*** " & testcasename() & ": PASS: DENM contains generation location inside the certificate validity region ***");
                                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
4426
4427
4428
4429
4430
                                } else {
                                    log("v_vr.validity.region=", v_vr.validity.region);
                                    log("v_hf.headerField.generation_location=", v_hf.headerField.generation_location);
                                    log("*** " & testcasename() & ": FAIL: Invalid location");
                                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
                                }
                            } else {
                                log("*** " & testcasename() & ": FAIL: IMPOSSIBLE!!! DENM generation location or certificate region restriction header field does not exist");
                                f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                            }
                        }
                        // GN message doesn't contain generation location 
                        [] geoNetworkingPort.receive(
                            mw_geoNwInd(
                                mw_geoNwSecPdu(
                                    mdw_securedMessage_Others
                        ))) -> value v_geoNwInd {
                            var HeaderField v_hf;
                            
                            tc_ac.stop;
                            
                            // Check that generation location is not present
                            f_getMsgHeaderField(v_geoNwInd.msgIn.gnPacket.securedMsg, e_generation_location, v_hf);
                            if (not isbound(v_hf)) {
                                log("*** " & testcasename() & ": FAIL: DENM doesn't contain generation location header");
                                f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                            }
                        }
                        // GN signing certificate doesn't contains region restriction 
                        [] geoNetworkingPort.receive(
                            mw_geoNwInd(
                                mw_geoNwSecPdu(
                                    mdw_securedMessage_Others(
                                        mw_header_field_signer_info_certificate(
                                            mw_certificate(
                                                ?,
                                                ?,
                                                ?, 
                                                { } // GN signing certificate doesn't contains region restriction
                        )))))) {
                            tc_ac.stop;
                            log("*** " & testcasename() & ": INCONC: DENM certificate doesn't contain region restriction");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                        }
                        [] tc_ac.timeout {
                            log("*** " & testcasename() & ": INCONC: Expected DENM not received ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
                        }
                    } // End of 'alt' statement
4475
                } // End of function f_TC_SEC_ITSS_SND_GENMSG_05_BV 
4476
4477
4478
4479
                
            } // End of group f_TC_SEC_ITSS_SND_GENMSG_05_xx
            
            /**
garciay's avatar
garciay committed
4480
             * @desc        Check that the secured message contains of type signed, signed_external or signed_and_encrypted 
4481
             * <pre>
4482
             * Pics Selection: PICS_GN_SECURITY and PICS_ITS_AID_OTHER_PROFILE
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
             * Config Id: CF01
             * Initial conditions:
             * with {
             *     the IUT being in the 'authorized' state
             * }
             * Expected results:
             * ensure that {
             *     when {
             *         the IUT is requested to send a Beacon
             *     } then {
             *         the IUT sends a SecuredMessage {
garciay's avatar
garciay committed
4494
4495
4496
4497
             *             containing payload_fields
             *                 containing exactly one element of type Payload
             *                     containing type
             *                         indicating 'signed'
4498
4499
             * }
             * </pre>
garciay's avatar
garciay committed
4500
4501
             * @see          ETSI TS 103 096-2 v1.2.2 TP_SEC_ITSS_SND_GENMSG_06_01_BV
             * @reference    ETSI TS 103 097 [1], clause 7.3
4502
             */
4503
            testcase TC_SEC_ITSS_SND_GENMSG_06_01_BV() runs on ItsGeoNetworking system ItsSecSystem {
4504
4505
4506
4507
                
                // Local variables
                var LongPosVector v_longPosVectorIut;
                
4508
4509
4510
4511
4512
4513
                // Test adapter configuration
                if (not(PICS_GN_SECURITY) or not(PICS_ITS_AID_OTHER_PROFILE)) {
                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY and PICS_ITS_AID_OTHER_PROFILE' required for executing the TC ***");
                    stop;
                }
                
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
                // Test component configuration
                f_cf01Up();
                v_longPosVectorIut := f_getPosition(c_compIut);
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                f_acTriggerEvent(m_startPassBeaconing(m_beaconHeader(v_longPosVectorIut).beaconHeader)); // Authorize the TA to forward the received beacons
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);    
                
                // Test Body
                tc_ac.start;
                alt {
                    [] geoNetworkingPort.receive(
                        mw_geoNwInd(
                            mw_geoNwSecPdu(
                                mdw_securedMessage_Others(
                                    ?, 
                                    mw_payload(
                                        e_signed
                                    ) 
                                ),
                                mw_geoNwBeaconPacket(
                                    ?
                    )))) { 
                        log("*** " & testcasename() & ": PASS: Beacon payload is 'signed'");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    }
                    [] geoNetworkingPort.receive(
                        mw_geoNwInd(
                            mw_geoNwSecPdu(
                                mdw_securedMessage_Others(
                                    ?, 
garciay's avatar
garciay committed
4548
4549
4550
                                    mw_payload(
                                        e_signed_external
                                    ) 
4551
4552
4553
4554
                                ),
                                mw_geoNwBeaconPacket(
                                    ?
                    )))) { 
garciay's avatar
garciay committed
4555
4556
                        log("*** " & testcasename() & ": PASS: Beacon payload is 'e_signed_external'");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
4557
4558
4559
4560
4561
4562
4563
                    }
                    [] geoNetworkingPort.receive(
                        mw_geoNwInd(
                            mw_geoNwSecPdu(
                                mdw_securedMessage_Others(
                                    ?, 
                                    mw_payload(
garciay's avatar
garciay committed
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
                                        e_signed_and_encrypted
                                    ) 
                                ),
                                mw_geoNwBeaconPacket(
                                    ?
                    )))) { 
                        log("*** " & testcasename() & ": PASS: Beacon payload is 'e_signed_and_encrypted'");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    }
                    [] geoNetworkingPort.receive(
                        mw_geoNwInd(
                            mw_geoNwSecPdu(
                                mdw_securedMessage_Others(
                                    ?, 
                                    mw_payload
4579
4580
4581
4582
                                ),
                                mw_geoNwBeaconPacket(
                                    ?
                    )))) { 
garciay's avatar
garciay committed
4583
                        log("*** " & testcasename() & ": FAIL: Beacon payload is not signed, signed_external or signed_and_encrypted");
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
                        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_acTriggerEvent(m_stopPassBeaconing);
                f_poNeighbour();
                f_cf01Down();
4596
            } // End of testcase TC_SEC_ITSS_SND_GENMSG_06_01_BV
4597
4598
4599
            
            /**
             * @desc   Check that the secured GN Message contains only one TrailerField of type signature.
4600
             *         Check that the signature contained in the SecuredMessage is calculated over the right fields by cryptographically verifying the signature 
4601
             * <pre>
4602
             * Pics Selection: PICS_GN_SECURITY and PICS_ITS_AID_OTHER_PROFILE
4603
4604
4605
4606
4607
4608
4609
4610
4611
             * Config Id: CF01
             * Initial conditions:
             * with {
             *   the IUT being in the 'authorized' state
             * }
             * ensure that {
             *   when {
             *     the IUT is requested to send Beacon
             *   } then {
garciay's avatar
garciay committed
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
             *     the IUT sends a SecuredMessage
             *         containing header_fields ['signer_info']
             *             containing signer
             *                 containing type
             *                     indicating 'certificate'
             *             and containing certificate
             *                 indicating CERT
             *         and containing trailer_fields['signature']
             *             containing signature
             *                 verifiable using CERT.subject_attributes['verification_key'] 
4622
4623
4624
             *   }
             * }
             * </pre>
garciay's avatar
garciay committed
4625
4626
             * @see          ETSI TS 103 096-2 v1.2.2 TP_SEC_ITSS_SND_GENMSG_07_01_BV
             * @reference    ETSI TS 103 097 [1], clause 7.3
4627
             */
4628
            testcase TC_SEC_ITSS_SND_GENMSG_07_01_BV() runs on ItsGeoNetworking system ItsSecSystem {
4629
4630
4631
4632
4633
4634
                
                //  Local variables
                var LongPosVector v_longPosVectorIut;
                var GeoNetworkingInd v_geoNwInd;
                var SignerInfo v_signerInfo;
                
4635
4636
4637
4638
4639
4640
                // Test adapter configuration
                if (not(PICS_GN_SECURITY) or not(PICS_ITS_AID_OTHER_PROFILE)) {
                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY and PICS_ITS_AID_OTHER_PROFILE' required for executing the TC ***");
                    stop;
                }
                
4641
4642
4643
4644
                //  Test component configuration
                f_cf01Up();
                v_longPosVectorIut := f_getPosition(c_compIut);
                
4645
4646
                // Test adapter configuration
                
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
                // Preamble
                f_prNeighbour();
                f_acTriggerEvent(m_startPassBeaconing(m_beaconHeader(v_longPosVectorIut).beaconHeader)); // Authorize the TA to forward the received beacons
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                    
                // Test Body
                tc_ac.start;
                alt {
                    [] geoNetworkingPort.receive(
                        mw_geoNwInd(
                            mw_geoNwSecPdu(
                                mdw_securedMessage_Others(
                                    mw_header_field_signer_info_certificate
                    )))) -> value v_geoNwInd { 
                        tc_ac.stop;
                        log("*** " & testcasename() & ": INFO: Beacon message with certificate received ***");
                        f_getMsgSignerInfo(v_geoNwInd.msgIn.gnPacket.securedMsg, v_signerInfo);
                        
                        if (f_verifyGnSecuredMessageSignatureWithCertificate(v_geoNwInd.msgIn.gnPacket.securedMsg, v_signerInfo.signerInfo.certificate) == false) {
                            log("*** " & testcasename() & ": FAIL: Beacon received with invalide signature");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                        }
                    }
                    [] geoNetworkingPort.receive(
                        mw_geoNwInd(
                            mw_geoNwSecPdu(
                                mdw_securedMessage_Others
                    ))) { 
                        tc_ac.stop;
                        log("*** " & testcasename() & ": FAIL: Beacon message without certificate received");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                    }
                    [] tc_ac.timeout {
                        log("*** " & testcasename() & ": INCONC: Expected GN Message not received");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
                    }
                } // End of 'alt' statement
                log("*** " & testcasename() & ": PASS: GN Message received with correct signature");
                f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                
                // Postamble
                f_acTriggerEvent(m_stopPassBeaconing);
                f_poNeighbour();
                f_cf01Down();
4691
            } // End of testcase TC_SEC_ITSS_SND_DENM_07_01_BV
4692
            
garciay's avatar
garciay committed
4693
        } // End of group sendOtherProfile
4694
        
garciay's avatar
garciay committed
4695
4696
4697
4698
4699
        /**
         * @desc Sending behaviour test cases for certificates profile
         * @see ETSI TS 103 096-2 V1.2.2 (2016-01) Clause 5.2.7 Profiles for certificates
         */
        group sendCertificatesProfile {
4700
4701
            
            /**
garciay's avatar
garciay committed
4702
             * @desc    Check that AT certificate has version 2
4703
             * <pre>
4704
             * Pics Selection: PICS_GN_SECURITY
4705
4706
             * Config Id: CF01
             * Initial conditions:
garciay's avatar
garciay committed
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
             * 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'
             *   }
             * }
4725
             * </pre>
garciay's avatar
garciay committed
4726
4727
             * @see         ETSI TS 103 096-2 v1.2.2 TP_SEC_ITSS_SND_CERT_01_01_BV
             * @reference   ETSI TS 103 097 [1], clauses 6.1 and 7.4.1
4728
             */
garciay's avatar
garciay committed
4729
            testcase TC_SEC_SND_CERT_01_01_BV() runs on ItsGeoNetworking system ItsSecSystem {
4730
                // Local variables
4731
                
garciay's avatar
garciay committed
4732
                // Test control
4733
4734
4735
4736
                if (not(PICS_GN_SECURITY)) {
                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
                    stop;
                }
4737
                
garciay's avatar
garciay committed
4738
                // Test component configuration
4739
                f_cf01Up();
garciay's avatar
garciay committed
4740
                    
4741
                // Test adapter configuration
garciay's avatar
garciay committed
4742
                    
4743
4744
4745
4746
4747
                // Preamble
                f_prNeighbour();
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
garciay's avatar
garciay committed
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
                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
4779
4780
4781
4782
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
garciay's avatar
garciay committed
4783
            } // End of testcase TC_SEC_SND_CERT_01_01_BV
4784
4785
            
            /**
garciay's avatar
garciay committed
4786
             * @desc    Check that AA certificate has version 2
4787
             * <pre>
garciay's avatar
garciay committed
4788
             * Pics Selection: PICS_GN_SECURITY and not PICS_CERTIFICATE_SELECTION
4789
4790
             * Config Id: CF01
             * Initial conditions:
garciay's avatar
garciay committed
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
             * 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
             *             and containing certificates
             *                 indicating length > 0
             *                 and containing certificates[n] (0..N)
             *                     containing version
             *                         indicating '2'
             *   }
             * }
4811
             * </pre>
garciay's avatar
garciay committed
4812
4813
             * @see         ETSI TS 103 096-2 v1.2.2 TP_SEC_ITSS_SND_CERT_01_02_BV
             * @reference   ETSI TS 103 097 [1], clauses 6.1 and 7.4.1
4814
             */
garciay's avatar
garciay committed
4815
            testcase TC_SEC_SND_CERT_01_02_BV() runs on ItsGeoNetworking system ItsSecSystem {
4816
                // Local variables
garciay's avatar
garciay committed
4817
4818
4819
4820
                var SecuredMessage v_recv;
                var Certificate v_cert;
                var SignerInfo v_si;
                var HashedId8 v_digest;
4821
                
garciay's avatar
garciay committed
4822
                // Test control
4823
4824
4825
4826
                if (not(PICS_GN_SECURITY)) {
                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
                    stop;
                }
garciay's avatar
garciay committed
4827
4828
                    
                // Test component configuration
4829
                f_cf01Up();
garciay's avatar
garciay committed
4830
                    
4831
                // Test adapter configuration
garciay's avatar
garciay committed
4832
                    
4833
4834
4835
4836
                // Preamble
                f_prNeighbour();
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
garciay's avatar
garciay committed
4837
4838
4839
4840
4841
4842
4843
                // 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;
4844
                
garciay's avatar
garciay committed
4845
4846
4847
4848
4849
4850
4851
4852
                // Test Body
                tc_ac.start;
                alt {
                    [] geoNetworkingPort.receive(
                        mw_geoNwInd(
                            mw_geoNwSecPdu(
                                mdw_securedMessage(
                                    superset(
garciay's avatar
garciay committed
4853
4854
                                        mw_header_field_signer_info_certificate_chain
                    ))))) {
garciay's avatar
garciay committed
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
                        tc_ac.stop;
                        log("*** " & testcasename() & ": PASS: AA 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_chain
                    ))))) {
                        tc_ac.stop;
                        log("*** " & testcasename() & ": FAIL: AA certificate version mismatch or no AA cert received***");
                        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
4875
4876
4877
4878
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
garciay's avatar
garciay committed
4879
                
garciay's avatar
garciay committed
4880
            } // End of testcase TC_SEC_SND_CERT_01_02_BV
4881
4882
            
            /**
garciay's avatar
garciay committed
4883
4884
4885
             * @desc    Check that the references in the certificate chain are valid
             *          Check that signer_info type of all certificates in the chain are 'certificate_digest_with_sha256', 
             *          'certificate_digest_with_other_algorithm' or 'self'
4886
             * <pre>
4887
             * Pics Selection: PICS_GN_SECURITY
4888
4889
             * Config Id: CF01
             * Initial conditions:
garciay's avatar
garciay committed
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
             * with {
             *   the IUT being in the 'authorized' state
             *   the IUT being requested to include certificate chain in the next CAM
             * } 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
             *             and containing certificates
             *                 indicating length > 0
             *             and containing certificates[0]
             *                 containing signer_info
             *                     containing type
             *                         indicating 'certificate_digest_with_sha256'
             *                         or indicating 'certificate_digest_with_other_algorythm'
             *                     and containing digest
             *                         referenced to the trusted certificate
             *                 or containing signer_info
             *                     containing type
             *                         indicating 'self'
             *             and containing certificates[n] (1..N)
             *                 containing signer_info
             *                     containing type
             *                         indicating 'certificate_digest_with_sha256'
             *                         or indicating 'certificate_digest_with_other_algorythm'
             *                     and containing digest
             *                         referenced to the certificates[n-1]
             * }
4921
             * </pre>
garciay's avatar
garciay committed
4922
4923
             * @see         ETSI TS 103 096-2 v1.2.2 TP_SEC_ITSS_SND_CERT_02_01_BV
             * @reference   ETSI TS 103 097 [1], clause 4.2.10, 6.1 and 7.4.1
4924
             */
garciay's avatar
garciay committed
4925
            testcase TC_SEC_SND_CERT_02_01_BV() runs on ItsGeoNetworking system ItsSecSystem {
garciay's avatar
garciay committed
4926
4927
4928
4929
                // Local declarations
                var CertificateChain v_chain;
                var SignerInfo v_si;
                var HashedId8 v_digest;
4930
                
garciay's avatar
garciay committed
4931
                // Test control
4932
4933
4934
4935
                if (not(PICS_GN_SECURITY)) {
                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
                    stop;
                }
garciay's avatar
garciay committed
4936
4937
                    
                // Test component configuration
4938
                f_cf01Up();
garciay's avatar
garciay committed
4939
                    
4940
                // Test adapter configuration
garciay's avatar
garciay committed
4941
                    
4942
4943
4944
4945
                // Preamble
                f_prNeighbour();
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
garciay's avatar
garciay committed
4946
4947
4948
4949
4950
                log("*** " & testcasename() & ": INFO: Request and waiting for the message containing certificate chain  ***");
                tc_ac.start;
                if (not f_askAndWaitForCertificateChain(v_chain, f_generateDefaultCam())) {
                    log("*** " & testcasename() & ": INCONC: Expected message not received ***");
                    f_selfOrClientSyncAndVerdictPreamble(c_tbDone, e_timeout);
4951
                }
garciay's avatar
garciay committed
4952
4953
4954
4955
4956
4957
4958
4959
                tc_ac.stop;
                
                // Test Body
                for (var integer v_counter := lengthof(v_chain) - 1; v_counter > 1; v_counter := v_counter - 1) { // Loop on []N-1..1]
                    if (not f_getCertificateSignerInfo(v_chain[v_counter], v_si)) {
                        log("*** " & testcasename() & ": FAIL: Certificate[ " & int2str(v_counter) & "] doesn't contain signer info ***");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                    }
garciay's avatar
garciay committed
4960
                    if (not match(v_si.type_, e_certificate_digest_with_sha256) and not match(v_si.type_, e_certificate_digest_with_other_algorithm)) {
garciay's avatar
garciay committed
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
                        log("*** " & testcasename() & ": FAIL: Certificate is not signed with digest ***");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                    }
                    // signer_info.type indicates 'certificate_digest_with_sha256' or 'certificate_digest_with_other_algorythm'
                    
                    v_digest := f_calculateDigestFromCertificate(v_chain[v_counter - 1]);
                    if (not match (v_si.signerInfo.digest, v_digest)) {
                        log("*** " & testcasename() & ": FAIL: Certificate chain is not valid ***");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                    }
                } // End of 'for' statement
                // Process certificate[0]
                if (not f_getCertificateSignerInfo(v_chain[0], v_si)) {
                    log("*** " & testcasename() & ": FAIL: Certificate[0] doesn't contain signer info ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
4976
                }
garciay's avatar
garciay committed
4977
4978
4979
                // Process certificate[0]
                if (not match (v_si.type_, e_certificate_digest_with_sha256)) {
                    log("*** " & testcasename() & ": FAIL: Certificate[0] is not signed with digest ***");
4980
4981
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                }
garciay's avatar
garciay committed
4982
4983
4984
4985
                // signer_info.type indicates 'certificate_digest_with_sha256' only
                log("*** " & testcasename() & ": PASS: Certificate chain is well signed ***");
                f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                
4986
4987
4988
                // Postamble
                f_poNeighbour();
                f_cf01Down();
garciay's avatar
garciay committed
4989
                
garciay's avatar
garciay committed
4990
            } // End of testcase TC_SEC_SND_CERT_02_01_BV
4991
4992
            
            /**
garciay's avatar
garciay committed
4993
4994
4995
4996
             * @desc Check that the rectangular region validity restriction of the message signing certificate 
             *       contains not more than six valid rectangles; 
             *       Check that the rectangular region validity restriction of the message signing certificate is 
             *       continuous and does not contain any holes 
4997
             * <pre>
garciay's avatar
garciay committed
4998
             * Pics Selection: PICS_GN_SECURITY and PICS_USE_RECTANGULAR_REGION and PICS_CERTIFICATE_SELECTION
4999
             * Config Id: CF01
garciay's avatar
garciay committed
5000
             * with {
For faster browsing, not all history is shown. View entire blame