Commit f448d843 authored by garciay's avatar garciay
Browse files

WeekSTF507: Week #3

.  Terminated review of existing Send TPs for Certificate profiles
.  Terminated review of existing  RECV CAM profiles
.  Added new RCs for RECV CAM profiles done
.  Started review of RECV DENM profiles
parent f6ffd942
......@@ -290,18 +290,18 @@ module AtsSecurity_Functions {
} // End of function f_prepareSecuredDenm
/**
* @desc Prepare a secured DENM including wrong elements of protocols. It is used for BO test cases
* @param p_configId The configuration identifier to be used
* @desc Prepare a secured DENM including wrong elements of protocols. It is used for BO test cases
* @param p_configId The configuration identifier to be used
* @param p_protocolVersion The protocol version to be set. Default: 2
* @param p_trailerStatus The Traile behaviour:
* <li>0 for no trailer</li>
* <li>1 for invalid trailer</li>
* <li>2 for duplicated trailer</li>
* @param p_headerFields HeaderFields to be inserted in the message
* @param p_signerInfoType Add digest or AT certificate or certificate chain
* @param p_addMissingHeaders Whether to add mandatory headers not present in p_headerFields
* @return Secured GeoNetworking packet containing a CAM
*/
* @param p_headerFields HeaderFields to be inserted in the message
* @param p_signerInfoType Add digest or AT certificate or certificate chain
* @param p_addMissingHeaders Whether to add mandatory headers not present in p_headerFields
* @return Secured GeoNetworking packet containing a CAM
*/
function f_prepareSecuredDenm_Bo(
in charstring p_configId,
in integer p_protocolVersion := c_protocol_version,
......@@ -418,6 +418,174 @@ module AtsSecurity_Functions {
} // End of group secDenm
group secBeacon {
/**
* @desc Prepare a secured Beacon
* @param p_configId The configuration identifier to be used
* @param p_headerFields HeaderFields to be inserted in the message
* @param p_signerInfoType Add digest or AT certificate or certificate chain
* @param p_addMissingHeaders Whether to add mandatory headers not present in p_headerFields
* @return Secured GeoNetworking packet containing a CAM
*/
function f_prepareSecuredBeacon(
in charstring p_configId,
in template (omit) HeaderFields p_headerFields := omit,
in SignerInfoType p_signerInfoType := e_certificate,
in boolean p_addMissingHeaders := true
) runs on ItsGeoNetworking return GeoNetworkingPdu {
// Local variables
var GnNonSecuredPacket v_gnNonSecuredPacket;
var octetstring v_gnPayload;
var LongPosVector v_longPosVectorNodeB := f_getPosition(c_compNodeB); // Use NodeB
var template (value) SecuredMessage v_securedMessage;
// Build signed SecuredMessage
v_gnNonSecuredPacket := valueof(
m_geoNwBroadcastPacket(
v_longPosVectorNodeB,
vc_localSeqNumber,
f_getGeoBroadcastArea(
c_area1 // Select area1 (see ETSI TS 102 871-2 Clause 4.2 Configuration 1)
)));
// Encode it
v_gnPayload := bit2oct(
encvalue(
v_gnNonSecuredPacket
)
);
f_buildGnSecuredOtherMessage(
v_securedMessage,
m_payload_signed(v_gnPayload),
p_signerInfoType,
valueof(m_threeDLocation(
v_longPosVectorNodeB.latitude,
v_longPosVectorNodeB.longitude,
'0000'O
)),
p_headerFields,
p_configId,
p_addMissingHeaders
);
// Return secured Gn packet
return valueof(m_geoNwSecPdu(v_gnNonSecuredPacket, v_securedMessage));
} // End of function f_prepareSecuredBeacon
/**
* @desc Prepare a secured Beacon including wrong elements of protocols. It is used for BO test cases
* @param p_configId The configuration identifier to be used
* @param p_protocolVersion The protocol version to be set. Default: 2
* @param p_trailerStatus The Traile behaviour:
* <li>0 for no trailer</li>
* <li>1 for invalid trailer</li>
* <li>2 for duplicated trailer</li>
* @param p_headerFields HeaderFields to be inserted in the message
* @param p_signerInfoType Add digest or AT certificate or certificate chain
* @param p_addMissingHeaders Whether to add mandatory headers not present in p_headerFields
* @return Secured GeoNetworking packet containing a CAM
*/
function f_prepareSecuredBeacon_Bo(
in charstring p_configId,
in integer p_protocolVersion := c_protocol_version,
in integer p_trailerStatus := 0,
in template (omit) HeaderFields p_headerFields := omit,
in SignerInfoType p_signerInfoType := e_certificate,
in boolean p_addMissingHeaders := true
) runs on ItsGeoNetworking return GeoNetworkingPdu {
// Local variables
var GnNonSecuredPacket v_gnNonSecuredPacket;
var octetstring v_gnPayload;
var LongPosVector v_longPosVectorNodeB := f_getPosition(c_compNodeB); // Use NodeB
var template (value) SecuredMessage v_securedMessage;
// Build signed SecuredMessage
v_gnNonSecuredPacket := valueof(
m_geoNwBroadcastPacket(
v_longPosVectorNodeB,
vc_localSeqNumber,
f_getGeoBroadcastArea(
c_area1 // Select area1 (see ETSI TS 102 871-2 Clause 4.2 Configuration 1)
)));
// Encode it
v_gnPayload := bit2oct(
encvalue(
v_gnNonSecuredPacket
)
);
f_buildGnSecuredOtherMessage_Bo(
v_securedMessage,
p_protocolVersion,
p_trailerStatus,
m_payload_signed(v_gnPayload),
p_signerInfoType,
valueof(m_threeDLocation(
v_longPosVectorNodeB.latitude,
v_longPosVectorNodeB.longitude,
'0000'O
)),
p_headerFields,
p_configId,
p_addMissingHeaders
);
// Return secured Gn packet
return valueof(m_geoNwSecPdu(v_gnNonSecuredPacket, v_securedMessage));
} // End of function f_prepareSecuredBeacon_Bo
/**
* @desc Sends a secured Beacon
* @param p_configId The configuration identifier to be used
* @param p_headerFields Additional HeaderFields
* @param p_signerInfoType Add digest or AT certificate or certificate chain
* @return GeoNetworking payload
*/
function f_sendSecuredBeacon(
in charstring p_configId,
in template (omit) HeaderFields p_headerFields := omit,
in SignerInfoType p_signerInfoType := e_certificate_digest_with_sha256
) runs on ItsGeoNetworking return GeoNetworkingPdu {
// Local variables
var GeoNetworkingPdu v_securedGnPdu := f_prepareSecuredBeacon(p_configId, p_headerFields, p_signerInfoType);
f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast(v_securedGnPdu));
return v_securedGnPdu;
} // End of function f_sendSecuredBeacon
/**
* @desc Sends a secured Beacon including wrong elements of protocols. It is used for BO test cases
* @param p_configId The configuration identifier to be used
* @param p_protocolVersion The protocol version to be set. Default: 2
* @param p_trailerStatus The Traile behaviour:
* <li>0 for no trailer</li>
* <li>1 for invalid trailer</li>
* <li>2 for duplicated trailer</li>
* @param p_headerFields Additional HeaderFields
* @param p_signerInfoType Add digest or AT certificate or certificate chain
* @return GeoNetworking payload
*/
function f_sendSecuredBeacon_Bo(
in charstring p_configId,
in integer p_protocolVersion := c_protocol_version,
in integer p_trailerStatus := 1,
in template (omit) HeaderFields p_headerFields := omit,
in SignerInfoType p_signerInfoType := e_certificate_digest_with_sha256
) runs on ItsGeoNetworking return GeoNetworkingPdu {
// Local variables
var GeoNetworkingPdu v_securedGnPdu := f_prepareSecuredBeacon_Bo(p_configId, p_protocolVersion, p_trailerStatus, p_headerFields, p_signerInfoType);
f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast(v_securedGnPdu));
return v_securedGnPdu;
} // End of function f_sendSecuredBeacon_Bo
} // End of group secBeacon
group camTrigger {
/**
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -22,10 +22,10 @@ module ItsSecurity_TestControl {
* @see ETSI TS 103 096-2 V1.2.2 (2016-01) Clause 5.2 Sending behaviour
*/
if (PICS_GN_SECURITY) {
execute(TC_SEC_ITSS_SND_MSG_01());
execute(TC_SEC_ITSS_SND_MSG_04_01());
execute(TC_SEC_ITSS_SND_MSG_04_02());
execute(TC_SEC_ITSS_SND_MSG_05_01());
execute(TC_SEC_ITSS_SND_MSG_01_01_BV());
execute(TC_SEC_ITSS_SND_MSG_04_01_BV());
execute(TC_SEC_ITSS_SND_MSG_04_02_BV());
execute(TC_SEC_ITSS_SND_MSG_05_01_BV());
/**
* @desc Sending behaviour test cases for CAM profile
......@@ -94,59 +94,62 @@ module ItsSecurity_TestControl {
execute(TC_SEC_ITSS_SND_GENMSG_05_06_BV());
}
execute(TC_SEC_ITSS_SND_GENMSG_06_01_BV());
execute(TC_SEC_ITSS_SND_GENMSG_07_01());
execute(TC_SEC_ITSS_SND_GENMSG_07_01_BV());
}
/**
* @desc Sending behaviour test cases for certificates profile
* @see ETSI TS 103 096-2 V1.2.2 (2016-01) Clause 5.2.7 Profiles for certificates
*/
execute(TC_SEC_SND_CERT_01_01());
execute(TC_SEC_SND_CERT_01_02());
execute(TC_SEC_SND_CERT_02_01());
execute(TC_SEC_SND_CERT_01_01_BV());
execute(TC_SEC_SND_CERT_01_02_BV());
execute(TC_SEC_SND_CERT_02_01_BV());
if (PICS_CERTIFICATE_SELECTION) {
if (PICS_USE_RECTANGULAR_REGION) {
execute(TC_SEC_SND_CERT_04_01());
execute(TC_SEC_SND_CERT_04_02());
execute(TC_SEC_SND_CERT_04_01_BV());
execute(TC_SEC_SND_CERT_04_02_BV());
}
if (PICS_USE_POLYGONAL_REGION) {
execute(TC_SEC_SND_CERT_05_01());
execute(TC_SEC_SND_CERT_05_02());
execute(TC_SEC_SND_CERT_05_01_BV());
execute(TC_SEC_SND_CERT_05_02_BV());
}
if (PICS_USE_IDENTIFIED_REGION) {
execute(TC_SEC_SND_CERT_06_01());
execute(TC_SEC_SND_CERT_06_02());
execute(TC_SEC_SND_CERT_06_01_BV());
execute(TC_SEC_SND_CERT_06_02_BV());
}
}
execute(TC_SEC_SND_CERT_07_01());
execute(TC_SEC_SND_CERT_08_01());
execute(TC_SEC_SND_CERT_09_01());
execute(TC_SEC_SND_CERT_09_02());
execute(TC_SEC_SND_CERT_07_01_BV());
execute(TC_SEC_SND_CERT_07_02_BV());
execute(TC_SEC_SND_CERT_08_01_BV());
execute(TC_SEC_SND_CERT_09_01_BV());
execute(TC_SEC_SND_CERT_09_02_BV());
execute(TC_SEC_SND_CERT_10_01_BV());
execute(TC_SEC_SND_CERT_10_02_BV());
execute(TC_SEC_SND_CERT_11_01_BV());
execute(TC_SEC_SND_CERT_11_02_BV());
/**
* @desc Sending behaviour test cases for AA certificate profil
* @see ETSI TS 103 096-2 V1.2.2 (2016-01) Clause 5.2.7.7 AA certificate profile
*/
execute(TC_SEC_SND_CERT_AA_01_01());
execute(TC_SEC_SND_CERT_AA_02_01());
execute(TC_SEC_SND_CERT_AA_04_01());
execute(TC_SEC_SND_CERT_AA_05_01());
execute(TC_SEC_SND_CERT_AA_06_01());
execute(TC_SEC_SND_CERT_AA_08_01());
execute(TC_SEC_SND_CERT_AT_01_01());
execute(TC_SEC_SND_CERT_AA_01_01_BV());
execute(TC_SEC_SND_CERT_AA_02_01_BV());
execute(TC_SEC_SND_CERT_AA_03_01_BV());
execute(TC_SEC_SND_CERT_AA_05_01_BV());
execute(TC_SEC_SND_CERT_AA_08_01_BV());
execute(TC_SEC_SND_CERT_AA_10_01_BV());
/**
* @desc Sending behaviour test cases for AT certificate profil
* @see ETSI TS 103 096-2 V1.2.2 (2016-01) Clause 5.2.7.8 AT certificate profile
*/
if (PICS_CERTIFICATE_SELECTION) {
execute(TC_SEC_SND_CERT_AT_02_01());
execute(TC_SEC_SND_CERT_AT_03_01());
execute(TC_SEC_SND_CERT_AT_04_01());
execute(TC_SEC_SND_CERT_AT_05_01());
execute(TC_SEC_SND_CERT_AT_07_01());
execute(TC_SEC_SND_CERT_AT_08_01());
execute(TC_SEC_SND_CERT_AT_09_01());
}
execute(TC_SEC_SND_CERT_AT_01_01_BV());
execute(TC_SEC_SND_CERT_AT_02_01_BV());
execute(TC_SEC_SND_CERT_AT_03_01_BV());
execute(TC_SEC_SND_CERT_AT_04_01_BV());
execute(TC_SEC_SND_CERT_AT_05_01_BV());
execute(TC_SEC_SND_CERT_AT_07_01_BV());
execute(TC_SEC_SND_CERT_AT_08_01_BV());
execute(TC_SEC_SND_CERT_AT_10_01_BV());
}
/**
......@@ -167,9 +170,16 @@ module ItsSecurity_TestControl {
execute(TC_SEC_ITSS_RCV_CAM_04_02_BO());
execute(TC_SEC_ITSS_RCV_CAM_04_03_BO());
execute(TC_SEC_ITSS_RCV_CAM_04_04_BO());
execute(TC_SEC_ITSS_RCV_CAM_04_05_BO());
execute(TC_SEC_ITSS_RCV_CAM_04_06_BO());
execute(TC_SEC_ITSS_RCV_CAM_04_07_BO());
execute(TC_SEC_ITSS_RCV_CAM_04_08_BO());
execute(TC_SEC_ITSS_RCV_CAM_04_09_BO());
execute(TC_SEC_ITSS_RCV_CAM_04_10_BO());
execute(TC_SEC_ITSS_RCV_CAM_05_01_BO());
execute(TC_SEC_ITSS_RCV_CAM_05_02_BO());
execute(TC_SEC_ITSS_RCV_CAM_05_03_BO());
execute(TC_SEC_ITSS_RCV_CAM_05_04_BO());
execute(TC_SEC_ITSS_RCV_CAM_07_01_BO());
execute(TC_SEC_ITSS_RCV_CAM_09_02_BO());
execute(TC_SEC_ITSS_RCV_CAM_09_03_BO());
......@@ -182,6 +192,8 @@ module ItsSecurity_TestControl {
execute(TC_SEC_ITSS_RCV_CAM_11_02_BO());
execute(TC_SEC_ITSS_RCV_CAM_12_01_BO());
execute(TC_SEC_ITSS_RCV_CAM_12_02_BO());
execute(TC_SEC_ITSS_RCV_CAM_12_03_BO());
execute(TC_SEC_ITSS_RCV_CAM_12_04_BO());
/**
* @desc Sending behaviour test cases for DENM profile
......
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