Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/**
* @author ETSI / STF481
* @version $URL$
* $Id$
* @desc Testcases file for Security Protocol
* @see Draft ETSI TS 103 097 V1.1.14
*/
module ItsSecurity_TestCases {
// Libcommon
import from LibCommon_Time all;
import from LibCommon_VerdictControl all;
import from LibCommon_Sync all;
// LibItsCommon
// import from LibItsCommon_TypesAndValues all;
import from LibItsCommon_Functions all;
// LibItsSecurity
import from LibItsSecurity_TypesAndValues all;
import from LibItsSecurity_Templates all;
import from LibItsSecurity_Functions all;
import from LibItsSecurity_Pixits all;
// LibItsGeoNetworking
import from LibItsGeoNetworking_TestSystem all;
import from LibItsGeoNetworking_Functions all;
import from LibItsGeoNetworking_Templates all;
import from LibItsGeoNetworking_TypesAndValues all;
import from LibItsGeoNetworking_Pics all;
import from LibItsGeoNetworking_Pixits all;
// LibItsBtp
import from LibItsBtp_TypesAndValues all;
import from LibItsBtp_Templates all;
// LibItsCam
import from LibItsCam_Templates all;
import from LibItsCam_Functions { group camGenerators } ;
// LibItsDenm
import from LibItsDenm_TypesAndValues all;
import from LibItsDenm_Templates {
template m_situation, m_denmLocation_zeroDelta, m_denm, m_denmMgmtCon, m_tsActionId
};
import from LibItsDenm_TestSystem all;
// AtsSecurity
import from AtsSecurity_TestSystem all;
import from AtsSecurity_Functions all;
import from AtsSecurity_Templates all;
group g_SecuredMessages {
/**
* @desc Check that ITS-S sends a SecuredMessage containing protocol version set to 2
* <pre>
* Pics Selection: none
* Config Id: CF01
* Initial conditions:
* with {
* the IUT being in the 'authorized' state
* }
* Expected behaviour:
* ensure that {
* when {
* the IUT is requested to send a SecuredMessage
* } then {
* the IUT sends a SecuredMessage
* containing protocol_version
* indicating value '2'
* }
* }
* </pre>
*
* @see Draft ETSI TS 103 097 V1.1.14 Clause 5.1 SecuredMessage
* @reference EN 302 636-4-1 [1], clauses 9.3.2 , 8.6.2 and Annex G
*/
testcase TC_SEC_ITSS_SND_MSG_01() runs on ItsGeoNetworking system ItsSecSystem {
// Local variables
var LongPosVector v_longPosVectorIut;
// Test control
if (not(PICS_GN_SECURITY)) {
log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
stop;
}
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
// Test component configuration
f_cf01Up();
v_longPosVectorIut := f_getPosition(c_compIut);
// Test adapter configuration
// Preamble
f_prNeighbour();
f_acTriggerEvent(m_startPassBeaconing(m_beaconHeader(v_longPosVectorIut).beaconHeader)); // Authorize the TA to forward the received beacons
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
// Test Body
tc_ac.start;
alt {
[] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwSecPdu(mdw_securedMessage_dummy))) {
tc_ac.stop;
log("*** " & testcasename() & ": PASS: Security protocol version set to 2 ***");
f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
}
[] tc_ac.timeout {
log("*** " & testcasename() & ": INCONC: Expected message not received ***");
f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
}
} // End of 'alt' statement
// Postamble
f_acTriggerEvent(m_stopPassBeaconing);
f_poNeighbour();
f_cf01Down();
} // End of testcase TC_SEC_ITSS_SND_MSG_01
/**
* @desc Check that IUT sends the message signed with the digest pointing to the AT certificate
* <pre>
* Pics Selection: PICS_GN_SECURITY
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
* Config Id: CF01
* Initial conditions:
* with {
* the IUT being in the 'authorized' state
* and the IUT is configured to send more than one CAM per second
* and the IUT having sent last CAM
* containing header_fields['signer_info'].signer.type
* indicating 'certificate'
* }
* Expected behaviour:
* ensure that {
* when {
* the IUT is requested to send next CAM
* } then {
* the IUT sends a SecuredMessage
* containing header_fields ['signer_info'] {
* containing signer {
* containing type
* indicating 'certificate_digest_with_sha256'
* containing digest
* referencing the certificate
* containing subject_info.subject_type
* indicating 'authorization_ticket'
* }
* }
* }
* }
* </pre>
*
* @see ETSI TS 103 097 V1.1.14, clause 6.3
* @reference EN 302 636-4-1 [1], clauses 9.3.2 , 8.6.2 and Annex G
*/
testcase TC_SEC_ITSS_SND_MSG_04_01() runs on ItsGeoNetworking system ItsSecSystem {
var SecuredMessage v_recv;
var Certificate v_cert;
var LongPosVector v_longPosVectorIut;
// Test control
if (not(PICS_GN_SECURITY)) {
log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
stop;
}
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
// Test component configuration
f_cf01Up();
v_longPosVectorIut := f_getPosition(c_compIut);
// Test adapter configuration
// Preamble
f_prNeighbour();
f_setCamFrequencyGreatherThan1Hz();
// execution will be stopped if cert is not received during tc_ac
log("*** " & testcasename() & ": INFO: Waiting for the message containing certificate ***");
tc_ac.start;
f_waitForCertificate(v_cert);
tc_ac.stop;
if (v_cert.subject_info.subject_type != e_authorization_ticket) {
log("*** " & testcasename() & ": FAIL: received certificate is not an AT certificate ***");
f_selfOrClientSyncAndVerdictTestBody(c_prDone, e_error);
}
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
// Test Body
tc_ac.start;
alt {
[] a_securedMessageWithDigest (v_recv) {
var SignerInfo v_si;
tc_ac.stop;
if (f_getMsgSignerInfo(v_recv, v_si) == true) {
if (v_si.signerInfo.digest == f_calculateDigestFromCertificate(v_cert)) {
log("*** " & testcasename() & ": PASS: Digest corresponds to the AT certificate ***");
f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
Loading full blame...