Commit 9f3eb471 authored by garciay's avatar garciay
Browse files

Type conflict bugs fixed

parent 47feb5a0
......@@ -8,7 +8,7 @@
module ItsCam_TestCases {
// LibIts
// LibItsCam
import from LibItsCam_TestSystem all;
// Ats Its
......
......@@ -17,6 +17,9 @@ module ItsCam_TpFunctions {
import from LibCommon_BasicTypesAndValues all;
import from LibCommon_DataStrings all;
// LibIts
import from ITS_Container language "ASN.1:1997" all;
import from CAM_PDU_Descriptions language "ASN.1:1997" all;
// LibItsCommon
import from LibItsCommon_TypesAndValues all;
......@@ -24,16 +27,14 @@ module ItsCam_TpFunctions {
import from LibItsCommon_Functions all;
import from LibItsCommon_Pixits all;
// LibItsCAM
// LibItsCam
import from LibItsCam_TestSystem all;
import from LibItsCam_Functions all;
import from LibItsCam_Templates all;
import from LibItsCam_TypesAndValues all;
import from LibItsCam_Pics all;
import from LibItsCam_Pixits all;
// ASN.1
import from ITS_Container language "ASN.1:1997" all;
import from CAM_PDU_Descriptions language "ASN.1:1997" all;
// 5.2.1
group camMessageDissemination {
......
......@@ -14,8 +14,10 @@ module ItsGeoNetworking_TpFunctions {
import from LibCommon_VerdictControl all;
import from LibCommon_Sync all;
// LibIts
// LibItsCommon
import from LibItsCommon_Functions all;
// LibItsGeoNetworking
import from LibItsGeoNetworking_TestSystem all;
import from LibItsGeoNetworking_Functions all;
import from LibItsGeoNetworking_Templates all;
......
......@@ -625,7 +625,7 @@ module ItsSecurity_TestCases {
v_headersFields := valueof(v_geoNwInd.msgIn.gnPacket.securedMsg.header_fields);
// Check that signerInfo is first header
if ((lengthof(v_headersFields) < 1) or not match(v_headersFields[0].type_, e_signer_info)) {
if ((lengthof(v_headersFields) < 1) or v_headersFields[0].type_ != e_signer_info) {
log("*** " & testcasename() & ": FAIL: SignerInfo is not first header");
f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
}
......@@ -633,20 +633,21 @@ module ItsSecurity_TestCases {
for (var integer v_counter := 1; v_counter < lengthof(v_headersFields); v_counter := v_counter + 1) {
// Check forbidden header
// FIXME: 'generation_time_with_confidence' does not exist. is it e_generation_time_standard_deviation ?
if (match(v_headersFields[v_counter].type_, e_generation_time_standard_deviation)) {
if (v_headersFields[v_counter].type_ == e_generation_time_standard_deviation) {
log("*** " & testcasename() & ": FAIL: Forbidden header present");
f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
}
if (match(v_headersFields[v_counter].type_, e_signer_info)) {
if (v_headersFields[v_counter].type_ == e_signer_info) {
log("*** " & testcasename() & ": FAIL: multiple instances of signer_info header");
f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
}
if (v_counter > 1 ) {
// Check that headers are ordered
if (match(v_headersFields[v_counter].type_, integer:(0..v_previousHeaderType))) {
//FIXME v_previousHeaderType is not initialized before use, it will cause dynamic test case error (DTE)
if (enum2int(v_headersFields[v_counter].type_) <= v_previousHeaderType) {
// Check that header is duplicated
if (match(v_headersFields[v_counter].type_, v_previousHeaderType)) {
if (enum2int(v_headersFields[v_counter].type_) == v_previousHeaderType) {
log("*** " & testcasename() & ": FAIL: multiple instances of same header");
f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
}else{
......@@ -2408,7 +2409,7 @@ module ItsSecurity_TestCases {
v_headersFields := valueof(v_geoNwInd.msgIn.gnPacket.securedMsg.header_fields);
// Check that signerInfo is first header
if (lengthof(v_headersFields) < 1 or not match(v_headersFields[0].type_, e_signer_info)) {
if (lengthof(v_headersFields) < 1 or (v_headersFields[0].type_ != e_signer_info)) {
log("*** " & testcasename() & ": FAIL: SignerInfo is not first header");
f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
}
......@@ -2416,23 +2417,23 @@ module ItsSecurity_TestCases {
v_previousHeaderType := enum2int(v_headersFields[0].type_);
for (var integer v_counter := 1; v_counter < lengthof(v_headersFields); v_counter := v_counter + 1) {
// Check forbidden header
if (match(v_headersFields[v_counter].type_, e_generation_time_standard_deviation)) {
if (v_headersFields[v_counter].type_ == e_generation_time_standard_deviation) {
log("*** " & testcasename() & ": FAIL: Forbidden header present");
f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
}
if (match(v_headersFields[v_counter].type_, e_signer_info)) {
if (v_headersFields[v_counter].type_ == e_signer_info) {
log("*** " & testcasename() & ": FAIL: multiple instances of signer_info header");
f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
}
if (v_counter > 1 ) {
// Check that no header is duplicated
if (match(v_headersFields[v_counter].type_, v_previousHeaderType)) {
if (enum2int(v_headersFields[v_counter].type_) == v_previousHeaderType) {
log("*** " & testcasename() & ": FAIL: multiple instances of the same header");
f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
}
// Check that headers are ordered
if (match(v_headersFields[v_counter].type_, integer:(0..v_previousHeaderType))) {
if (enum2int(v_headersFields[v_counter].type_) <= v_previousHeaderType) {
log("*** " & testcasename() & ": FAIL: headers are not in the correct order");
f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
}
......@@ -3621,20 +3622,21 @@ module ItsSecurity_TestCases {
v_headersFields := valueof(v_geoNwInd.msgIn.gnPacket.securedMsg.header_fields);
// Check that signerInfo is first header
if (lengthof(v_headersFields) < 1 or not match(v_headersFields[0].type_, e_signer_info)) {
if (lengthof(v_headersFields) < 1 or (v_headersFields[0].type_ != e_signer_info)) {
log("*** " & testcasename() & ": FAIL: SignerInfo is not first header");
f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
}
for (v_counter := 1; v_counter < lengthof(v_headersFields); v_counter := v_counter + 1) {
// Check that no header is duplicated
if (match(v_headersFields[v_counter].type_, e_signer_info)) {
if (v_headersFields[v_counter].type_ == e_signer_info) {
log("*** " & testcasename() & ": FAIL: multiple instances of signer_info");
f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
}
if (v_counter > 1) {
// Check that headers are ordered
//FIXME v_previousHeaderType is not initialized before use, it will cause dynamic test case error (DTE)
if (v_headersFields[v_counter].type_ == v_previousHeaderType) {
log("*** " & testcasename() & ": FAIL: multiple instances of same Header");
f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
......@@ -4932,8 +4934,8 @@ module ItsSecurity_TestCases {
log("*** " & testcasename() & ": FAIL: Certificate[ " & int2str(v_counter) & "] doesn't contain signer info ***");
f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
}
if (not match(v_si.type_, e_certificate_digest_with_sha256)) {
if (not match(v_si.type_, e_certificate_digest_with_other_algorithm) or PICS_PLUGTEST_VERSION) {
if (v_si.type_ != e_certificate_digest_with_sha256) {
if (v_si.type_ != e_certificate_digest_with_other_algorithm or PICS_PLUGTEST_VERSION) {
log("*** " & testcasename() & ": FAIL: Certificate is not signed with digest ***");
f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
}
......@@ -4952,7 +4954,7 @@ module ItsSecurity_TestCases {
f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
}
// Process certificate[0]
if (not match (v_si.type_, e_certificate_digest_with_sha256)) {
if (v_si.type_ != e_certificate_digest_with_sha256) {
log("*** " & testcasename() & ": FAIL: Certificate[0] is not signed with digest ***");
f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
}
......@@ -5748,7 +5750,7 @@ module ItsSecurity_TestCases {
v_result_status := e_error;
break;
}
if (not match (v_si.type_, e_certificate_digest_with_sha256)) {
if (v_si.type_ != e_certificate_digest_with_sha256) {
log("*** " & testcasename() & ": FAIL: Certificate is not signed with digest ***");
v_result_status := e_error;
break;
......@@ -5892,7 +5894,7 @@ module ItsSecurity_TestCases {
v_result_status := e_error;
break;
}
if (not match (v_si.type_, e_certificate_digest_with_sha256)) {
if (v_si.type_ != e_certificate_digest_with_sha256) {
log("*** " & testcasename() & ": FAIL: Certificate is not signed with digest ***");
v_result_status := e_error;
break;
......@@ -6013,8 +6015,8 @@ module ItsSecurity_TestCases {
f_selfOrClientSyncAndVerdictPreamble(c_tbDone, e_error);
}
v_aa_cert := v_chain[lengthof(v_chain) - 1];
if (match (v_aa_cert.validity_restrictions, (superset(mw_validity_restriction_time_end,
mw_validity_restriction_time_start_and_duration)))
if (match (v_aa_cert.validity_restrictions, superset(mw_validity_restriction_time_end,
mw_validity_restriction_time_start_and_duration))
) {
log("*** " & testcasename() & ": FAIL: AA certificate must not contain time_end and time_start_and_duration restrictions ***");
f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
......@@ -6605,7 +6607,7 @@ module ItsSecurity_TestCases {
log("*** " & testcasename() & ": FAIL: AT Certificate signer info is unknown ***");
f_selfOrClientSyncAndVerdictPreamble(c_tbDone, e_error);
}
if (not match (v_si.type_, e_certificate_digest_with_sha256)) {
if (v_si.type_ != e_certificate_digest_with_sha256) {
log("*** " & testcasename() & ": FAIL: AT Certificate is not signed well ***");
f_selfOrClientSyncAndVerdictPreamble(c_tbDone, e_error);
}
......@@ -6761,7 +6763,7 @@ module ItsSecurity_TestCases {
log("*** " & testcasename() & ": FAIL: Certificate "&int2str(v_counter) & " doesn't have a signer info ***");
f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
}
if (not match (v_si.type_, e_certificate_digest_with_sha256)) {
if (v_si.type_ != e_certificate_digest_with_sha256) {
log("*** " & testcasename() & ": FAIL: Certificate is not signed with digest ***");
f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
}
......@@ -7435,12 +7437,10 @@ module ItsSecurity_TestCases {
v_cert := v_chain[lengthof(v_chain) - 2];
if (match(
v_cert.validity_restrictions,
(
superset(
mw_validity_restriction_time_end,
mw_validity_restriction_time_start_and_duration
)
)
)) {
log("*** " & testcasename() & ": FAIL: certificate[last-2] must not contain time_end and time_start_and_duration restrictions ***");
f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
......@@ -7448,16 +7448,16 @@ module ItsSecurity_TestCases {
for (var integer v_counter := 1; v_counter < lengthof(v_cert.validity_restrictions); v_counter := v_counter + 1) {
// Check forbidden header
if (not match(v_cert.validity_restrictions[v_counter].type_, e_time_start_and_end)) { // FIXME To be reviewed
if (v_cert.validity_restrictions[v_counter].type_ != e_time_start_and_end) { // FIXME To be reviewed
log("*** " & testcasename() & ": FAIL: Forbidden header present");
f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
}
if (v_counter > 1 ) {
// Check that headers are ordered
if (match(v_cert.validity_restrictions[v_counter].type_, integer:(0..v_previousValidityRestrictionType))) {
if (enum2int(v_cert.validity_restrictions[v_counter].type_) <= v_previousValidityRestrictionType) {
// Check that header is duplicated
if (match(v_cert.validity_restrictions[v_counter].type_, v_previousValidityRestrictionType)) {
if (enum2int(v_cert.validity_restrictions[v_counter].type_) == v_previousValidityRestrictionType) {
log("*** " & testcasename() & ": FAIL: multiple instances of same header");
f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
} else {
......@@ -7557,8 +7557,8 @@ module ItsSecurity_TestCases {
f_selfOrClientSyncAndVerdictPreamble(c_tbDone, e_error);
}
v_aa_cert := v_chain[lengthof(v_chain) - 2];
if (match (v_aa_cert.validity_restrictions, (superset(mw_validity_restriction_time_end,
mw_validity_restriction_time_start_and_duration)))
if (match (v_aa_cert.validity_restrictions, superset(mw_validity_restriction_time_end,
mw_validity_restriction_time_start_and_duration))
) {
log("*** " & testcasename() & ": FAIL: AA certificate must not contain time_end and time_start_and_duration restrictions ***");
f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
......@@ -7950,12 +7950,11 @@ module ItsSecurity_TestCases {
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);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment