Newer
Older
//
// // Test adapter configuration
//
// // Preamble
// f_prNeighbour();
// f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
//
// // Test Body
// log("*** " & testcasename() & ": INFO: Waiting for the message containing certificate ***");
// tc_ac.start;
// if (not f_waitForCertificate(v_at_cert)) {
// log("*** " & testcasename() & ": INCONC: Expected message not received ***");
// f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
11014
11015
11016
11017
11018
11019
11020
11021
11022
11023
11024
11025
11026
11027
11028
11029
11030
11031
11032
11033
11034
11035
11036
11037
11038
11039
11040
11041
11042
// }
// tc_ac.stop;
// if (not match(v_at_cert, mw_at_certificate)) {
// log("*** " & testcasename() & ": FAIL: Message wasn't signed by AT certificate ***");
// f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
// }
// log("*** " & testcasename() & ": PASS: AT certificate has the 'authorization_ticket' subject_type ***");
// f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
//
// // Postamble
// f_poNeighbour();
// f_cf01Down();
// } // End of testcase TC_SEC_ITSS_SND_CERT_AT_01_01_BV
//
// /**
// * @desc Check that the subject_name variable-length vector is empty for AT certificates
// * <pre>
// * Pics Selection: PICS_GN_SECURITY
// * Config Id: CF01
// * with {
// * the IUT being in the 'authorized' state
// * the IUT being requested to include certificate in the next CAM
// * } ensure that {
// * when {
// * the IUT is requested to send a CAM
// * } then {
// * the IUT sends a Ieee1609Dot2Data
// * containing header_fields['signer_info'].signer
// * containing type
// * and containing certificates
// * containing subject_info.subject_name
// * indicating length = 0
// * }
// * }
// * </pre>
// * @see ETSI TS 103 096-2 v1.3.2 TP_SEC_ITSS_SND_CERT_AT_02_01_BV
// * @reference ETSI TS 103 097 [1] Clause 7.4.2
11052
11053
11054
11055
11056
11057
11058
11059
11060
11061
11062
11063
11064
11065
11066
11067
11068
11069
11070
11071
11072
11073
11074
11075
// */
// testcase TC_SEC_ITSS_SND_CERT_AT_02_01_BV() runs on ItsGeoNetworking system ItsSecSystem {
// var Certificate v_at_cert;
//
// // 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
// log("*** " & testcasename() & ": INFO: Waiting for the message containing certificate ***");
// tc_ac.start;
// if (not f_waitForCertificate(v_at_cert)) {
// log("*** " & testcasename() & ": INCONC: Expected message not received ***");
// f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
11077
11078
11079
11080
11081
11082
11083
11084
11085
11086
11087
11088
11089
11090
11091
11092
11093
11094
11095
11096
11097
11098
11099
11100
11101
11102
11103
11104
11105
// }
// tc_ac.stop;
// if (0 != lengthof(v_at_cert.subject_info.subject_name)) {
// log("*** " & testcasename() & ": FAIL: Subject name of the AT certificate is not empty ***");
// f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
// }
// log("*** " & testcasename() & ": PASS: Subject name of the AT certificate is empty ***");
// f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
//
// // Postamble
// f_poNeighbour();
// f_cf01Down();
// } // End of testcase TC_SEC_ITSS_SND_CERT_AT_02_01_BV
//
// /**
// * @desc Check that signer_info type of AT certificates is set to 'certificate_digest_with_sha256'
// * <pre>
// * Pics Selection: PICS_GN_SECURITY
// * Config Id: CF01
// * with {
// * the IUT being in the 'authorized' state
// * the IUT being requested to include certificate in the next CAM
// * } ensure that {
// * when {
// * the IUT is requested to send a CAM
// * } then {
// * the IUT sends a Ieee1609Dot2Data
// * containing header_fields['signer_info'].signer
// * containing type
// * and containing certificate
// * containing signer_info
// * containing type
// * indicating 'certificate_digest_with_sha256'
// * }
// * }
// * </pre>
// * @see ETSI TS 103 096-2 v1.3.2 TP_SEC_ITSS_SND_CERT_AT_03_01_BV
// * @reference ETSI TS 103 097 [1] Clauses 7.4.2
11116
11117
11118
11119
11120
11121
11122
11123
11124
11125
11126
11127
11128
11129
11130
11131
11132
11133
11134
11135
11136
11137
11138
11139
// */
// testcase TC_SEC_ITSS_SND_CERT_AT_03_01_BV() runs on ItsGeoNetworking system ItsSecSystem {
// var Certificate v_at_cert;
//
// // 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
// log("*** " & testcasename() & ": INFO: Waiting for the message containing certificate ***");
// tc_ac.start;
// if (not f_waitForCertificate(v_at_cert)) {
// log("*** " & testcasename() & ": INCONC: Expected message not received ***");
// f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
11141
11142
11143
11144
11145
11146
11147
11148
11149
11150
11151
11152
11153
11154
11155
11156
11157
11158
11159
11160
11161
11162
11163
11164
11165
11166
11167
11168
11169
11170
11171
// }
// tc_ac.stop;
// if (
// not match(v_at_cert, mw_certificate(mw_signerIdentifier_digest))
// ) {
// log("*** " & testcasename() & ": FAIL: AT certificate doesn't contain a digest of issuing cert ***");
// f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
// }
// log("*** " & testcasename() & ": PASS: The signer info of AT certificate is a digest ***");
// f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
//
// // Postamble
// f_poNeighbour();
// f_cf01Down();
// } // End of testcase TC_SEC_ITSS_SND_CERT_AT_03_01_BV
//
// /**
// * @desc Check that subject attributes are present and arranged in ascending order
// * <pre>
// * Pics Selection: PICS_GN_SECURITY
// * Config Id: CF01
// * with {
// * the IUT being in the 'authorized' state
// * the IUT being requested to include certificate in the next CAM
// * } ensure that {
// * when {
// * the IUT is requested to send a CAM
// * } then {
// * the IUT sends a Ieee1609Dot2Data
// * containing header_fields['signer_info'].signer
// * containing type
// * containing certificate
// * containing subject_attributes [0..N]
// * indicating subject_attributes[n].type < subject_attributes[n+ 1].type
// * containing subject_attributes['verification_key']
// * containing subject_attributes['assurance_level']
// * containing subject_attributes['its_aid_ssp_list']
// * }
// * }
// * </pre>
// * @see ETSI TS 103 096-2 v1.3.2 TP_SEC_ITSS_SND_CERT_AT_04_01_BV
// * @reference ETSI TS 103 097 [1] Clauses 7.4.1 and 7.4.2
11184
11185
11186
11187
11188
11189
11190
11191
11192
11193
11194
11195
11196
11197
11198
11199
11200
11201
11202
11203
11204
11205
11206
11207
11208
// */
// testcase TC_SEC_ITSS_SND_CERT_AT_04_01_BV() runs on ItsGeoNetworking system ItsSecSystem {
// var Certificate v_at_cert;
// var SubjectAttributes v_attrs;
//
// // 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
// log("*** " & testcasename() & ": INFO: Waiting for the message containing certificate ***");
// tc_ac.start;
// if (not f_waitForCertificate(v_at_cert)) {
// log("*** " & testcasename() & ": INCONC: Expected message not received ***");
// f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
11210
11211
11212
11213
11214
11215
11216
11217
11218
11219
11220
11221
11222
11223
11224
11225
11226
11227
11228
11229
11230
11231
11232
11233
11234
11235
11236
11237
11238
11239
11240
11241
11242
11243
11244
11245
11246
11247
11248
11249
11250
11251
11252
11253
11254
11255
11256
11257
11258
11259
11260
11261
11262
11263
11264
11265
11266
11267
11268
11269
11270
11271
11272
11273
11274
11275
11276
11277
11278
11279
11280
11281
11282
11283
11284
11285
// }
// tc_ac.stop;
// if (not match(
// v_at_cert,
// mw_at_certificate(
// ?,
// superset(
// mw_subject_attribute_verification_key,
// mw_subject_attribute_assurance_level,
// mw_subject_attribute_its_aid_ssp_list
// )))) {
// log("*** " & testcasename() & ": FAIL: Required subject attribute of AT certificate is not found ***");
// f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
// }
//
// v_attrs := v_at_cert.subject_attributes;
// for (var integer v_counter := 1; v_counter < lengthof(v_attrs); v_counter := v_counter + 1 ) {
// if (v_attrs[v_counter].type_ <= v_attrs[v_counter-1].type_) {
// log("*** " & testcasename() & ": FAIL: AT certificate subject attributes are not arranged in ascending order ***");
// f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
// }
// } // End of 'for' statement
//
// log("*** " & testcasename() & ": PASS: All required AT certificate subject attributes are presents and arranged in ascending order ***");
// f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
//
// // Postamble
// f_poNeighbour();
// f_cf01Down();
// } // End of testcase TC_SEC_ITSS_SND_CERT_AT_04_01_BV
//
// /**
// * @desc Check that time_start_and_end is included in the AT certificate validation restrictions
// * Check that time_start_and_end is inside the AA certificate time restrictions
// * Check that validity restriction of AT certificate is inside the validity restriction of its issuing certificate
// * <pre>
// * Pics Selection: PICS_GN_SECURITY
// * Config Id: CF01
// * 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 Ieee1609Dot2Data
// * containing header_fields['signer_info'].signer
// * containing type
// * indicating 'certificate_chain'
// * containing certificates[last]
// * containing subject_info.subject_type
// * indicating 'authorization_ticket' (1)
// * not containing validity_restrictions['time_end']
// * and not containing validity_restrictions['time_start_and_duration']
// * and containing validity_restrictions['time_start_and_end']
// * containing start_validity
// * indicating START_AT_VALIDITY
// * and containing end_validity
// * indicating END_AT_VALIDITY
// * and containing certificates[last-1]
// * containing validity_restrictions['time_end']
// * containing end_validity
// * indicating value > AT_END_VALIDITY
// * or containing validity_restrictions['time_start_and_end']
// * containing start_validity
// * indicating value <= AT_START_VALIDITY
// * containing end_validity
// * indicating value > AT_END_VALIDITY
// * or containing validity_restrictions['time_start_and_duration']
// * containing start_validity
// * indicating X_START_VALIDITY <= AT_START_VALIDITY
// * and containing duration
// * indicating value > AT_END_VALIDITY - X_START_VALIDITY
// * }
// * }
// * </pre>
// * @see ETSI TS 103 096-2 v1.3.2 TP_SEC_ITSS_SND_CERT_AT_05_01_BV
// * @reference ETSI TS 103 097 [1] Clause 7.4.2
11288
11289
11290
11291
11292
11293
11294
11295
11296
11297
11298
11299
11300
11301
11302
11303
11304
11305
11306
11307
11308
11309
11310
11311
11312
11313
// */
// testcase TC_SEC_ITSS_SND_CERT_AT_05_01_BV() runs on ItsGeoNetworking system ItsSecSystem {
// var SequenceOfCertificate v_chain;
// var Certificate v_aa_cert, v_at_cert;
// var ValidityRestriction v_vr, v_aa_vr;
//
// // 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
// 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_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
// }
// tc_ac.stop;
// if (lengthof(v_chain) < 2) {
// log("*** " & testcasename() & ": FAIL: Certificate chain is too short ***");
// f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
11320
11321
11322
11323
11324
11325
11326
11327
11328
11329
11330
11331
11332
11333
11334
11335
11336
11337
11338
11339
11340
11341
11342
11343
11344
11345
11346
11347
11348
11349
11350
11351
11352
11353
11354
11355
11356
11357
11358
11359
11360
11361
11362
11363
11364
11365
11366
11367
11368
11369
11370
11371
11372
11373
11374
11375
11376
11377
11378
11379
11380
11381
11382
11383
11384
11385
11386
11387
11388
11389
11390
11391
11392
11393
11394
11395
11396
11397
11398
11399
11400
11401
11402
11403
11404
11405
11406
11407
11408
11409
11410
11411
11412
11413
11414
11415
11416
// }
// v_aa_cert := v_chain[lengthof(v_chain) - 2];
// v_at_cert := v_chain[lengthof(v_chain) - 1];
// if (match (
// v_at_cert.validity_restrictions,
//
// superset(
// mw_validity_restriction_time_end,
// mw_validity_restriction_time_start_and_duration
// )
// )) {
// log("*** " & testcasename() & ": FAIL: AT certificate must not contain time_end and time_start_and_duration restrictions ***");
// f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
// }
//
// if ( true != f_getCertificateValidityRestriction(v_at_cert, e_time_start_and_end, v_vr)) {
// log("*** " & testcasename() & ": FAIL: AT certificate must contain time_start_and_end restrictions ***");
// f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
// }
//
// if (v_vr.validity.time_start_and_end.start_validity > v_vr.validity.time_start_and_end.end_validity ) {
// log("*** " & testcasename() & ": FAIL: start validity must not be greater then end validity in the validity restrictions of AT certificate ***");
// f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
// }
//
// if (true == f_getCertificateValidityRestriction(v_aa_cert, e_time_start_and_end, v_aa_vr)) {
// if (
// (v_vr.validity.time_start_and_end.start_validity < v_aa_vr.validity.time_start_and_end.start_validity) or
// (v_vr.validity.time_start_and_end.end_validity > v_aa_vr.validity.time_start_and_end.end_validity)
// ) {
// log("*** " & testcasename() & ": FAIL: AT certificate time validity restriction must be inside the AA certificate time validity restriction ***");
// f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
// }
// } else if (true == f_getCertificateValidityRestriction(v_aa_cert, e_time_end, v_aa_vr)) {
// if (v_vr.validity.time_start_and_end.end_validity > v_aa_vr.validity.end_validity) {
// log("*** " & testcasename() & ": FAIL: AT certificate time validity restriction must be inside the AA certificate time validity restriction ***");
// f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
// }
// } else if (true == f_getCertificateValidityRestriction(v_aa_cert, e_time_start_and_duration, v_aa_vr)) {
// var Time64 v_end := v_aa_vr.validity.time_start_and_duration.start_validity + f_duration2time(v_aa_vr.validity.time_start_and_duration.duration_);
// if (
// (v_vr.validity.time_start_and_end.start_validity < v_aa_vr.validity.time_start_and_duration.start_validity) or
// (v_vr.validity.time_start_and_end.end_validity > v_end)
// ) {
// log("*** " & testcasename() & ": FAIL: AT certificate time validity restriction must be inside the AA certificate time validity restriction ***");
// f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
// }
// } else {
// log("*** " & testcasename() & ": FAIL: Wrong AA certificate time restrictions ***");
// f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
// }
// log("*** " & testcasename() & ": PASS: Time validity restriction of the AT certificate is good ***");
// f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
//
// // Postamble
// f_poNeighbour();
// f_cf01Down();
// } // End of testcase TC_SEC_ITSS_SND_CERT_AT_05_01_BV
//
// /**
// * @desc Check that all AIDs containing in the its_aid_ssp_list in AT certificate are unique
// * Check that all AIDs containing in the its_aid_ssp_list in AT certificate are also containing in the
// * its_aid_list in the correspondent AA certificate
// * Check that the length of SSP of each AID is 31 octet maximum
// * <pre>
// * Pics Selection: PICS_GN_SECURITY
// * Config Id: CF01
// * 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 Ieee1609Dot2Data
// * containing header_fields['signer_info'].signer
// * containing type
// * indicating 'certificate_chain'
// * containing certificates[last-1]
// * containing subject_info.subject_type
// * indicating 'authorization_authority' (2)
// * containing subject_attributes['its_aid_list']
// * containing its_aid_list[0..N]
// * indicating ITS_AID_LIST_AA
// * containing certificates[last]
// * containing subject_info.subject_type
// * indicating 'authorization_ticket' (1)
// * containing subject_attributes['its_aid_ssp_list']
// * containing its_aid_ssp_list[0..N]
// * containing its_aid_ssp_list[n]
// * containing its_aid
// * indicating unique value containing in the ITS_AID_LIST_AA
// * containing service_specific_permissions
// * indicating length <= 31 octet
// * }
// * }
// * </pre>
// * @see ETSI TS 103 096-2 v1.3.2 TP_SEC_ITSS_SND_CERT_AT_07_01_BV
// * @reference ETSI TS 103 097 [1] Clauses 6.9 and 7.4.2
11419
11420
11421
11422
11423
11424
11425
11426
11427
11428
11429
11430
11431
11432
11433
11434
11435
11436
11437
11438
11439
11440
11441
11442
11443
11444
11445
11446
// */
// testcase TC_SEC_ITSS_SND_CERT_AT_07_01_BV() runs on ItsGeoNetworking system ItsSecSystem {
// var SequenceOfCertificate v_chain;
// var Certificate v_aa_cert, v_at_cert;
// var SubjectAttribute v_sa;
// var IntXs v_aid_list;
// var ItsAidSsps v_aid_ssp_list;
//
// // 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
// 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_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
// }
// tc_ac.stop;
// if (lengthof(v_chain) < 2) {
// log("*** " & testcasename() & ": FAIL: Certificate chain is too short ***");
// f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
11453
11454
11455
11456
11457
11458
11459
11460
11461
11462
11463
11464
11465
11466
11467
11468
11469
11470
11471
11472
11473
11474
11475
11476
11477
11478
11479
11480
11481
11482
11483
11484
11485
11486
11487
11488
11489
11490
11491
11492
11493
11494
11495
11496
11497
11498
11499
11500
11501
11502
11503
11504
11505
11506
11507
11508
11509
11510
11511
11512
11513
11514
11515
11516
11517
11518
11519
11520
11521
11522
11523
11524
11525
11526
11527
// }
// v_aa_cert := v_chain[lengthof(v_chain) - 2];
// v_at_cert := v_chain[lengthof(v_chain) - 1];
// if (not f_getCertificateSubjectAttribute(v_aa_cert, e_its_aid_list, v_sa)) {
// log("*** " & testcasename() & ": FAIL: AA certificate does not contain its_aid_list subject attribute ***");
// f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
// }
// v_aid_list := v_sa.attribute.its_aid_list;
//
// if (not f_getCertificateSubjectAttribute(v_at_cert, e_its_aid_ssp_list, v_sa)) {
// log("*** " & testcasename() & ": FAIL: AA certificate does not contain its_aid_list subject attribute ***");
// f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
// }
// v_aid_ssp_list := v_sa.attribute.its_aid_ssp_list;
//
// for (var integer v_counter :=0; v_counter < lengthof(v_aid_ssp_list); v_counter := v_counter + 1) {
// // Check unique
// for (var integer j :=0; j < lengthof(v_aid_ssp_list); j := j + 1) {
// if (v_counter != j and v_aid_ssp_list[v_counter].its_aid == v_aid_ssp_list[j].its_aid) {
// log("*** " & testcasename() & ": FAIL: ITS-AID " & int2str(v_aid_ssp_list[v_counter].its_aid) & " is duplicated in AT certificate ***");
// f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
// }
// } // End of 'for' statement
//// if (not match(v_aid_ssp_list[v_counter], (all from v_aid_list))) {
//// log("*** " & testcasename() & ": FAIL: ITS-AID " & int2str(v_aid_ssp_list[v_counter].its_aid) & " is not exist in AA certificate ***");
//// f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
//// }
// // TODO Not possible due to typing To be removed
//// if (lengthof(v_aid_ssp_list[v_counter].service_specific_permissions.sspContainer) > 31) {
//// log("*** " & testcasename() & ": FAIL: ITS-AID " & int2str(v_aid_ssp_list[v_counter].its_aid) & " has too long service_specific_permissions ***");
//// f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
//// }
// } // End of 'for' statement
//
// log("*** " & testcasename() & ": PASS: The ITS_AID_SSP list of the AT certificate is good ***");
// f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
//
// // Postamble
// f_poNeighbour();
// f_cf01Down();
// } // End of testcase TC_SEC_ITSS_SND_CERT_AT_07_01_BV
//
// /**
// * @desc Check that AT certificate is signed by AA cert
// * <pre>
// * Pics Selection: PICS_GN_SECURITY
// * Config Id: CF01
// * 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 Ieee1609Dot2Data
// * containing header_fields['signer_info'].signer
// * containing type
// * indicating 'certificate_chain'
// * containing certificates[last-1] (CERT_AA)
// * containing subject_info.subject_type
// * indicating 'authorization_authority' (2)
// * and containing subject_attributes['verification key'] (KEY)
// * containing certificates[last]
// * containing subject_info.subject_type
// * indicating 'authorization_ticket' (1)
// * and containing signer_info[0]
// * containing type
// * indicating 'certificate_digest_with_sha256'
// * containing digest
// * referencing to CERT_AA
// * and containing signature
// * verifiable using KEY
// * }
// * }
// * </pre>
// * @see ETSI TS 103 096-2 v1.3.2 TP_SEC_ITSS_SND_CERT_AT_08_01_BV
// * @reference ETSI TS 103 097 [1] Clause 6.3
11530
11531
11532
11533
11534
11535
11536
11537
11538
11539
11540
11541
11542
11543
11544
11545
11546
11547
11548
11549
11550
11551
11552
11553
11554
11555
11556
// */
// testcase TC_SEC_ITSS_SND_CERT_AT_08_01_BV() runs on ItsGeoNetworking system ItsSecSystem {
// var SequenceOfCertificate v_chain;
// var Certificate v_aa_cert, v_at_cert;
// var HashedId8 v_aa_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);
//
//
// // Test Body
// 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_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
// }
// tc_ac.stop;
// if (lengthof(v_chain) < 2) {
// log("*** " & testcasename() & ": FAIL: Certificate chain is too short ***");
// f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
11563
11564
11565
11566
11567
11568
11569
11570
11571
11572
11573
11574
11575
11576
11577
11578
11579
11580
11581
11582
11583
11584
11585
11586
11587
11588
11589
11590
11591
11592
11593
11594
11595
11596
11597
11598
11599
11600
// }
// v_at_cert := v_chain[lengthof(v_chain) - 1];
// v_aa_cert := v_chain[lengthof(v_chain) - 2];
// v_aa_digest := f_calculateDigestFromCertificate(v_aa_cert);
//
// if (not match(v_at_cert, mw_at_certificate(mw_signerIdentifier_digest(v_aa_digest)))) {
// log("*** " & testcasename() & ": FAIL: AT certificate signer info doesn't reference the AA certificate from the chain ***");
// f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
// }
//
// if (not f_verifyCertificateSignatureWithIssuingCertificate(v_at_cert, v_aa_cert)) {
// log("*** " & testcasename() & ": FAIL: AT certificate signature verification failed ***");
// f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
// }
//
// log("*** " & testcasename() & ": PASS: AT certificate was signed by the AA certificate from the given chain ***");
// f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
//
// // Postamble
// f_poNeighbour();
// f_cf01Down();
// } // End of testcase TC_SEC_ITSS_SND_CERT_AT_08_01_BV
//
// /**
// * @desc Check that all necessary validity restrictions are present and arranged in ascending order
// * <pre>
// * Pics Selection: PICS_GN_SECURITY
// * Config Id: CF01
// * with {
// * the IUT being in the 'authorized' state
// * the IUT being requested to include certificate in the next CAM
// * } ensure that {
// * when {
// * the IUT is requested to send a CAM
// * } then {
// * the IUT sends a Ieee1609Dot2Data
// * containing header_fields['signer_info'].signer
// * containing type
// * containing certificate
// * containing subject_attributes [0..N]
// * indicating subject_attributes[n].type < subject_attributes[n+ 1].type
// * containing subject_attributes['verification_key']
// * containing subject_attributes['assurance_level']
// * containing subject_attributes['its_aid_ssp_list']
// * }
// * }
// * </pre>
// * @see ETSI TS 103 096-2 v1.3.2 TP_SEC_ITSS_SND_CERT_AT_10_01_BV
// * @reference ETSI TS 103 097 [1] Clauses 6.1
11613
11614
11615
11616
11617
11618
11619
11620
11621
11622
11623
11624
11625
11626
11627
11628
11629
11630
11631
11632
11633
11634
11635
11636
11637
11638
// */
// testcase TC_SEC_ITSS_SND_CERT_AT_10_01_BV() runs on ItsGeoNetworking system ItsSecSystem {
// var Certificate v_at_cert;
// var ValidityRestriction v_vr;
// var ValidityRestrictions v_vrs;
//
// // 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
// log("*** " & testcasename() & ": INFO: Waiting for the message containing certificate ***");
// tc_ac.start;
// if (not f_waitForCertificate(v_at_cert)) {
// log("*** " & testcasename() & ": INCONC: Expected message not received ***");
// f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
11640
11641
11642
11643
11644
11645
11646
11647
11648
11649
11650
11651
11652
11653
11654
11655
11656
11657
11658
11659
11660
11661
11662
11663
11664
11665
11666
11667
11668
11669
// }
// tc_ac.stop;
// if (not match(
// v_at_cert,
// mw_at_certificate(
// mw_signerIdentifier_certificate
// ))) {
// }
//
// if (true != f_getCertificateValidityRestriction(v_at_cert.signer_info.signerInfo.certificate, e_time_start_and_end, v_vr)) {
// log("*** " & testcasename() & ": FAIL: Required 'time_start_and_end' validity_restriction attribute of AT certificate is not found ***");
// f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
// }
// v_vrs := v_at_cert.signer_info.signerInfo.certificate.validity_restrictions;
// for (var integer v_counter := 1; v_counter < lengthof(v_vrs); v_counter := v_counter + 1 ) {
// if (v_vrs[v_counter].type_ <= v_vrs[v_counter-1].type_) {
// log("*** " & testcasename() & ": FAIL: AT certificate subject attributes are not arranged in ascending order ***");
// f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
// }
// } // End of 'for' statement
//
// log("*** " & testcasename() & ": PASS: All required AT certificate subject attributes are presents and arranged in ascending order ***");
// f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
//
// // Postamble
// f_poNeighbour();
// f_cf01Down();
// } // End of testcase TC_SEC_ITSS_SND_CERT_AT_10_01_BV
//
// } // End of group AT_Certificates
} // End of group profileForCertificates
} // End of group sendingBehavior
/**
* @desc Receiver behaviour test cases
* @see ETSI TS 103 096-2 V1.3.32 (2018-01) Clause 5.3 Receiver behaviour
*/
group receiverBehavior {
* @desc Receiving behaviour test cases for CAM profile
* @see ETSI TS 103 096-2 V1.3.32 (2018-01) Clause 5.3.2 CAM Profile
11687
11688
11689
11690
11691
11692
11693
11694
11695
11696
11697
11698
11699
11700
11701
11702
11703
11704
11705
11706
// /**
// * @desc Check that IUT accepts a well-formed Secured CAM containing certificate in signer_info
// * <pre>
// * Pics Selection: PICS_GN_SECURITY
// * Config Id: CF01
// * Initial conditions:
// * with {
// * the IUT being in the 'authorized' state
// * and the IUT current time is inside the time validity period of CERT_TS_A_AT
// * }
// * ensure that {
// * when {
// * the IUT is receiving a Ieee1609Dot2Data
// * containing protocol_version
// * indicating value '2'
// * and containing header_fields[0]
// * containing type
// * indicating 'signer_info'
// * and containing signer
// * containing type
11708
11709
11710
11711
11712
11713
11714
11715
11716
11717
11718
11719
11720
11721
11722
11723
11724
11725
11726
11727
11728
11729
11730
11731
11732
11733
11734
11735
11736
11737
11738
11739
11740
// * and containing certificate (CERT_TS_AT_A)
// * containing subject_info.subject_type
// * indicating 'authorization_ticket' (2)
// * and containing subject_attributes['verification key'] (KEY)
// * and containing header_fields [1]
// * containing type
// * indicating 'generation_time'
// * containing generation_time
// * indicating CURRENT_TIME
// * and containing header_fields[2]
// * containing type
// * indicating 'its_aid'
// * containing its_aid
// * indicating 'AID_CAM'
// * and not containing any other header fields
// * and containing payload_field
// * containing type
// * indicating 'signed'
// * containing data
// * indicating length > 0
// * containing CAM 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 ETSI TS 103 096-2 v1.3.2 TP_SEC_ITSS_RCV_CAM_01_01_BV
// * @reference ETSI TS 103 097 [1] Clause 7.1
11743
11744
11745
11746
11747
11748
11749
11750
11751
11752
11753
11754
11755
11756
11757
11758
11759
11760
11761
11762
11763
11764
11765
11766
11767
11768
11769
11770
11771
11772
11773
11774
// */
// testcase TC_SEC_ITSS_RCV_CAM_01_01_BV() runs on ItsGeoNetworking system ItsSecSystem {
//
// // Local variables
// var integer i;
// var GeoNetworkingPdu v_securedGnPdu;
// var GnRawPayload v_sentRawPayload;
//
// // Test adapter configuration
// if (not(PICS_GN_SECURITY)) {
// log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
// stop;
// }
//
// // Test component configuration
// f_cf01Up();
//
// // Test adapter configuration
//
// // Preamble
// f_prNeighbour();
// f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
//
// // Test Body
// v_securedGnPdu := f_sendSecuredCam(cc_taCert_A, omit, e_certificate);
//
// f_sleep(PX_TNOAC);
// v_sentRawPayload := valueof(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: GN was transmitted to upper layer***");
// f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
// }
// else {
// log("*** " & testcasename() & ": FAIL: GN was not transmitted to upper layer***");
11780
11781
11782
11783
11784
11785
11786
11787
11788
11789
11790
11791
11792
11793
11794
11795
11796
11797
11798
11799
11800
11801
11802
11803
11804
11805
11806
11807
11808
11809
11810
11811
11812
11813
11814
11815
11816
11817
11818
11819
11820
11821
11822
11823
11824
11825
11826
11827
11828
11829
11830
11831
11832
11833
11834
11835
11836
11837
11838
11839
11840
11841
11842
11843
// f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
// }
//
// // Postamble
// f_poNeighbour();
// f_cf01Down();
// } // End of testcase TC_SEC_ITSS_RCV_CAM_01_01_BV
//
// /**
// * @desc Check that IUT accepts a well-formed Secured CAM containing certificate digest of the known certificate in signer_info
// * <pre>
// * Pics Selection: PICS_GN_SECURITY
// * Config Id: CF01
// * Initial conditions:
// * with {
// * the IUT being in the 'authorized' state
// * and the IUT current time is inside the time validity period of CERT_TS_A_AT
// * and the IUT already sent a Secured message containing certificate (CERT_TS_A_AT)
// * containing subject_info.subject_type
// * indicating 'authorization_ticket' (2)
// * and containing subject_attributes['verification key'] (KEY)
// * }
// * ensure that {
// * when {
// * the IUT is receiving a Ieee1609Dot2Data
// * containing protocol_version
// * indicating value '2'
// * and containing header_fields[0]
// * containing type
// * indicating 'signer_info'
// * and containing signer
// * containing type
// * indicating 'certificate_digest_with_sha256'
// * and containing digest
// * referencing to certificate (CERT_TS_A_AT)
// * and containing header_fields [1]
// * containing type
// * indicating 'generation_time'
// * containing generation_time
// * indicating CURRENT_TIME
// * and containing header_fields[2]
// * containing type
// * indicating 'its_aid'
// * containing its_aid
// * indicating 'AID_CAM'
// * and not containing any other header fields
// * and containing payload_field
// * containing type
// * indicating 'signed'
// * containing data
// * indicating length > 0
// * containing CAM 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 ETSI TS 103 096-2 v1.3.2 TP_SEC_ITSS_RCV_CAM_01_02_BV
// * @reference ETSI TS 103 097 [1] Clause 7.1
11846
11847
11848
11849
11850
11851
11852
11853
11854
11855
11856
11857
11858
11859
11860
11861
11862
11863
11864
11865
11866
11867
11868
11869
11870
11871
11872
11873
11874
11875
11876
11877
// */
// testcase TC_SEC_ITSS_RCV_CAM_01_02_BV() runs on ItsGeoNetworking system ItsSecSystem {
//
// // Local variables
// var integer i;
// var GeoNetworkingPdu v_securedGnPdu;
// var GnRawPayload v_sentRawPayload;
//
// // Test adapter configuration
// if (not(PICS_GN_SECURITY)) {
// log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
// stop;
// }
//
// // Test component configuration
// f_cf01Up();
//
// // Test adapter configuration
//
// // Preamble
// f_prNeighbour();
// f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
//
// // Test Body
// v_securedGnPdu := f_sendSecuredCam(cc_taCert_A, omit, e_certificate_digest_with_sha256);
//
// f_sleep(PX_TNOAC);
// v_sentRawPayload := valueof(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: GN was transmitted to upper layer***");
// f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
// }
// else {
// log("*** " & testcasename() & ": FAIL: GN was not transmitted to upper layer***");
11883
11884
11885
11886
11887
11888
11889
11890
11891
11892
11893
11894
11895
11896
11897
11898
11899
11900
11901
11902
11903
11904
11905
11906
11907
11908
11909
11910
11911
11912
11913
11914
11915
11916
11917
11918
11919
11920
11921
11922
11923
11924
11925
11926
11927
11928
11929
11930
11931
11932
11933
11934
11935
11936
11937
11938
11939
11940
11941
11942
11943
11944
11945
11946
11947
11948
11949
11950
11951
11952
11953
11954
11955
11956
// f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
// }
//
// // Postamble
// f_poNeighbour();
// f_cf01Down();
// } // End of testcase TC_SEC_ITSS_RCV_CAM_01_02_BV
//
// /**
// * @desc Check that IUT accepts a well-formed Secured CAM containing certificate chain in signer_info
// * <pre>
// * Pics Selection: PICS_GN_SECURITY
// * Config Id: CF01
// * Initial conditions:
// * with {
// * the IUT being in the 'authorized' state
// * and the IUT current time is inside the time validity period of CERT_TS_A_AT
// * }
// * ensure that {
// * when {
// * the IUT is receiving a Ieee1609Dot2Data
// * containing protocol_version
// * indicating value '2'
// * and containing header_fields[0]
// * containing type
// * indicating 'signer_info'
// * and containing signer
// * containing type
// * indicating 'certificate_chain'
// * and containing certificates
// * containing certificate (CERT_TS_A_AA) at index 0
// * containing subject_info.subject_type
// * indicating 'authorization_authority'
// * and containing subject_attributes['verification key'] (KEY_TS_AA)
// * and containing certificate (CERT_TS_A_AT) at index 1
// * containing subject_info.subject_type
// * indicating 'authorization_ticket'
// * and containing signer_info
// * containing type
// * indicating 'certificate_digest_with_sha256'
// * containing digest
// * referencing to the CERT_TS_A_AA
// * and containing signature
// * verifiable using KEY_TS_AA
// * and containing subject_attributes['verification key'] (KEY_TS_AT)
// * and containing header_fields [1]
// * containing type
// * indicating 'generation_time'
// * containing generation_time
// * indicating CURRENT_TIME
// * and containing header_fields[2]
// * containing type
// * indicating 'its_aid'
// * containing its_aid
// * indicating 'AID_CAM'
// * and not containing any other header fields
// * and containing payload_field
// * containing type
// * indicating 'signed'
// * containing data
// * indicating length > 0
// * containing CAM payload
// * and containing trailer_fields
// * containing single instance of type TrailerField
// * containing type
// * indicating 'signature'
// * containing signature
// * verifiable using KEY_TC_AT
// * } then {
// * the IUT accepts the message
// * }
// * }
// * </pre>
// *
// * @see ETSI TS 103 096-2 v1.3.2 TP_SEC_ITSS_RCV_CAM_01_03_BV
// * @reference ETSI TS 103 097 [1] Clause 7.1
11959
11960
11961
11962
11963
11964
11965
11966
11967
11968
11969
11970
11971
11972
11973
11974
11975
11976
11977
11978
11979
11980
11981
11982
11983
11984
11985
11986
11987
11988
11989
11990
// */
// testcase TC_SEC_ITSS_RCV_CAM_01_03_BV() runs on ItsGeoNetworking system ItsSecSystem {
//
// // Local variables
// var integer i;
// var GeoNetworkingPdu v_securedGnPdu;
// var GnRawPayload v_sentRawPayload;
//
// // Test adapter configuration
// if (not(PICS_GN_SECURITY)) {
// log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
// stop;
// }
//
// // Test component configuration
// f_cf01Up();
//
// // Test adapter configuration
//
// // Preamble
// f_prNeighbour();
// f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
//
// // Test Body
// v_securedGnPdu := f_sendSecuredCam(cc_taCert_A, -, e_certificate_chain);
//
// f_sleep(PX_TNOAC);
// v_sentRawPayload := valueof(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: GN was transmitted to upper layer***");
// f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
// }
// else {
// log("*** " & testcasename() & ": FAIL: GN was not transmitted to upper layer***");