Newer
Older
* which is not an issuer of currently used AT certificate
* }
* ensure that {
* when {
* the IUT is requested to send a CAM
* } then {
* the IUT sends a SecuredMessage of type EtsiTs103097Data
* containing headerInfo
* containing the requestedCertificate
* indicating requested AA certificate CERT_TS_B_AA
* }
* }
* </pre>
*
* @see ETSI TS 103 096-2 v1.3.2 TP_SEC_ITSS_SND_CAM_14_BV
* @reference ETSI TS 103 097 [1] Clause 7.1.1
* IEEE 1609.2 [2], Clauses 6.3.9 & 8.2.4.2.3
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
*/
testcase TC_SEC_ITSS_SND_CAM_14_BV() runs on ItsGeoNetworking system ItsSecSystem {
// Local variables
const float c_certificateGenerationTime := 1.0;
timer t_maxTransInterval := c_certificateGenerationTime * 0.9;
var GeoNetworkingInd v_geoNwInd;
var ItsCam v_component;
var Certificate v_aa_certificate;
var HashedId8 v_hashedId8;
// Test control
if (not(PICS_GN_SECURITY) or not(PICS_SEC_P2P_AA_DISTRIBUTION)) {
log("*** " & testcasename() & ": ERROR: 'PICS_GN_SECURITY and PICS_SEC_P2P_AA_DISTRIBUTION' required for executing the TC ***");
stop;
}
// Test component configuration
f_cf01Up(); // Initialise IUT with CERT_IUT_A_AT signed with CERT_IUT_A_AA
// Test adapter configuration
// Preamble
f_prNeighbour();
f_readCertificate(cc_taCert_B_AA, v_aa_certificate);
f_getCertificateDigest(
cc_taCert_B_AA,
v_hashedId8
);
geoNetworkingPort.clear;
v_component := f_setCamFrequencyGreatherThan1Hz();
tc_ac.start;
alt {
[] geoNetworkingPort.receive(
mw_geoNwInd(
mw_geoNwSecPdu(
mw_etsiTs103097Data_signed(
mw_signedData(
-,
mw_toBeSignedData(
mw_signedDataPayload,
mw_headerInfo_cam
),
mw_signerIdentifier_certificate // containing certificate
)
),
mw_geoNwShbPacket
))) {
tc_ac.stop;
t_maxTransInterval.start;
log("*** " & testcasename() & ": INFO: Initial conditions: First CA message with certificate received ***");
// Send secured message with request for the currently used AT certificate
f_sendSecuredCam(
cc_taCert_A,
valueof(
m_headerInfo_cam(
-,
f_computeGnTimestamp(),
-,
{ f_HashedId3FromHashedId8(v_hashedId8) }
)),
valueof(
m_signerIdentifier_digest(
v_hashedId8
)
)
);
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
}
[] tc_ac.timeout {
log("*** " & testcasename() & ": INCONC: Initial conditions: CA message with certificate not received ***");
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout);
}
} // End of 'alt' statement
// Test Body
tc_ac.start;
alt {
[] geoNetworkingPort.receive(
mw_geoNwInd(
mw_geoNwSecPdu(
mw_etsiTs103097Data_signed(
mw_signedData(
-,
mw_toBeSignedData(
mw_signedDataPayload,
mw_headerInfo_cam(
v_aa_certificate
)
)
)
),
mw_geoNwShbPacket
))) -> value v_geoNwInd {
tc_ac.stop;
t_maxTransInterval.stop;
log("*** " & testcasename() & ": PASS: Generation of CAM messages including certificate ***");
f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
}
[] t_maxTransInterval.timeout {
tc_ac.stop;
log("*** " & testcasename() & ": FAIL: The certificate chain has not been received during 1 sec ***");
f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
}
[] tc_ac.timeout {
log("*** " & testcasename() & ": INCONC: Expected CA message not received ***");
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
}
} // End of 'alt' statement
// Postamble
f_terminateCam(v_component);
f_poNeighbour();
f_cf01Down();
} // End of testcase TC_SEC_ITSS_SND_CAM_14_BV
/**
* @desc Check that the IUT doesn't send a secured CAM containing the AA certificate in the requestedCertificate
* headerInfo field when it was previously requested and already received from another ITS-S.
* <pre>
* Pics Selection: PICS_GN_SECURITY, PICS_SEC_P2P_AA_DISTRIBUTION
* Config Id: CF01
* Initial conditions:
* with {
* the IUT is authorized with AT certificate (CERT_IUT_A_AT)
* issued by the AA certificate (CERT_IUT_A_AA)
* and the IUT is configured to send more than one CAM per second
* and the IUT having already sent a CAM
* containing signer
* containing certificate
* at TIME_1
* and the IUT having received a CAM
* containing inlineP2pcdRequest
* containing HashedId3 value
* indicating last 3 octets of the digest of CERT_IUT_A_AA
* }
* ensure that {
* when {
* the IUT is requested to send a secured CAM
* } then {
* the IUT sends a SecuredMessage of type EtsiTs103097Data
* containing headerInfo
* does not containing requestedCertificate
* }
* }
* </pre>
*
* @see ETSI TS 103 096-2 v1.3.2 TP_SEC_ITSS_SND_CAM_15_BV
* @reference ETSI TS 103 097 [1] Clause 7.1.1
* IEEE 1609.2 [2], Clauses 6.3.9 & 8.2.4.2.3
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
*/
testcase TC_SEC_ITSS_SND_CAM_15_BV() runs on ItsGeoNetworking system ItsSecSystem {
// Local variables
const float c_certificateGenerationTime := 0.8;
timer t_maxTransInterval := c_certificateGenerationTime * 0.9;
var GeoNetworkingInd v_geoNwInd;
var ItsCam v_component;
var Certificate v_aa_certificate;
var HashedId8 v_hashedId8;
// Test control
if (not(PICS_GN_SECURITY) or not(PICS_SEC_P2P_AA_DISTRIBUTION)) {
log("*** " & testcasename() & ": ERROR: 'PICS_GN_SECURITY and PICS_SEC_P2P_AA_DISTRIBUTION' required for executing the TC ***");
stop;
}
// Test component configuration
f_cf01Up(); // Initialise IUT with CERT_IUT_A_AT signed with CERT_IUT_A_AA
// Test adapter configuration
// Preamble
f_prNeighbour();
f_readCertificate(cc_taCert_AA, v_aa_certificate);
f_getCertificateDigest(
cc_taCert_AA,
v_hashedId8
);
geoNetworkingPort.clear;
v_component := f_setCamFrequencyGreatherThan1Hz();
tc_ac.start;
alt {
[] geoNetworkingPort.receive(
mw_geoNwInd(
mw_geoNwSecPdu(
mw_etsiTs103097Data_signed(
mw_signedData(
-,
mw_toBeSignedData(
mw_signedDataPayload,
mw_headerInfo_cam
),
mw_signerIdentifier_certificate // containing certificate
)
),
mw_geoNwShbPacket
))) {
tc_ac.stop;
t_maxTransInterval.start;
log("*** " & testcasename() & ": INFO: Initial conditions: First CA message with certificate received ***");
// Send secured message with request for the currently used AT certificate
f_sendSecuredCam(
cc_taCert_A,
valueof(
m_headerInfo_cam(
-,
f_computeGnTimestamp(),
-,
{ f_HashedId3FromHashedId8(v_hashedId8) }
)),
valueof(
m_signerIdentifier_digest(
v_hashedId8
)
)
);
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
}
[] tc_ac.timeout {
log("*** " & testcasename() & ": INCONC: Initial conditions: CA message with certificate not received ***");
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout);
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
}
} // End of 'alt' statement
// Test Body
tc_ac.start;
alt {
[] geoNetworkingPort.receive(
mw_geoNwInd(
mw_geoNwSecPdu(
mw_etsiTs103097Data_signed(
mw_signedData(
-,
mw_toBeSignedData(
mw_signedDataPayload,
mw_headerInfo_cam
)
)
),
mw_geoNwShbPacket
))) -> value v_geoNwInd {
tc_ac.stop;
t_maxTransInterval.stop;
log("*** " & testcasename() & ": PASS: Generation of CAM messages including certificate ***");
f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
}
[] t_maxTransInterval.timeout {
tc_ac.stop;
log("*** " & testcasename() & ": FAIL: The certificate chain has not been received during 1 sec ***");
f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
}
[] tc_ac.timeout {
log("*** " & testcasename() & ": INCONC: Expected CA message not received ***");
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
}
} // End of 'alt' statement
// Postamble
f_terminateCam(v_component);
f_poNeighbour();
f_cf01Down();
} // End of testcase TC_SEC_ITSS_SND_CAM_15_BV
/**
* @desc Check that the IUT doesn't send a secured CAM containing the AA certificate in the requestedCertificate
* headerInfo field when it contains certificate in the signer field.
* <pre>
* Pics Selection: PICS_GN_SECURITY, PICS_SEC_P2P_AA_DISTRIBUTION
* Config Id: CF01
* Initial conditions:
* with {
* the IUT is authorized with AT certificate (CERT_IUT_A_AT)
* issued by the AA certificate (CERT_IUT_A_AA)
* and the IUT is configured to send more than one CAM per second
* and the IUT having already sent a CAM
* containing signer
* containing certificate
* at TIME_1
* and the IUT having received a CAM
* containing inlineP2pcdRequest
* containing HashedId3 value
* indicating last 3 octets of the digest of CERT_IUT_A_AA
* }
* ensure that {
* when {
* the IUT is requested to send a secured CAM
* } then {
* the IUT sends a SecuredMessage of type EtsiTs103097Data
* containing headerInfo
* does not containing requestedCertificate
* and containing signer
* containing certificate
* }
* }
* </pre>
*
* @see ETSI TS 103 096-2 v1.3.2 TP_SEC_ITSS_SND_CAM_16_BV
* @reference ETSI TS 103 097 [1] Clause 7.1.1
* IEEE 1609.2 [2], Clauses 6.3.9 & 8.2.4.2.3
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
*/
testcase TC_SEC_ITSS_SND_CAM_16_BV() runs on ItsGeoNetworking system ItsSecSystem {
// Local variables
const float c_certificateGenerationTime := 0.8;
timer t_maxTransInterval := c_certificateGenerationTime * 0.9;
var GeoNetworkingInd v_geoNwInd;
var ItsCam v_component;
var Certificate v_aa_certificate;
var HashedId8 v_hashedId8;
// Test control
if (not(PICS_GN_SECURITY) or not(PICS_SEC_P2P_AA_DISTRIBUTION)) {
log("*** " & testcasename() & ": ERROR: 'PICS_GN_SECURITY and PICS_SEC_P2P_AA_DISTRIBUTION' required for executing the TC ***");
stop;
}
// Test component configuration
f_cf01Up(); // Initialise IUT with CERT_IUT_A_AT signed with CERT_IUT_A_AA
// Test adapter configuration
// Preamble
f_prNeighbour();
f_readCertificate(cc_taCert_AA, v_aa_certificate);
f_getCertificateDigest(
cc_taCert_AA,
v_hashedId8
);
geoNetworkingPort.clear;
v_component := f_setCamFrequencyGreatherThan1Hz();
tc_ac.start;
alt {
[] geoNetworkingPort.receive(
mw_geoNwInd(
mw_geoNwSecPdu(
mw_etsiTs103097Data_signed(
mw_signedData(
-,
mw_toBeSignedData(
mw_signedDataPayload,
mw_headerInfo_cam
),
mw_signerIdentifier_certificate // containing certificate
)
),
mw_geoNwShbPacket
))) {
tc_ac.stop;
t_maxTransInterval.start;
log("*** " & testcasename() & ": INFO: Initial conditions: First CA message with certificate received ***");
// Send secured message with request for the currently used AT certificate
f_sendSecuredCam(
cc_taCert_A,
valueof(
m_headerInfo_cam(
-,
f_computeGnTimestamp(),
-,
{ f_HashedId3FromHashedId8(v_hashedId8) }
)),
valueof(
m_signerIdentifier_digest(
v_hashedId8
)
)
);
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
}
[] tc_ac.timeout {
log("*** " & testcasename() & ": INCONC: Initial conditions: CA message with certificate not received ***");
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout);
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
}
} // End of 'alt' statement
// Test Body
tc_ac.start;
alt {
[] geoNetworkingPort.receive(
mw_geoNwInd(
mw_geoNwSecPdu(
mw_etsiTs103097Data_signed(
mw_signedData(
-,
mw_toBeSignedData(
mw_signedDataPayload,
mw_headerInfo_cam
),
mw_signerIdentifier_certificate // containing certificate
)
),
mw_geoNwShbPacket
))) -> value v_geoNwInd {
tc_ac.stop;
t_maxTransInterval.stop;
log("*** " & testcasename() & ": PASS: Generation of CAM messages including certificate ***");
f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
}
[] geoNetworkingPort.receive(
mw_geoNwInd(
mw_geoNwSecPdu(
mw_etsiTs103097Data_signed(
mw_signedData(
-,
mw_toBeSignedData(
mw_signedDataPayload,
mw_headerInfo_cam
),
mw_signerIdentifier_digest // containing digest
)
),
mw_geoNwShbPacket
))) {
log("*** " & testcasename() & ": INFO: CA message retransmission w/o certificate ***");
repeat;
}
[] t_maxTransInterval.timeout {
tc_ac.stop;
log("*** " & testcasename() & ": FAIL: The certificate chain has not been received during 1 sec ***");
f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
}
[] tc_ac.timeout {
log("*** " & testcasename() & ": INCONC: Expected CA message not received ***");
f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
}
} // End of 'alt' statement
// Postamble
f_terminateCam(v_component);
f_poNeighbour();
f_cf01Down();
} // End of testcase TC_SEC_ITSS_SND_CAM_16_BV
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
/**
* @desc Check that the IUT send a secured CAM containing the AA certificate in the
* requestedCertificate headerInfo field with the next CAM containing digest
* as a signer info.
* <pre>
* Pics Selection: PICS_GN_SECURITY, PICS_SEC_P2P_AA_DISTRIBUTION
* Config Id: CF01
* Initial conditions:
* with {
* the IUT is authorized with AT certificate (CERT_IUT_A_AT)
* issued by the AA certificate (CERT_IUT_A_AA)
* and the IUT is configured to send more than one CAM per second
* and the IUT having already sent a CAM
* containing signer
* containing certificate
* at TIME_1
* and the IUT having received a CAM
* containing inlineP2pcdRequest
* containing HashedId3 value
* indicating last 3 octets of the digest of CERT_IUT_A_AA
* at TIME_2 (TIME_1 < TIME_2 < TIME_1 + 1sec)
* }
* ensure that {
* when {
* the IUT is sending a first subsequent secured CAM
* containing signer
* containing digest
* } then {
* this message
* containing headerInfo
* containing requestedCertificate
* indicating requested AA certificate CERT_IUT_A_AA
* }
* }
* </pre>
*
* @see ETSI TS 103 096-2 v1.3.2 TP_SEC_ITSS_SND_CAM_17_BV
* @reference ETSI TS 103 097 [1] Clause 7.1.1
* IEEE 1609.2 [2], Clauses 6.3.9 & 8.2.4.2.3
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
*/
testcase TC_SEC_ITSS_SND_CAM_17_BV() runs on ItsGeoNetworking system ItsSecSystem {
// Local variables
var GeoNetworkingInd v_geoNwInd;
var ItsCam v_component;
var Certificate v_aa_certificate;
var HashedId8 v_hashedId8;
// Test control
if (not(PICS_GN_SECURITY) or not(PICS_SEC_P2P_AA_DISTRIBUTION)) {
log("*** " & testcasename() & ": ERROR: 'PICS_GN_SECURITY and PICS_SEC_P2P_AA_DISTRIBUTION' required for executing the TC ***");
stop;
}
// Test component configuration
f_cf01Up(); // Initialise IUT with CERT_IUT_A_AT signed with CERT_IUT_A_AA
// Test adapter configuration
// Preamble
f_prNeighbour();
f_readCertificate(cc_taCert_AA, v_aa_certificate);
f_getCertificateDigest(
cc_taCert_AA,
v_hashedId8
);
geoNetworkingPort.clear;
v_component := f_setCamFrequencyGreatherThan1Hz();
tc_ac.start;
alt {
[] geoNetworkingPort.receive(
mw_geoNwInd(
mw_geoNwSecPdu(
mw_etsiTs103097Data_signed(
mw_signedData(
-,
mw_toBeSignedData(
mw_signedDataPayload,
mw_headerInfo_cam
),
mw_signerIdentifier_certificate // containing certificate
)
),
mw_geoNwShbPacket
))) {
tc_ac.stop;
log("*** " & testcasename() & ": INFO: Initial conditions: First CA message with certificate received ***");
// Send secured message with request for the currently used AT certificate
f_sendSecuredCam(
cc_taCert_A,
valueof(
m_headerInfo_cam(
-,
f_computeGnTimestamp(),
-,
{ f_HashedId3FromHashedId8(v_hashedId8) }
)),
valueof(
m_signerIdentifier_digest(
v_hashedId8
)
)
);
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
}
[] tc_ac.timeout {
log("*** " & testcasename() & ": INCONC: Initial conditions: CA message with certificate not received ***");
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout);
}
} // End of 'alt' statement
// Test Body
tc_ac.start;
alt {
[] geoNetworkingPort.receive(
mw_geoNwInd(
mw_geoNwSecPdu(
mw_etsiTs103097Data_signed(
mw_signedData(
-,
mw_toBeSignedData(
mw_signedDataPayload,
mw_headerInfo_cam(
v_aa_certificate
)
),
mw_signerIdentifier_digest // containing digest
)
),
mw_geoNwShbPacket
))) -> value v_geoNwInd {
tc_ac.stop;
log("*** " & testcasename() & ": PASS: Generation of CAM messages including certificate ***");
f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
}
[] tc_ac.timeout {
log("*** " & testcasename() & ": INCONC: Expected CA message not received ***");
f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
}
} // End of 'alt' statement
// Postamble
f_terminateCam(v_component);
f_poNeighbour();
f_cf01Down();
} // End of testcase TC_SEC_ITSS_SND_CAM_17_BV
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
/**
* @desc Check that IUT sends the secured CAM containing generation time and this time is inside the validity period of the signing certificate;
* Check that message generation time value is realistic
* <pre>
* Pics Selection: PICS_GN_SECURITY
* Config Id: CF01
* Initial conditions:
* with {
* the IUT is authorized with AT certificate (CERT_IUT_A_AT)
* }
* ensure that {
* when {
* the IUT is requested to send a CAM
* } then {
* the IUT sends a SecuredMessage of type EtsiTs103097Data
* containing headerInfo
* containing generationTime
* indicating TIME_1 (CUR_TIME - 5min <= TIME_1 <= CUR_TIME + 5min)
* and containing signer
* containing certificate
* containing toBeSigned
* containing validityPeriod
* containing start
* indicating value X_START_VALIDITY (X_START_VALIDITY <= GEN_TIME)
* and containing duration
* indicating value > GEN_TIME - X_START_VALIDITY
* }
* }
* </pre>
* @see ETSI TS 103 096-2 v1.3.2 TP_SEC_ITSS_SND_CAM_18_BV
* @reference ETSI TS 103 097 [1] Clauses 7.1.1
* @reference IEEE 1609.2 [2], Clauses 5.2.3.2.2, 5.2.4.2.2, 5.2.4.2.3
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
*/
testcase TC_SEC_ITSS_SND_CAM_18_BV() runs on ItsGeoNetworking system ItsSecSystem {
// Local variables
const integer c_timeLimit := 5 * 60 * 1000000; // us
var GeoNetworkingInd v_geoNwInd;
var HeaderInfo v_headerInfo;
var Time64 v_generationTime;
var Time64 v_curTime;
var SignerIdentifier v_signerIdentifier;
var ValidityPeriod v_validityPeriod;
var Certificate v_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(); // Initialise IUT with CERT_IUT_A_AT signed with CERT_IUT_A_AA
// Test adapter configuration
// Preamble
f_prNeighbour();
geoNetworkingPort.clear;
tc_ac.start;
alt {
[] geoNetworkingPort.receive(
mw_geoNwInd(
mw_geoNwSecPdu(
mw_etsiTs103097Data_signed(
mw_signedData(
-,
mw_toBeSignedData(
mw_signedDataPayload,
mw_headerInfo_cam
),
mw_signerIdentifier_certificate // containing certificate
)
),
mw_geoNwShbPacket
))) {
tc_ac.stop;
log("*** " & testcasename() & ": INFO: Initial conditions: First CA message with certificate received ***");
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
}
[] tc_ac.timeout {
log("*** " & testcasename() & ": INCONC: Initial conditions: CA message with certificate not received ***");
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout);
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
}
} // End of 'alt' statement
// Test Body
tc_ac.start;
alt {
[] geoNetworkingPort.receive(
mw_geoNwInd(
mw_geoNwSecPdu(
mw_etsiTs103097Data_signed(
mw_signedData(
-,
mw_toBeSignedData(
mw_signedDataPayload,
mw_headerInfo_cam
),
mw_signerIdentifier_certificate // containing certificate
)
),
mw_geoNwShbPacket
))) -> value v_geoNwInd {
tc_ac.stop;
f_getMsgHeaderInfo(f_getSecuredMessage(v_geoNwInd.msgIn), v_headerInfo);
v_generationTime := v_headerInfo.generationTime;
v_curTime := f_getCurrentTime();
v_curTime := v_curTime * 1000; // Time64 is in microseconds
log("v_curTime (us)=", v_curTime);
// Check generation time
if (not match(v_generationTime, Time64:(v_curTime - c_timeLimit, v_curTime + c_timeLimit))) {
log("*** " & testcasename() & ": FAIL: CA message generation time is not in 5 min range");
f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
} else {
// Check certificate validity period
f_getMsgSignerIdentifier (f_getSecuredMessage(v_geoNwInd.msgIn), v_signerIdentifier);
if (not match(v_signerIdentifier.certificate[0].toBeSigned.validityPeriod.start_, Time32:(v_curTime - c_timeLimit, v_curTime + c_timeLimit))) {
log("*** " & testcasename() & ": FAIL: CA message certificate validity period is not in 5 min range");
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
} else {
log("*** " & testcasename() & ": PASS: Generation of CAM messages including certificate was successful ***");
f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
}
}
}
[] geoNetworkingPort.receive(
mw_geoNwInd(
mw_geoNwSecPdu(
mw_etsiTs103097Data_signed(
mw_signedData(
-,
mw_toBeSignedData(
mw_signedDataPayload,
mw_headerInfo_cam
),
mw_signerIdentifier_digest
)
),
mw_geoNwShbPacket
))) {
log("*** " & testcasename() & ": INFO: CA message retransmission with digest ***");
repeat;
}
[] tc_ac.timeout {
log("*** " & testcasename() & ": INCONC: Expected CA message not received ***");
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
}
} // End of 'alt' statement
// Postamble
f_poNeighbour();
f_cf01Down();
} // End of testcase TC_SEC_ITSS_SND_CAM_18_BV
/**
* @desc Check that IUT sends the secured CAM containing the 'data' field in signed data payload,
* containing the EtsiTs103097Data of type unsecured, contained the CAM payload
* <pre>
* Pics Selection: PICS_GN_SECURITY
* Config Id: CF01
* Initial conditions:
* with {
* the IUT is authorized with AT certificate (CERT_IUT_A_AT)
* }
* ensure that {
* when {
* the IUT is requested to send a secured CAM
* } then {
* the IUT sends a message of type EtsiTs103097Data
* contains content
* contains signedData
* containing tbsData
* containing payload
* containing data
* containing content
* containing unsecuredData
* containing not-empty data
* }
* }
* </pre>
*
* @see ETSI TS 103 096-2 v1.3.2 TP_SEC_ITSS_SND_CAM_19_BV
* @reference ETSI TS 103 097 [1] Clauses 5.2 & 7.1.1
*/
testcase TC_SEC_ITSS_SND_CAM_19_BV() runs on ItsGeoNetworking system ItsSecSystem {
// Local variables
// Test control
if (not(PICS_GN_SECURITY)) {
log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
stop;
}
// Test component configuration
f_cf01Up(); // Initialise IUT with CERT_IUT_A_AT signed with CERT_IUT_A_AA
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
// Test adapter configuration
// Preamble
f_prNeighbour();
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
// Test Body
tc_ac.start;
alt {
[] geoNetworkingPort.receive(
mw_geoNwInd(
mw_geoNwSecPdu(
mw_etsiTs103097Data_signed(
mw_signedData(
-,
mw_toBeSignedData(
mw_signedDataPayload(
mw_ieee1609Dot2Data(
mw_ieee1609Dot2Data_unsecured
)),
mw_headerInfo_cam
)
)
)
))) {
tc_ac.stop;
log("*** " & testcasename() & ": PASS: CAM received with a well formated payload ***");
f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
}
[] tc_ac.timeout {
log("*** " & testcasename() & ": INCONC: Expected CA message not received ***");
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
}
} // End of 'alt' statement
// Postamble
f_poNeighbour();
f_cf01Down();
} // End of testcase TC_SEC_ITSS_SND_CAM_19_BV
/**
* @desc Check that the IUT sends the secured CAM signed with the certificate containing appPermisions
* allowing to sign CA messages
* <pre>
* Pics Selection: PICS_GN_SECURITY
* Config Id: CF01
* Initial conditions:
* with {
* the IUT is authorized with AT certificate (CERT_IUT_A_AT)
* }
* ensure that {
* when {
* the IUT is requested to send a secured CAM
* } then {
* the IUT sends a message of type EtsiTs103097Data
* containing signer
* containing certificate
* containing appPermissions
* containing an item of type PsidSsp
* containing psid = AID_CAM
* }
* }
* </pre>
*
* @see ETSI TS 103 096-2 v1.3.2 TP_SEC_ITSS_SND_CAM_20_BV
* @reference ETSI TS 103 097 [1] Clauses 7.2.1
* @reference IEEE 1609.2 [2], Clauses 5.2.3.2.2
*/
testcase TC_SEC_ITSS_SND_CAM_20_BV() runs on ItsGeoNetworking system ItsSecSystem {
// Local variables
// Test control
if (not(PICS_GN_SECURITY)) {
log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
stop;
}
// Test component configuration
f_cf01Up(); // Initialise IUT with CERT_IUT_A_AT signed with CERT_IUT_A_AA
// Test adapter configuration
// Preamble
f_prNeighbour();
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
// Test Body
tc_ac.start;
alt {
[] geoNetworkingPort.receive(
mw_geoNwInd(
mw_geoNwSecPdu(
mw_etsiTs103097Data_signed(
mw_signedData(
mw_toBeSignedData(
mw_signedDataPayload,
mw_headerInfo_cam
),
mw_signerIdentifier_certificate( // containing certificate
-,
mw_toBeSignedCertificate_at(
{ mw_appPermissions(c_its_aid_CAM) }
log("*** " & testcasename() & ": PASS: CAM received with a well formated certificate ***");
f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
}
[] geoNetworkingPort.receive(
mw_geoNwInd(
mw_geoNwSecPdu(
mw_etsiTs103097Data_signed(
mw_signedData(
-,
mw_toBeSignedData(
mw_signedDataPayload,
mw_headerInfo_cam
),
mw_signerIdentifier_digest
)
)
))) {
log("*** " & testcasename() & ": INFO: CA message with digest was received ***");
log("*** " & testcasename() & ": INCONC: Initial conditions: CA message with certificate not received ***");
f_selfOrClientSyncAndVerdictPreamble(c_tbDone, e_timeout);
}
} // End of 'alt' statement
// Postamble
f_poNeighbour();
f_cf01Down();
} // End of testcase TC_SEC_ITSS_SND_CAM_20_BV
/**
* @desc Check that IUT sends the secured CAM containing signature;
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
* Check that the signature is calculated over the right fields
* and using right hash algorythm by cryptographically verifying the signature
* <pre>
* Pics Selection: PICS_GN_SECURITY
* Config Id: CF01
* Initial conditions:
* with {
* the IUT is authorized with AT certificate (X_CERTIFICATE)
* }
* ensure that {
* when {
* the IUT is requested to send a secured CAM
* } then {
* the IUT sends a message of type EtsiTs103097Data
* containing signedData
* containing signer
* containing digest
* referencing the certificate X_CERTIFICATE
* or containing certificate
* indicating X_CERTIFICATE
* and containing signature
* containing X_SIGNATURE
* verifiable using KEY
* }
* }
* </pre>
*
* @see ETSI TS 103 096-2 v1.3.2 TP_SEC_ITSS_SND_CAM_21_BV
* @reference ETSI TS 103 097 [1] Clauses 5.2 & 7.1.1
* @reference IEEE 1609.2 [2], Clauses 5.3.1, 6.3.4, 6.3.29, 6.3.30, 6.3.31
*/
testcase TC_SEC_ITSS_SND_CAM_21_BV() runs on ItsGeoNetworking system ItsSecSystem {
// Local variables
var EtsiTs103097Certificate v_certificate;
var Signature v_signature;
var GeoNetworkingInd v_geoNwInd;
// Test control
if (not(PICS_GN_SECURITY)) {
log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");