Compare Revisions

The credentials to download the source code are:
 Username: svnusers
 Password: svnusers

Ignore whitespace Rev 1914 → Rev 1915

/branches/Security/ttcn/AtsSecurity/ItsSecurity_TestCases.ttcn3
157,7 → 157,7
*/
testcase TC_SEC_ITSS_SND_MSG_04_01() runs on ItsGeoNetworking system ItsSecSystem {
// Local declarations
// Local variables
var SecuredMessage v_recv;
var Certificate v_cert;
var LongPosVector v_longPosVectorIut;
254,7 → 254,7
*/
testcase TC_SEC_ITSS_SND_MSG_04_02() runs on ItsGeoNetworking system ItsSecSystem {
// Local declarations
// Local variables
var SecuredMessage v_recv;
var Certificate v_cert;
var LongPosVector v_longPosVectorIut;
265,9 → 265,11
stop;
}
// Test component configuration
// Test component configuration
f_cf01Up();
v_longPosVectorIut := f_getPosition(c_compIut);
// Test adapter configuration
// Preamble
f_prNeighbour();
334,7 → 336,7
*/
testcase TC_SEC_ITSS_SND_MSG_05_01() runs on ItsGeoNetworking system ItsSecSystem {
// Local declarations
// Local variables
var LongPosVector v_longPosVectorIut;
// Test control
343,9 → 345,11
stop;
}
// Test component configuration
// Test component configuration
f_cf01Up();
v_longPosVectorIut := f_getPosition(c_compIut);
// Test adapter configuration
// Preamble
f_prNeighbour();
769,15 → 773,15
var boolean v_nextCamWithCertificate := false;
// 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
if (not(PICS_GN_SECURITY)) {
log("*** " & testcasename() & ": ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
stop;
}
// Preamble
f_prNeighbour();
908,7 → 912,7
// Test control
if (not(PICS_GN_SECURITY)) {
log("*** " & testcasename() & ": ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
stop;
}
1055,7 → 1059,7
// Test control
if (not(PICS_GN_SECURITY)) {
log("*** " & testcasename() & ": ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
stop;
}
1081,7 → 1085,7
log("*** " & testcasename() & ": INFO: Initial conditions: First CAM message with certificate received ***");
// Send secured message from unknown ITS-S
f_sendSecuredCam(cc_taCertB);
f_sendSecuredCam(cc_taCert_B);
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
}
1210,7 → 1214,7
// Send secured message with request for unrecognized certificate
f_sendSecuredCam(
cc_taCertB,
cc_taCert_B,
{
m_header_field_unrecognised_certificate(
f_HashedId3FromHashedId8(
1354,7 → 1358,7
// Send secured message with request for unrecognized certificate
f_sendSecuredCam(
cc_taCertB,
cc_taCert_B,
{
m_header_field_unrecognised_certificate( // containing digests
f_HashedId3FromHashedId8( // containing HashedId3 value
1501,7 → 1505,7
// Send secured message with request for unrecognized certificate
f_sendSecuredCam(
cc_taCertB,
cc_taCert_B,
{
m_header_field_unrecognised_certificate( // containing digests
f_HashedId3FromHashedId8( // containing HashedId3 value
1763,13 → 1767,15
// Test control
if (not(PICS_GN_SECURITY)) {
log("*** " & testcasename() & ": ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
stop;
}
// Test component configuration
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
f_prNeighbour();
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
1858,17 → 1864,19
// Test control
if (not(PICS_GN_SECURITY)) {
log("*** " & testcasename() & ": ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
stop;
}
// Test component configuration
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
f_prNeighbour();
// Send secured message from unknown ITS-S
f_sendSecuredCam(cc_taCertB);
f_sendSecuredCam(cc_taCert_B);
geoNetworkingPort.clear;
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
1947,13 → 1955,15
// Test control
if (not(PICS_GN_SECURITY)) {
log("*** " & testcasename() & ": ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
stop;
}
// Test component configuration
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
f_prNeighbour();
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
2052,13 → 2062,15
// Test control
if (not(PICS_GN_SECURITY)) {
log("*** " & testcasename() & ": ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
stop;
}
// Test component configuration
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
f_prNeighbour();
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
4519,7 → 4531,7
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
// Test Body
v_securedGnPdu := f_sendSecuredCam(cc_taCertA, omit, e_certificate);
v_securedGnPdu := f_sendSecuredCam(cc_taCert_A, omit, e_certificate);
f_sleep(PX_TAC);
for (i := 0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, v_securedGnPdu.gnPacket.packet.payload.rawPayload); i := i + 1) {
4617,7 → 4629,7
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
// Test Body
v_securedGnPdu := f_sendSecuredCam(cc_taCertA, omit, e_certificate_digest_with_sha256);
v_securedGnPdu := f_sendSecuredCam(cc_taCert_A, omit, e_certificate_digest_with_sha256);
f_sleep(PX_TAC);
for (i := 0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, v_securedGnPdu.gnPacket.packet.payload.rawPayload); i := i + 1) {
4728,7 → 4740,7
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
// Test Body
v_securedGnPdu := f_sendSecuredCam(cc_taCertA, omit, e_certificate_chain);
v_securedGnPdu := f_sendSecuredCam(cc_taCert_A, omit, e_certificate_chain);
f_sleep(PX_TAC);
for (i := 0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, v_securedGnPdu.gnPacket.packet.payload.rawPayload); i := i + 1) {
4787,7 → 4799,7
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
// Test Body
v_securedGnPdu := f_prepareSecuredCam(cc_taCertA);
v_securedGnPdu := f_prepareSecuredCam(cc_taCert_A);
v_securedGnPdu.gnPacket.securedMsg.protocol_version := 1;
f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast(v_securedGnPdu));
4848,7 → 4860,7
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
// Test Body
v_securedGnPdu := f_prepareSecuredCam(cc_taCertA);
v_securedGnPdu := f_prepareSecuredCam(cc_taCert_A);
v_securedGnPdu.gnPacket.securedMsg.protocol_version := 3;
f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast(v_securedGnPdu));
4918,7 → 4930,7
// Test Body
v_securedGnPdu := f_prepareSecuredCam(
cc_taCertA,
cc_taCert_A,
{
m_header_field_signer_info(
m_signerInfo_digest(
4998,7 → 5010,7
// Test Body
v_securedGnPdu := f_prepareSecuredCam(
cc_taCertA,
cc_taCert_A,
{
m_header_field_generation_time(1000 * f_getCurrentTime()), // In us
m_header_field_its_aid_CAM
5062,7 → 5074,7
// Test Body
v_securedGnPdu := f_prepareSecuredCam(
cc_taCertA,
cc_taCert_A,
{
m_header_field_generation_time(1000 * f_getCurrentTime()), // In us
m_header_field_its_aid_CAM,
5139,7 → 5151,7
// Test Body
v_securedGnPdu := f_prepareSecuredCam(
cc_taCertA,
cc_taCert_A,
{
m_header_field_signer_info(
m_signerInfo_digest(
5222,7 → 5234,7
// Test Body
v_securedGnPdu := f_prepareSecuredCam(
cc_taCertA,
cc_taCert_A,
{
m_header_field_signer_info(
m_signerInfo_digest(
5306,7 → 5318,7
// Test Body
v_securedGnPdu := f_prepareSecuredCam(
cc_taCertA,
cc_taCert_A,
{
m_header_field_signer_info(
m_signerInfo_digest(
5394,7 → 5406,7
// Test Body
v_securedGnPdu := f_prepareSecuredCam(
cc_taCertA,
cc_taCert_A,
{
m_header_field_signer_info(
m_signerInfo_digest(
5475,7 → 5487,7
// Test Body
v_securedGnPdu := f_prepareSecuredCam(
cc_taCertA,
cc_taCert_A,
{
m_header_field_its_aid_DENM
}
5958,7 → 5970,7
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
// Test Body
v_securedGnPdu := f_prepareSecuredCam(cc_taCertA);
v_securedGnPdu := f_prepareSecuredCam(cc_taCert_A);
v_securedGnPdu.gnPacket.securedMsg.trailer_fields := {};
f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast(v_securedGnPdu));
6022,7 → 6034,7
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
// Test Body
v_securedGnPdu := f_prepareSecuredCam(cc_taCertA);
v_securedGnPdu := f_prepareSecuredCam(cc_taCert_A);
v_securedGnPdu.gnPacket.securedMsg.trailer_fields[1] := v_securedGnPdu.gnPacket.securedMsg.trailer_fields[0];
f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast(v_securedGnPdu));
6102,7 → 6114,7
// Test Body
v_securedGnPdu := f_prepareSecuredCam(
cc_taCertA,
cc_taCert_A,
omit,
e_certificate
);
6187,7 → 6199,7
// Test Body
v_securedGnPdu := f_prepareSecuredCam(
cc_taCertA,
cc_taCert_A,
omit,
e_certificate_digest_with_sha256
);
6258,7 → 6270,7
// Test Body
v_securedGnPdu := f_prepareSecuredCam(
cc_taCertF,
cc_taCert_F,
{
m_header_field_signer_info(
m_signerInfo_certificate(
6335,7 → 6347,7
// Test Body
v_securedGnPdu := f_prepareSecuredCam(
cc_taCertA,
cc_taCert_A,
{
m_header_field_signer_info(
m_signerInfo_certificate(
6447,7 → 6459,7
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
// Test Body
v_securedGnPdu := f_sendSecuredDenm(cc_taCertA, omit, e_certificate);
v_securedGnPdu := f_sendSecuredDenm(cc_taCert_A, omit, e_certificate);
f_sleep(PX_TAC);
for (i := 0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, v_securedGnPdu.gnPacket.packet.payload.rawPayload); i := i + 1) {
6551,7 → 6563,7
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
// Test Body
v_securedGnPdu := f_sendSecuredDenm(cc_taCertB, omit, e_certificate);
v_securedGnPdu := f_sendSecuredDenm(cc_taCert_B, omit, e_certificate);
f_sleep(PX_TAC);
for (i := 0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, v_securedGnPdu.gnPacket.packet.payload.rawPayload); i := i + 1) {
6657,7 → 6669,7
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
// Test Body
v_securedGnPdu := f_sendSecuredDenm(cc_taCertC, omit, e_certificate);
v_securedGnPdu := f_sendSecuredDenm(cc_taCert_C, omit, e_certificate);
f_sleep(PX_TAC);
for (i := 0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, v_securedGnPdu.gnPacket.packet.payload.rawPayload); i := i + 1) {
6763,7 → 6775,7
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
// Test Body
v_securedGnPdu := f_sendSecuredDenm(cc_taCertD, omit, e_certificate);
v_securedGnPdu := f_sendSecuredDenm(cc_taCert_D, omit, e_certificate);
f_sleep(PX_TAC);
for (i := 0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, v_securedGnPdu.gnPacket.packet.payload.rawPayload); i := i + 1) {
6869,7 → 6881,7
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
// Test Body
v_securedGnPdu := f_sendSecuredDenm(cc_taCertD, omit, e_certificate);
v_securedGnPdu := f_sendSecuredDenm(cc_taCert_D, omit, e_certificate);
f_sleep(PX_TAC);
for (i := 0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, v_securedGnPdu.gnPacket.packet.payload.rawPayload); i := i + 1) {
6928,7 → 6940,7
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
// Test Body
v_securedGnPdu := f_prepareSecuredDenm(cc_taCertA);
v_securedGnPdu := f_prepareSecuredDenm(cc_taCert_A);
v_securedGnPdu.gnPacket.securedMsg.protocol_version := 1;
f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast(v_securedGnPdu));
6989,7 → 7001,7
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
// Test Body
v_securedGnPdu := f_prepareSecuredDenm(cc_taCertA);
v_securedGnPdu := f_prepareSecuredDenm(cc_taCert_A);
v_securedGnPdu.gnPacket.securedMsg.protocol_version := 1;
f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast(v_securedGnPdu));
7054,7 → 7066,7
// Test Body
v_securedGnPdu := f_prepareSecuredDenm(
cc_taCertA,
cc_taCert_A,
{
m_header_field_its_aid_CAM
}
7129,7 → 7141,7
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
// Test Body
v_securedGnPdu := f_sendSecuredDenm(cc_taCertB, omit, e_certificate);
v_securedGnPdu := f_sendSecuredDenm(cc_taCert_B, omit, e_certificate);
f_sleep(PX_TNOAC);
if (lengthof(vc_utInds) == 0) {
7196,7 → 7208,7
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
// Test Body
v_securedGnPdu := f_sendSecuredDenm(cc_taCertC, omit, e_certificate);
v_securedGnPdu := f_sendSecuredDenm(cc_taCert_C, omit, e_certificate);
f_sleep(PX_TNOAC);
if (lengthof(vc_utInds) == 0) {
7263,7 → 7275,7
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
// Test Body
v_securedGnPdu := f_sendSecuredDenm(cc_taCertD, omit, e_certificate);
v_securedGnPdu := f_sendSecuredDenm(cc_taCert_D, omit, e_certificate);
f_sleep(PX_TNOAC);
if (lengthof(vc_utInds) == 0) {
7330,7 → 7342,7
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
// Test Body
v_securedGnPdu := f_sendSecuredDenm(cc_taCertE, omit, e_certificate);
v_securedGnPdu := f_sendSecuredDenm(cc_taCert_E, omit, e_certificate);
f_sleep(PX_TNOAC);
if (lengthof(vc_utInds) == 0) {
7383,16 → 7395,19
* @reference ETSI TS 103 097 V1.1.14, clause 6.1
*/
testcase TC_SEC_SND_CERT_01_01() 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();
// Test adapter configuration
if (not(PICS_GN_SECURITY)) {
log("*** " & testcasename() & ": ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
stop;
}
// Preamble
f_prNeighbour();
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
7466,21 → 7481,23
* @reference ETSI TS 103 097 V1.1.14, clause 6.1
*/
testcase TC_SEC_SND_CERT_01_02() runs on ItsGeoNetworking system ItsSecSystem {
// Local declarations
// Local variables
var SecuredMessage v_recv;
var Certificate v_cert;
var SignerInfo v_si;
var HashedId8 v_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
if (not(PICS_GN_SECURITY)) {
log("*** " & testcasename() & ": ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
stop;
}
// Preamble
f_prNeighbour();
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
7570,15 → 7587,17
var SignerInfo v_si;
var HashedId8 v_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
if (not(PICS_GN_SECURITY)) {
log("*** " & testcasename() & ": ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
stop;
}
// Preamble
f_prNeighbour();
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
7651,18 → 7670,28
* }
* }
* }
* @remark Certificate: cc_taCert_C
* </pre>
* @reference ETSI TS 103 097 V1.1.14, clauses 4.2.21, 4.2.24
*/
testcase TC_SEC_SND_CERT_04_01() runs on ItsGeoNetworking system ItsSecSystem {
// Local declarations
// Local variables
var Certificate v_cert;
var ValidityRestriction v_vr;
var integer v_counter;
// Test control
if (not(PICS_GN_SECURITY)) {
log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
stop;
}
// Test component configuration
vc_hashedId8ToBeUsed := cc_iutCert_C;
f_cf01Up();
// Test adapter configuration
// Preamble
f_prNeighbour();
f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
7761,15 → 7790,22
* @reference ETSI TS 103 097 V1.1.14, clauses 4.2.21, 4.2.24
*/
testcase TC_SEC_SND_CERT_04_02() runs on ItsGeoNetworking system ItsSecSystem {
// Local declarations
// Local variables
var CertificateChain v_chain;
var ValidityRestriction v_vr, v_vri; // current and issuing cert validity restrictions
var boolean f_vr, f_vri;
// 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);