Newer
Older
/**
* @desc Check that IUT sends the secured CAM containing the AA certificate in the requestedCertificate
* headerInfo field when it received a CAM containing a request for unrecognized certificate that
* matches with the currently used AA certificate ID of the IUT.
* <pre>
* Pics Selection: PICS_GN_SECURITY, PICS_SEC_P2P_AT_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 CAM
* } then {
* the IUT sends a CAM
* containing headerInfo
* and containing the requestedCertificate
* indicating requested AA certificate CERT_IUT_A_AA
* }
* }
* </pre>
*
* @see ETSI TS 103 096-2 v1.3.2 TP_SEC_ITSS_SND_CAM_13_BV
* @reference ETSI TS 103 097 [1] Clause 7.1.1
* IEEE 1609.2 [2], Clauses 6.3.9 & 8.2.4.2.3
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
*/
testcase TC_SEC_ITSS_SND_CAM_13_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_AT_DISTRIBUTION)) {
log("*** " & testcasename() & ": ERROR: 'PICS_GN_SECURITY and PICS_SEC_P2P_AT_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_iutCert_A_AA, v_aa_certificate);
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
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_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(
2130
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
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);
}
[] 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 ***");
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
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_13_BV
/**
* @desc Check that IUT sends the secured CAM containing the AA certificate in the requestedCertificate headerInfo
* field when it received a CAM containing a request for unrecognized certificate that matches with the known
* AA certificate ID which is not currently used by the IUT.
* <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)
* and the IUT is configured to send more than one CAM per second
* and the IUT is configured to know the AA certificate (CERT_TS_B_AA)
* 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_TS_B_AA
* 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
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
*/
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_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 ***");
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
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
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
*/
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_iutCert_A_AA, v_aa_certificate);
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
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_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 // does not containing requested 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 ***");
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
2507
2508
2509
2510
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
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
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
*/
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_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 // Not containing requestedCertificate
),
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 // Not containing requestedCertificate
),
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
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
2695
2696
2697
2698
2699
2700
2701
2702
2703
/**
* @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
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
*/
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_iutCert_A_AA, v_aa_certificate);
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
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_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
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
2841
2842
2843
2844
2845
/**
* @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
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
*/
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);
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
}
} // 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");
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
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 ***");
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
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
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 {